Repository navigation
fix(qwen-image-2-1): hold the base model's shift at the end of its fit - #9902
Merged
joshistoast merged 5 commits intoOct 19, 2026
Merged
Conversation
Above 8192 image tokens (about 1448x1448) mu stays at 0.9 instead of extrapolating; Turbo's fixed table is unchanged. The Qwen-Image-2.1 docs explain the hold and that large base-model images no longer match the diffusers pipeline.
joshistoast
approved these changes
Oct 19, 2026
joshistoast
enabled auto-merge (squash)
October 19, 2026 01:17
5 of 7 tasks
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.
Summary
Qwen-Image-2.1's base model set its noise-schedule shift (mu) from the image's token count along a line through its scheduler config: 256 tokens give 0.5, and 8192 tokens give 0.9 (about 1448×1448 of area, 2.1 MP). Above 8192 tokens the line kept climbing.
calculate_munow holds mu at the end of its fit. Qwen-Image (#9892), Krea-2 Raw (#9887), FLUX.1 and Z-Image already do the same.qwen_image_2_1_denoisenode goes from 1.0.0 to 1.0.1; its inputs are unchanged.calculate_muandbuild_sigmassay the schedule matches the pipeline only up to the end of the fit.Why: at 4096², an image-to-image pass at strength 0.5 started from almost pure noise, so it replaced the image instead of refining it.
How the reference implementations handle this:
QwenImage21Pipelineextrapolates like the old code.supported_models.py,QwenImage21.sampling_settings).Related Issues / Discussions
Follow-up to #9784. The same fix for Qwen-Image is #9892, and for Krea-2 Raw it is #9887.
QA Instructions
Automated
pytest tests/backend/qwen_image_2_1 tests/app/invocations/test_qwen_image_2_1_nodes.py: 57 passed.QwenImage21Pipelinerecordings now keeps only cases within the fit. The 2048² recording was the extrapolated schedule, so it was removed.FlowMatchEulerDiscreteSchedulerat mu 0.9, outside the code under test.ruff@0.11.2 check/format --check: pass.openapi.jsonis regenerated; only the node version changes.GPU A/B (RTX 4090, Qwen-Image-2.1 base Q4_K_M GGUF, Qwen3-VL 8B fp8 encoder, 40 steps, CFG 1, model cache emptied before each run). Main's code and this branch ran the same graphs:
No image shows doubled subjects, broken lettering or a damaged composition.
Review
No material findings. Resolved:
build_sigmasdocstring still claimed exact parity with the pipeline; it now scopes that to within the fit.Compatibility / Rollout
QwenImage21Pipelinethere.Checklist
What's Newcopy (if doing a release after this PR)Need help on this PR? Tag
@codesmith-botwith what you need.