From 4fe889bbf8f1354d68a6f8c615c1eda85fa57463 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Wed, 26 Jul 2023 13:39:51 +1200 Subject: [PATCH] fix: Possible fix to image to image / refiner setting sync The main goal is to avoid noisy output no matter what the slider values are. --- .../nodes/util/graphBuilders/addSDXLRefinerToGraph.ts | 1 + .../graphBuilders/buildLinearSDXLImageToImageGraph.ts | 9 ++++++--- .../components/SDXLRefiner/ParamSDXLRefinerStart.tsx | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addSDXLRefinerToGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addSDXLRefinerToGraph.ts index 56a193c81f..c0d96105b5 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addSDXLRefinerToGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/addSDXLRefinerToGraph.ts @@ -98,6 +98,7 @@ export const addSDXLRefinerToGraph = ( steps: refinerSteps / (1 - refinerStart), scheduler: refinerScheduler, denoising_start: refinerStart, + denoising_end: 1, }; graph.edges.push( diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearSDXLImageToImageGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearSDXLImageToImageGraph.ts index d84b483df7..1465e5e606 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearSDXLImageToImageGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildLinearSDXLImageToImageGraph.ts @@ -36,10 +36,10 @@ export const buildLinearSDXLImageToImageGraph = ( scheduler, steps, initialImage, - img2imgStrength: strength, shouldFitToWidthHeight, width, height, + img2imgStrength: strength, clipSkip, shouldUseCpuNoise, shouldUseNoiseSettings, @@ -113,7 +113,10 @@ export const buildLinearSDXLImageToImageGraph = ( cfg_scale, scheduler, steps, - denoising_start: shouldUseSDXLRefiner ? refinerStart : 1 - strength, + denoising_start: shouldUseSDXLRefiner + ? Math.min(refinerStart, 1 - strength) + : 1 - strength, + denoising_end: shouldUseSDXLRefiner ? refinerStart : 1, }, [IMAGE_TO_LATENTS]: { type: 'i2l', @@ -337,7 +340,7 @@ export const buildLinearSDXLImageToImageGraph = ( controlnets: [], loras: [], clip_skip: clipSkip, - strength, + strength: strength, init_image: initialImage.imageName, positive_style_prompt: positiveStylePrompt, negative_style_prompt: negativeStylePrompt, diff --git a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerStart.tsx b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerStart.tsx index 987fb0aed7..83860cd6ab 100644 --- a/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerStart.tsx +++ b/invokeai/frontend/web/src/features/sdxl/components/SDXLRefiner/ParamSDXLRefinerStart.tsx @@ -38,7 +38,7 @@ const ParamSDXLRefinerStart = () => { return (