From 19c6e10edacddb9bccf4e0aae7fba2dbefafc82e 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 e59a6ace..755bca2f 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -623,6 +623,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) {