From 8c688f8e29c8953353d0c28ec8d88845a3c63a65 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Fri, 9 Jun 2023 13:54:23 +1000 Subject: [PATCH] feat(ui): skip resize on img2img if not needed --- .../nodes/util/graphBuilders/buildImageToImageGraph.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildImageToImageGraph.ts b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildImageToImageGraph.ts index a1dc5d48ab..f8fea7e4d7 100644 --- a/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildImageToImageGraph.ts +++ b/invokeai/frontend/web/src/features/nodes/util/graphBuilders/buildImageToImageGraph.ts @@ -342,7 +342,10 @@ export const buildImageToImageGraph = (state: RootState): Graph => { }); } - if (shouldFitToWidthHeight) { + if ( + shouldFitToWidthHeight && + (initialImage.width !== width || initialImage.height !== height) + ) { // The init image needs to be resized to the specified width and height before being passed to `IMAGE_TO_LATENTS` // Create a resize node, explicitly setting its image