fix: Paste Back Not Respecting Inpainted Mask

This commit is contained in:
blessedcoolant 2023-08-24 02:49:15 +12:00 committed by Kent Keirsey
parent 111322b015
commit 9bafe4a94f
3 changed files with 8 additions and 138 deletions

View File

@ -42,8 +42,6 @@ import {
RANDOM_INT,
RANGE_OF_SIZE,
SEAM_FIX_DENOISE_LATENTS,
SEAM_MASK_COMBINE,
SEAM_MASK_RESIZE_DOWN,
SEAM_MASK_RESIZE_UP,
} from './constants';
@ -141,11 +139,6 @@ export const buildCanvasOutpaintGraph = (
is_intermediate: true,
mask2: canvasMaskImage,
},
[SEAM_MASK_COMBINE]: {
type: 'mask_combine',
id: MASK_COMBINE,
is_intermediate: true,
},
[MASK_BLUR]: {
type: 'img_blur',
id: MASK_BLUR,
@ -491,13 +484,6 @@ export const buildCanvasOutpaintGraph = (
width: width,
height: height,
};
graph.nodes[SEAM_MASK_RESIZE_DOWN] = {
type: 'img_resize',
id: SEAM_MASK_RESIZE_DOWN,
is_intermediate: true,
width: width,
height: height,
};
graph.nodes[NOISE] = {
...(graph.nodes[NOISE] as NoiseInvocation),
@ -570,26 +556,6 @@ export const buildCanvasOutpaintGraph = (
field: 'mask',
},
},
{
source: {
node_id: MASK_BLUR,
field: 'image',
},
destination: {
node_id: SEAM_MASK_COMBINE,
field: 'mask1',
},
},
{
source: {
node_id: SEAM_MASK_RESIZE_UP,
field: 'image',
},
destination: {
node_id: SEAM_MASK_COMBINE,
field: 'mask2',
},
},
// Resize Results Down
{
source: {
@ -611,16 +577,6 @@ export const buildCanvasOutpaintGraph = (
field: 'image',
},
},
{
source: {
node_id: SEAM_MASK_COMBINE,
field: 'image',
},
destination: {
node_id: SEAM_MASK_RESIZE_DOWN,
field: 'image',
},
},
{
source: {
node_id: INPAINT_INFILL,
@ -654,7 +610,7 @@ export const buildCanvasOutpaintGraph = (
},
{
source: {
node_id: SEAM_MASK_RESIZE_DOWN,
node_id: MASK_RESIZE_DOWN,
field: 'image',
},
destination: {
@ -685,7 +641,7 @@ export const buildCanvasOutpaintGraph = (
},
{
source: {
node_id: SEAM_MASK_RESIZE_DOWN,
node_id: MASK_RESIZE_DOWN,
field: 'image',
},
destination: {
@ -748,26 +704,6 @@ export const buildCanvasOutpaintGraph = (
field: 'mask',
},
},
{
source: {
node_id: MASK_FROM_ALPHA,
field: 'image',
},
destination: {
node_id: SEAM_MASK_COMBINE,
field: 'mask1',
},
},
{
source: {
node_id: MASK_EDGE,
field: 'image',
},
destination: {
node_id: SEAM_MASK_COMBINE,
field: 'mask2',
},
},
// Color Correct The Inpainted Result
{
source: {
@ -791,7 +727,7 @@ export const buildCanvasOutpaintGraph = (
},
{
source: {
node_id: SEAM_MASK_COMBINE,
node_id: MASK_BLUR,
field: 'image',
},
destination: {
@ -822,7 +758,7 @@ export const buildCanvasOutpaintGraph = (
},
{
source: {
node_id: SEAM_MASK_COMBINE,
node_id: MASK_BLUR,
field: 'image',
},
destination: {

View File

@ -42,8 +42,6 @@ import {
SDXL_DENOISE_LATENTS,
SDXL_MODEL_LOADER,
SEAM_FIX_DENOISE_LATENTS,
SEAM_MASK_COMBINE,
SEAM_MASK_RESIZE_DOWN,
SEAM_MASK_RESIZE_UP,
} from './constants';
import { craftSDXLStylePrompt } from './helpers/craftSDXLStylePrompt';
@ -144,11 +142,6 @@ export const buildCanvasSDXLOutpaintGraph = (
is_intermediate: true,
mask2: canvasMaskImage,
},
[SEAM_MASK_COMBINE]: {
type: 'mask_combine',
id: MASK_COMBINE,
is_intermediate: true,
},
[MASK_BLUR]: {
type: 'img_blur',
id: MASK_BLUR,
@ -506,13 +499,6 @@ export const buildCanvasSDXLOutpaintGraph = (
width: width,
height: height,
};
graph.nodes[SEAM_MASK_RESIZE_DOWN] = {
type: 'img_resize',
id: SEAM_MASK_RESIZE_DOWN,
is_intermediate: true,
width: width,
height: height,
};
graph.nodes[NOISE] = {
...(graph.nodes[NOISE] as NoiseInvocation),
@ -585,26 +571,6 @@ export const buildCanvasSDXLOutpaintGraph = (
field: 'mask',
},
},
{
source: {
node_id: MASK_BLUR,
field: 'image',
},
destination: {
node_id: SEAM_MASK_COMBINE,
field: 'mask1',
},
},
{
source: {
node_id: SEAM_MASK_RESIZE_UP,
field: 'image',
},
destination: {
node_id: SEAM_MASK_COMBINE,
field: 'mask2',
},
},
// Resize Results Down
{
source: {
@ -626,16 +592,6 @@ export const buildCanvasSDXLOutpaintGraph = (
field: 'image',
},
},
{
source: {
node_id: SEAM_MASK_COMBINE,
field: 'image',
},
destination: {
node_id: SEAM_MASK_RESIZE_DOWN,
field: 'image',
},
},
{
source: {
node_id: INPAINT_INFILL,
@ -669,7 +625,7 @@ export const buildCanvasSDXLOutpaintGraph = (
},
{
source: {
node_id: SEAM_MASK_RESIZE_DOWN,
node_id: MASK_RESIZE_DOWN,
field: 'image',
},
destination: {
@ -700,7 +656,7 @@ export const buildCanvasSDXLOutpaintGraph = (
},
{
source: {
node_id: SEAM_MASK_RESIZE_DOWN,
node_id: MASK_RESIZE_DOWN,
field: 'image',
},
destination: {
@ -763,26 +719,6 @@ export const buildCanvasSDXLOutpaintGraph = (
field: 'mask',
},
},
{
source: {
node_id: MASK_FROM_ALPHA,
field: 'image',
},
destination: {
node_id: SEAM_MASK_COMBINE,
field: 'mask1',
},
},
{
source: {
node_id: MASK_EDGE,
field: 'image',
},
destination: {
node_id: SEAM_MASK_COMBINE,
field: 'mask2',
},
},
// Color Correct The Inpainted Result
{
source: {
@ -806,7 +742,7 @@ export const buildCanvasSDXLOutpaintGraph = (
},
{
source: {
node_id: SEAM_MASK_COMBINE,
node_id: MASK_BLUR,
field: 'image',
},
destination: {
@ -837,7 +773,7 @@ export const buildCanvasSDXLOutpaintGraph = (
},
{
source: {
node_id: SEAM_MASK_COMBINE,
node_id: MASK_BLUR,
field: 'image',
},
destination: {

View File

@ -30,9 +30,7 @@ export const MASK_FROM_ALPHA = 'tomask';
export const MASK_EDGE = 'mask_edge';
export const MASK_BLUR = 'mask_blur';
export const MASK_COMBINE = 'mask_combine';
export const SEAM_MASK_COMBINE = 'seam_mask_combine';
export const SEAM_MASK_RESIZE_UP = 'seam_mask_resize_up';
export const SEAM_MASK_RESIZE_DOWN = 'seam_mask_resize_down';
export const MASK_RESIZE_UP = 'mask_resize_up';
export const MASK_RESIZE_DOWN = 'mask_resize_down';
export const COLOR_CORRECT = 'color_correct';