Skip to content

[next RC] qwen-image-2 upscale: restore from noise with the picture at the canvas, not one step over a blow-up (se-147) - #959

Draft
PaulFidika wants to merge 2 commits into
rc/0.26.0from
claude/se-147-upscale
Draft

PaulFidika wants to merge 2 commits into
rc/0.26.0from
claude/se-147-upscale

Conversation

@PaulFidika

@PaulFidika PaulFidika commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

se-147. Paul, 11-17: "upscaling doesn't work. I attached the qwen image 2.1 upscaler to an image and ran it, and it just made the image more of the same. The image was small and had JPEG artifacts; those JPG artifacts just became more embellished, rather than fixed."

What changes

qwen-image-2 upscale now restores the picture instead of sharpening it.

  • Before: one Fun Acc Turbo step at sigma 0.2 over a ~9× Lanczos blow-up, with the picture as a 1 MP reference. That step sharpened the blow-up's JPEG blocks.
  • Now: the base model edits from noise in 20 steps, with a restoration request. The picture is the reference at the canvas size, as Diffusers sizes a condition image to its output (output_resolution) and ComfyUI's resolution 0 keeps it, so the edit stays aligned to it.
  • QwenImage21VAE.encode_reference_images takes an optional canvas size. denoise and reference_grids read each reference's size from the image as it was encoded, not by recomputing 1 MP. The image tool's references are unchanged (1 MP).
  • Removed: the tool's denoise field and its Fun Acc slot. A start from the blow-up keeps its blur at every strength we tried (0.5–0.9, Turbo and base). Fun Acc's 4 steps zoom and redraw the picture.
  • No creativity slider: measured, Qwen has no sampler dial that trades strict for creative. Start strength is a cliff, and reference size only loosens alignment. Details in tracker se-147.

[next RC]: draft until the coordinator names the merge target. Version: qwen-image-2's next prerelease is set when it lands.

Proof

Release-gate suite upscale (cozy-creator#3720) on 1x rtx-4090, the RC's builds: cozy 0.26.0-dev+gec8ec2ae, Runtime 0.47.0.dev2308+g79d992ec, TensorFS 0.25.1+dev.gec8ec2ae, lane int8, attention kitchen-int8. Cells: konqi-friends, hokusai-wave and kiki, 225 px JPEGs, at the tool's defaults, seed 42.

gate packages upscale-qwen-dists runs exec (first / warm) generating peak reserved
red 44086547646 rc/0.26.0 d1a09cb (the current tool) FAIL: DISTS 0.3407 vs Lanczos 0.3400 (−0.2%; bar 30%) 2–4 11.2 / 3.2 s 1.2 s, 1 step 21.6 GiB
green 44089974446 058fe48 + se-149's a834d3c PASS: 0.1476 vs 0.3400 (+56.6%) 2–4 36.7 / 28.8 s 25.9 s, 20 steps 21.8 GiB

Measurement, all on 1x rtx-4090 from cozy-creator release/se147-proof; tables are in tracker se-147:

  • pod-session 44057846726: 12 candidates × 11 pictures. The current tool scores like Lanczos. With Turbo, partial-noise starts stay blurry; Turbo from noise drifts. The base model from noise at the canvas is the best of all, and SeedVR2 is close.
  • pod-session 44073117278: base steps 20 / 28 / 40 tie. Start strength 0.75 / 0.9 stays blurry. A 2 MP or 1 MP reference only loosens alignment.
  • Final: pod-session 44096098734, current tool (rc/0.26.0 d1a09cb) vs this branch (058fe48), seed 42, graham. Bars PASS: DISTS 0.1236 against Lanczos 0.3397 (+63.6%) and against the current tool 0.3384 (+63.5%), over 9 pictures. Fix exec median 29.5 s.
set Lanczos DISTS / LPIPS current tool this branch MUSIQ L / current / this
art (7) .345 / .468 .347 / .460 .117 / .168 40 / 40 / 73
photo (2) .322 / .566 .308 / .538 .148 / .215 41 / 42 / 73
Paul's Groudon and Kyogre (no reference) 50 / 51 / 76

By eye, on Paul's two (private, not in the artifact in the clear), the current tool sharpens the blow-up's blocks; this branch returns clean official art, with crisp outlines, flat cel fills and no blocks.

Slower than the current tool (3.6 s → 28.8 s warm on a 4090), because the current tool did nothing useful: 1 step against 20.

…it can be encoded at the canvas (se-147)

encode_reference_images takes an optional canvas, as Diffusers sizes a reference to its output (output_resolution);
denoise and reference_grids read each reference's size from the image as encoded instead of recomputing 1 MP.
The base model edits the picture from noise in 20 steps with a restoration request, the picture its reference at
the canvas's size (Diffusers' output_resolution), so the edit keeps to it. The old way, one Turbo step at sigma 0.2
over a ~9x Lanczos blow-up, sharpened its JPEG blocks: on 225 px JPEGs of clean pictures its DISTS to the originals
was the blow-up's (0.347 vs 0.345); this is 0.13. A start from the blow-up keeps the blur at any strength (0.5-0.9,
Turbo and base), and Fun Acc's 4 steps zoom and redraw, so neither stays: no denoise field, no Turbo slot.
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.

1 participant