Skip to content

Fix Scale by 1x not running upscaler on Extras tab - #17441

Open
Functionhx wants to merge 1 commit into
AUTOMATIC1111:devfrom
Functionhx:fix/scale-1x
Open

Fix Scale by 1x not running upscaler on Extras tab#17441
Functionhx wants to merge 1 commit into
AUTOMATIC1111:devfrom
Functionhx:fix/scale-1x

Conversation

@Functionhx

@Functionhx Functionhx commented Jul 9, 2026

Copy link
Copy Markdown

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:

  • Tested locally

@Functionhx
Functionhx requested a review from AUTOMATIC1111 as a code owner July 9, 2026 19:25
@Functionhx
Functionhx changed the base branch from master to dev July 10, 2026 10:04
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Scale by 1x in 1.7.0 does nothing on "Extras tab" and "SD Upscale" script

1 participant