Repository navigation
Studio: diffusion flow_shift is the effective shift, and min-SNR is recorded as unused for flow-matching runs - #13215
Conversation
…and record min-SNR as unused for flow-matching families
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Backend CI (a-k) fails on |
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 292db590bd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return "1.0" | ||
| if isinstance(value, str): | ||
| return value | ||
| return f"effective:{float(value)}" |
There was a problem hiding this comment.
Preserve legacy keys for unchanged dynamic-shift schedules
For an explicit numeric flow_shift on Qwen-Image or LTX-2, this unconditionally changes the checkpoint identity from (for example) "2.2" to "effective:2.2", so resuming any such pre-change checkpoint fails with a timestep-shift mismatch. Those families use dynamic shifting and therefore already supplied an unshifted scheduler.sigmas; both the old implementation and the new _unshifted_sigmas path apply the same s*u/(1+(s-1)*u) transform, so their training semantics did not change. Version the identity only for families with a baked-in static shift, or accept the legacy numeric token for dynamic-shift families.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 07bcca4: only families whose scheduler bakes a static shift into sigmas (Z-Image, 3 / 6) get the effective: token; every dynamic-shift or shift-1 family (FLUX.1, FLUX.2, Qwen-Image, Krea 2, LTX-2) keeps the legacy numeric token and resumes older checkpoints. Checked against each family's real scheduler_config.json.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Refs #10590
Two diffusion training settings did not do what they said.
1. A numeric
flow_shiftwas applied on top of the model's own shift_training_sigma_tableapplieds*u/(1+(s-1)*u)toscheduler.sigmas. For families whose scheduler bakes a static shift in at init (Tongyi-MAI/Z-Image-Turboshipsshift: 3.0,Tongyi-MAI/Z-Imageshift: 6.0, bothuse_dynamic_shifting: false), those sigmas are already shifted, so the two shifts multiplied:flow_shift=3.0on Z-Image-Turboflow_shift=3.0on Z-Imageflow_shift=1.0on Z-Image-TurboA number is now the effective shift on the unshifted schedule, the musubi / kohya
discrete_flow_shiftconvention the docstring already cited. Only API requests can set it; the GUI never sendsflow_shift.Resume: the default (omitted) still records the
"1.0"token earlier builds wrote for the model's own schedule, so existing checkpoints resume. An explicit number is now recorded aseffective:<n>, so a checkpoint trained under the old meaning is refused with the usual "different timestep shift" message instead of continuing at a different shift.2.
snr_gammawas recorded for runs that never applied itMin-SNR weighting is an SDXL (epsilon-prediction) weighting; nothing in the flow-matching DiT loop reads
snr_gamma. The run record and the resume identity still stored the default5.0, so Previous Runs described a loss weighting that never happened. The flow-matching families now record it as unused (train_recipe_overridesreturnssnr_gamma: None, the mechanism MiniMax-H3 already uses), and the resume identity treats it as "cannot tell" for them, so checkpoints that recorded5.0still resume. SDXL is unchanged.Tests
test_a_numeric_shift_is_the_effective_shift_on_a_static_scheduler: on a shift-3 scheduler,flow_shift=3.0equals the scheduler's own table,1.0is the unshifted uniform table,2.0is the linear shift of it.test_the_resume_identity_keeps_the_default_token_and_drops_min_snr_for_flow_families: default token stays"1.0", an oldsnr_gamma: "5.0"manifest still resumes, an old numeric token is refused, SDXL still records5.0.tests/test_diffusion_*.py+tests/test_video_*.py: no failure that does not also fail on main (compat preflight and nvfp4 environment failures on both).