diff options
author | CodeHatchling <steve@codehatch.com> | 2023-12-05 03:38:13 +0000 |
---|---|---|
committer | CodeHatchling <steve@codehatch.com> | 2023-12-05 03:38:13 +0000 |
commit | 38864816fa8c83d079a49f94674ca3dede9dcaad (patch) | |
tree | dfd1b97ad7c5c66ffc5c8641c6e7cc635441e82b /modules/upscaler.py | |
parent | 49bbf1140731036875573bb7c44aa7e74623c856 (diff) | |
parent | 22e23dbf29b0bbc807daa57318c31145f8dd0774 (diff) | |
download | stable-diffusion-webui-gfx803-38864816fa8c83d079a49f94674ca3dede9dcaad.tar.gz stable-diffusion-webui-gfx803-38864816fa8c83d079a49f94674ca3dede9dcaad.tar.bz2 stable-diffusion-webui-gfx803-38864816fa8c83d079a49f94674ca3dede9dcaad.zip |
Merge remote-tracking branch 'origin2/dev' into soft-inpainting
# Conflicts:
# modules/processing.py
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) |