diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-12-02 09:11:21 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-12-02 09:11:21 +0000 |
commit | 4a666381bf98333ba4512db0f0033df5f6a08771 (patch) | |
tree | a7046d79bbfef6a9f9963d059713f871b7275d11 /modules/upscaler.py | |
parent | 0bb6e00ba3c6775b17b3449c454c6efabb1bdad1 (diff) | |
download | stable-diffusion-webui-gfx803-4a666381bf98333ba4512db0f0033df5f6a08771.tar.gz stable-diffusion-webui-gfx803-4a666381bf98333ba4512db0f0033df5f6a08771.tar.bz2 stable-diffusion-webui-gfx803-4a666381bf98333ba4512db0f0033df5f6a08771.zip |
extras tab batch: actually use original filename
preprocessing upscale: do not do an extra upscale step if it's not needed
Diffstat (limited to 'modules/upscaler.py')
-rw-r--r-- | modules/upscaler.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/upscaler.py b/modules/upscaler.py index e682bbaa..b256e085 100644 --- a/modules/upscaler.py +++ b/modules/upscaler.py @@ -57,6 +57,9 @@ class Upscaler: dest_h = int((img.height * scale) // 8 * 8) for _ in range(3): + if img.width >= dest_w and img.height >= dest_h: + break + shape = (img.width, img.height) img = self.do_upscale(img, selected_model) @@ -64,9 +67,6 @@ class Upscaler: if shape == (img.width, img.height): break - if img.width >= dest_w and img.height >= dest_h: - break - if img.width != dest_w or img.height != dest_h: img = img.resize((int(dest_w), int(dest_h)), resample=LANCZOS) |