浏览代码

Merge pull request #16239 from AUTOMATIC1111/fix-upscale-logic

fix upscale logic
AUTOMATIC1111 1 年之前
父节点
当前提交
e09104a126
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      modules/upscaler.py

+ 2 - 2
modules/upscaler.py

@@ -56,8 +56,8 @@ class Upscaler:
         dest_w = int((img.width * scale) // 8 * 8)
         dest_w = int((img.width * scale) // 8 * 8)
         dest_h = int((img.height * scale) // 8 * 8)
         dest_h = int((img.height * scale) // 8 * 8)
 
 
-        for _ in range(3):
-            if img.width >= dest_w and img.height >= dest_h and scale != 1:
+        for i in range(3):
+            if img.width >= dest_w and img.height >= dest_h and (i > 0 or scale != 1):
                 break
                 break
 
 
             if shared.state.interrupted:
             if shared.state.interrupted: