Skip to content

Commit

Permalink
Merge pull request #16239 from AUTOMATIC1111/fix-upscale-logic
Browse files Browse the repository at this point in the history
fix upscale logic
  • Loading branch information
AUTOMATIC1111 authored Jul 20, 2024
2 parents 141d4b7 + 964fc13 commit e09104a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/upscaler.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def upscale(self, img: PIL.Image, scale, selected_model: str = None):
dest_w = int((img.width * 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

if shared.state.interrupted:
Expand Down

0 comments on commit e09104a

Please sign in to comment.