diff options
author | Kohaku-Blueleaf <59680068+KohakuBlueleaf@users.noreply.github.com> | 2023-12-03 02:54:54 +0000 |
---|---|---|
committer | Kohaku-Blueleaf <59680068+KohakuBlueleaf@users.noreply.github.com> | 2023-12-03 02:54:54 +0000 |
commit | 9a15ae2a92e55d614fe515cd0a104d90b854b23f (patch) | |
tree | 7977ea1ea27cfc1d21e652433f8bbc0faec0ddc9 /modules/upscaler.py | |
parent | 50a21cb09fe3e9ea2d4fe058e0484e192c8a86e3 (diff) | |
parent | ac02216e540cd581f9169c6c791e55721e3117b0 (diff) | |
download | stable-diffusion-webui-gfx803-9a15ae2a92e55d614fe515cd0a104d90b854b23f.tar.gz stable-diffusion-webui-gfx803-9a15ae2a92e55d614fe515cd0a104d90b854b23f.tar.bz2 stable-diffusion-webui-gfx803-9a15ae2a92e55d614fe515cd0a104d90b854b23f.zip |
Merge branch 'dev' into test-fp8
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) |