From 097e92db6a02b18df0677cf1db643bd05bb95ed6 Mon Sep 17 00:00:00 2001 From: Riku Date: Mon, 28 Oct 2024 11:06:38 +0100 Subject: [PATCH] fix(ui): always write seamless metadata Ensure images without seamless enabled correctly reset the setting when all parameters are recalled --- .../nodes/util/graph/generation/addSeamless.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/invokeai/frontend/web/src/features/nodes/util/graph/generation/addSeamless.ts b/invokeai/frontend/web/src/features/nodes/util/graph/generation/addSeamless.ts index 5424f05b0b..167de85062 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graph/generation/addSeamless.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graph/generation/addSeamless.ts @@ -23,6 +23,12 @@ export const addSeamless = ( ): Invocation<'seamless'> | null => { const { seamlessXAxis: seamless_x, seamlessYAxis: seamless_y } = state.params; + // Always write seamless metadata to ensure recalling all parameters will reset the seamless settings + g.upsertMetadata({ + seamless_x, + seamless_y, + }); + if (!seamless_x && !seamless_y) { return null; } @@ -34,11 +40,6 @@ export const addSeamless = ( seamless_y, }); - g.upsertMetadata({ - seamless_x: seamless_x || undefined, - seamless_y: seamless_y || undefined, - }); - // Seamless slots into the graph between the model loader and the denoise node g.deleteEdgesFrom(modelLoader, ['unet']); g.deleteEdgesFrom(modelLoader, ['vae']);