aboutsummaryrefslogtreecommitdiff
path: root/modules/upscaler.py
diff options
context:
space:
mode:
authorCodeHatchling <steve@codehatch.com>2023-12-04 20:38:13 -0700
committerCodeHatchling <steve@codehatch.com>2023-12-04 20:38:13 -0700
commit38864816fa8c83d079a49f94674ca3dede9dcaad (patch)
treedfd1b97ad7c5c66ffc5c8641c6e7cc635441e82b /modules/upscaler.py
parent49bbf1140731036875573bb7c44aa7e74623c856 (diff)
parent22e23dbf29b0bbc807daa57318c31145f8dd0774 (diff)
Merge remote-tracking branch 'origin2/dev' into soft-inpainting
# Conflicts: # modules/processing.py
Diffstat (limited to 'modules/upscaler.py')
-rw-r--r--modules/upscaler.py6
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)