Open NPDX909 opened 1 month ago
I think draft fixes it https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/14794 (not pushed though)
note
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
Additional information
No response