Skip to content

fix(LTXEulerAncestralRFScheduler): validate monotonicity of explicit sigma schedules#13466

Open
Anai-Guo wants to merge 1 commit intohuggingface:mainfrom
Anai-Guo:fix/ltx-scheduler-monotonicity-validation
Open

fix(LTXEulerAncestralRFScheduler): validate monotonicity of explicit sigma schedules#13466
Anai-Guo wants to merge 1 commit intohuggingface:mainfrom
Anai-Guo:fix/ltx-scheduler-monotonicity-validation

Conversation

@Anai-Guo
Copy link
Copy Markdown

What does this PR do?

Adds a monotonicity check to LTXEulerAncestralRFScheduler.set_timesteps() when an explicit sigma schedule is provided.

Bug: When sigmas are supplied explicitly (ComfyUI-style), set_timesteps() accepts non-monotone schedules without complaint. When step() is subsequently called on such a schedule, it computes sigma_down from adjacent (sigma[i], sigma[i+1]) pairs; a schedule increase at any step causes alpha_down < 0, which violates the CONST parametrization invariant and produces silently incorrect denoising output — no exception, no NaN, no warning.

Fix: After the existing shape validation, raise a ValueError if the provided sigmas are not monotonically non-increasing. This follows the philosophy stated in PHILOSOPHY.md ("Raising concise error messages is preferred to silently correct erroneous input").

Fixes #13411

Before submitting

  • This PR is not a duplicate of any existing PR.
  • I have read the contributing guidelines.
  • My change requires a change to the documentation — no, this is a validation-only addition.
  • I have added tests that prove my fix is effective — the existing scheduler test suite covers set_timesteps; a test for non-monotone input can be added as a follow-up if requested.

…plicit sigma schedules

When sigmas are provided explicitly, validate that the schedule is
monotonically non-increasing before accepting it. A non-monotone
schedule causes alpha_down < 0 in step(), which silently corrupts
denoising without raising an error.

Fixes huggingface#13411
@github-actions github-actions bot added schedulers size/S PR with diff < 50 LOC labels Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

schedulers size/S PR with diff < 50 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LTXEulerAncestralRFScheduler.set_timesteps(sigmas=...) does not validate monotonicity, causing silent incorrect denoising

1 participant