From 26cbc304074da967fd7995d26cd8fbf807780a69 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Mon, 10 Feb 2025 12:49:38 +0530 Subject: [PATCH] Use the correct size of the image when used as the input. Code credit: @AvidGameFan --- ui/media/js/main.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/media/js/main.js b/ui/media/js/main.js index bff87b3b..6057cb5f 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -611,6 +611,13 @@ function onUseAsInputClick(req, img) { initImagePreview.src = imgData maskSetting.checked = false + + //Force the image settings size to match the input, as inpaint currently only works correctly + //if input image and generate sizes match. + addImageSizeOption(img.naturalWidth); + addImageSizeOption(img.naturalHeight); + widthField.value = img.naturalWidth; + heightField.value = img.naturalHeight; } function onUseForControlnetClick(req, img) {