Fix Scale by 1x not running upscaler on Extras tab - #17441
Open
Functionhx wants to merge 1 commit into
Open
Conversation
Commit 4a66638 moved the pre-do_upscale guard from after do_upscale to before it, causing 1x scale post-processing models to be skipped entirely when image dimensions were multiples of 8. Later the hack (i > 0 or scale != 1) was added as a bandaid. Restore the original two-guard loop structure: - A > guard before do_upscale: only break when image is strictly larger than target (avoids wasted upscaling for downscale) - A >= guard after do_upscale: break once target dimensions are reached (normal upscaling completion) Fixes: AUTOMATIC1111#14738 Fixes: 4a66638 Signed-off-by: Yuchen Fan <functionhx@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #14738.
Root cause: a previous commit moved the upscale loop's break guard before do_upscale. For scale=1, img.width >= dest_w was true on the first iteration, breaking before the upscaler ever ran.
Fix: restructured with two guards — a > guard before do_upscale (only breaks when image strictly larger than target, preventing wasted work for downscales), and a >= guard after do_upscale (normal completion check).
Screenshots/videos:
N/A — no visual changes
Checklist: