diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-12-16 07:05:10 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-12-16 07:05:10 +0000 |
commit | e9c6325fc635302e2b4b8295345833cb8b15f7fb (patch) | |
tree | b501070bcf1ae667b1555e682598973818c945e0 /modules/upscaler.py | |
parent | 29f04149b60bcf6e8e2b41a161d6cc7e8981710f (diff) | |
parent | 7504f14503d6ce5a014f1c558ea4f4d57675e1e9 (diff) | |
download | stable-diffusion-webui-gfx803-e9c6325fc635302e2b4b8295345833cb8b15f7fb.tar.gz stable-diffusion-webui-gfx803-e9c6325fc635302e2b4b8295345833cb8b15f7fb.tar.bz2 stable-diffusion-webui-gfx803-e9c6325fc635302e2b4b8295345833cb8b15f7fb.zip |
Merge branch 'dev' into torch210
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) |