You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The if statement on line 59 checks three conditions simultaneously: img.width >= dest_w, img.height >= dest_h, and scale != 1.
The loop will break only if all three conditions are met. If any one of them is not met, the loop will continue to the next iteration.
The code inside the loop does not include any logic for upscaling the image. Without upscaling logic, the image dimensions will not change, and the conditions will not be reevaluated correctly.
There is no check to see if the dimensions of the image have changed after a potential upscaling operation. This means there's no way to break the loop if the upscaling doesn't affect the image dimensions.
So here's what I tried to do:
Check if the image dimensions are already at or above the desired width and height. If so, it breaks out of the loop.
Store the current dimensions of the image in shape.
Upscale the image using the do_upscale method and the selected model.
Check if the dimensions of the image are the same after upscaling. If so, it breaks out of the loop.
Remove lines 59-61 in upscaler.py and insert this instead
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)
if shape == (img.width, img.height):
break
the description of the issue is wrong, infinite loop can not cannot occur as it is cap to 3 loops
the proposed fixed with cause no upscall to be performed when scale is set to 1x
people set scale to 1x when using 1x upscaller models, in this case it should perform "upscale" 1 time and then break
if your fix is used, no upscale will be perform when scale is set to 1x
Checklist
What happened?
The current (9d4fdc4) copy of upscaler.py does not fix the 1x upscaler infinite loop issue: https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/master/modules/upscaler.py. Here is what is wrong ...
The if statement on line 59 checks three conditions simultaneously: img.width >= dest_w, img.height >= dest_h, and scale != 1.
The loop will break only if all three conditions are met. If any one of them is not met, the loop will continue to the next iteration.
The code inside the loop does not include any logic for upscaling the image. Without upscaling logic, the image dimensions will not change, and the conditions will not be reevaluated correctly.
There is no check to see if the dimensions of the image have changed after a potential upscaling operation. This means there's no way to break the loop if the upscaling doesn't affect the image dimensions.
So here's what I tried to do:
Remove lines 59-61 in upscaler.py and insert this instead
Hooray, it upscales now!
sysinfo-2024-07-18-21-29.json
Chrome Version 126.0.6478.127 Windows 10 2080 GTX with 8GB
Steps to reproduce the problem
Use any upscaler and set "upscale by" to 1x
What should have happened?
Should've upscaled
What browsers do you use to access the UI ?
Google Chrome
Sysinfo
sysinfo-2024-07-18-21-29.json
Console logs
wasn't saving them to txt sorry
Additional information
No response
The text was updated successfully, but these errors were encountered: