Repository navigation
[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
Draft
PaulFidika wants to merge 2 commits into
PaulFidika wants to merge 2 commits into
Conversation
…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.
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.
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-2upscalenow restores the picture instead of sharpening it.output_resolution) and ComfyUI'sresolution 0keeps it, so the edit stays aligned to it.QwenImage21VAE.encode_reference_imagestakes an optional canvas size.denoiseandreference_gridsread each reference's size from the image as it was encoded, not by recomputing 1 MP. Theimagetool's references are unchanged (1 MP).denoisefield 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.creativityslider: 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.Measurement, all on 1x rtx-4090 from cozy-creator
release/se147-proof; tables are in tracker se-147: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.