From a1fb9bc65c74048d10603450ec9563cac4ed9ce7 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Fri, 7 Feb 2025 10:46:03 +0530 Subject: [PATCH] Revert "Merge pull request #1874 from AvidGameFan/inpaint_mask_size" This reverts commit f737921eaafa723dc4add4a15c98e6dd04591cc3, reversing changes made to b12a6b953775b35601e1512215c06536b8df99ee. --- ui/media/js/image-editor.js | 9 +++------ ui/media/js/main.js | 7 ------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/ui/media/js/image-editor.js b/ui/media/js/image-editor.js index 8727cbf9..dac172fd 100644 --- a/ui/media/js/image-editor.js +++ b/ui/media/js/image-editor.js @@ -557,17 +557,14 @@ class ImageEditor { if (width == this.width && height == this.height) { return } - //The below code tries to limit the size of the image to fit within the editor window. - //However, at this time, this causes problems with a mis-match between the mask size and - //the requested image size. For now, allow the drawing/inpaint window to be as large - //as necessary. + if (width > height) { - var max_size = width; //Math.min(parseInt(window.innerWidth * 0.9), width) + var max_size = Math.min(parseInt(window.innerWidth * 0.9), width, 768) var multiplier = max_size / width width = (multiplier * width).toFixed() height = (multiplier * height).toFixed() } else { - var max_size = height; //Math.min(parseInt(window.innerHeight * 0.9), height) + var max_size = Math.min(parseInt(window.innerHeight * 0.9), height, 768) var multiplier = max_size / height width = (multiplier * width).toFixed() height = (multiplier * height).toFixed() diff --git a/ui/media/js/main.js b/ui/media/js/main.js index 755bca2f..e59a6ace 100644 --- a/ui/media/js/main.js +++ b/ui/media/js/main.js @@ -623,13 +623,6 @@ 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) {