Repository navigation
fix(krea2): hold Raw's schedule shift at the end of its fit - #9887
Merged
joshistoast merged 3 commits intoOct 19, 2026
Merged
Conversation
Krea-2 Raw's mu kept climbing past 6400 image tokens (2.21 at 2048², 7.41 at 4096²); calculate_shift now holds it at the fit's end, as the FLUX.1, Z-Image and LTX-2 fits do. krea2_denoise 1.3.1; Turbo and an explicit shift are unchanged.
This was referenced Oct 16, 2026
joshistoast
approved these changes
Oct 19, 2026
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
Krea-2 Raw sets its noise schedule shift (mu) from the image's token count, along a line through 256 tokens → 0.5 and 6400 tokens (1280×1280 of area) → 1.15. Above 6400 tokens the line kept climbing, and nothing held it. Turbo uses a fixed 1.15 and is not affected.
calculate_shiftnow holds mu at the end of its fit, as the FLUX.1, Z-Image and LTX-2 fits already do. The hold follows a checkpoint's ownscheduler_config.json.Why now: an img2img pass enters
krea2_denoiseon a step of this schedule. At 4096² no step is anywhere near a mid-range sigma, so an img2img or upscale pass at that size replaces the image instead of refining it. The Upscale widget for Krea-2 (follow-up PR) depends on this.Elsewhere:
supported_models.py,Krea2.sampling_settings). That is the value this PR holds at.Krea2Pipelineextrapolates like the old code.The node goes from 1.3.0 to 1.3.1; its inputs are unchanged. The
shiftfield description now says where the hold starts.Related Issues / Discussions
Same fix as the Z-Image shift hold (31c476f). Needed by the Krea-2 Upscale widget PR, which follows once this is merged.
QA Instructions
Automated
pytest tests/app/invocations/test_krea2_denoise.py: 79 passed.calculate_shiftagainst literal values, including a non-square 2048×768 frame (6144 tokens, below the hold).max_shift, run through_run_diffusion.ruff@0.11.2 check/format --check: pass.openapi.jsonandschema.tsare regenerated; only the field description and the version change.Raw text-to-image A/B (RTX 4090, Raw Q4_K_M GGUF, 28 steps, CFG 5.5, one warm-up, held and old mu interleaved per seed; old mu passed through
shift):No image shows doubled subjects or a broken composition.
Img2img at large sizes (through the Upscale widget of the follow-up PR, Raw Q4, Balanced): a 1024² source at 4× (4096²) keeps composition, lettering and rock structure in 8:46 min. Without the hold the pass would enter at sigma 0.98.
Review
Findings resolved:
calculate_shift, where the other fits keep theirs.scheduler_config.jsonfall back to Krea-2's defaults. They take diffusers' scheduler defaults; the comment now says so.Remaining: the low end still extrapolates below 256 tokens, as the FLUX.1 and Z-Image fits do; at 64² mu is 0.475.
Compatibility / Rollout
shiftare unchanged.Checklist
What's Newcopy (if doing a release after this PR)Need help on this PR? Tag
@codesmith-botwith what you need.