fix(LTXEulerAncestralRFScheduler): validate monotonicity of explicit sigma schedules#13466
Open
Anai-Guo wants to merge 1 commit intohuggingface:mainfrom
Open
fix(LTXEulerAncestralRFScheduler): validate monotonicity of explicit sigma schedules#13466Anai-Guo wants to merge 1 commit intohuggingface:mainfrom
Anai-Guo wants to merge 1 commit intohuggingface:mainfrom
Conversation
…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
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.
What does this PR do?
Adds a monotonicity check to
LTXEulerAncestralRFScheduler.set_timesteps()when an explicit sigma schedule is provided.Bug: When
sigmasare supplied explicitly (ComfyUI-style),set_timesteps()accepts non-monotone schedules without complaint. Whenstep()is subsequently called on such a schedule, it computessigma_downfrom adjacent(sigma[i], sigma[i+1])pairs; a schedule increase at any step causesalpha_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
ValueErrorif the provided sigmas are not monotonically non-increasing. This follows the philosophy stated inPHILOSOPHY.md("Raising concise error messages is preferred to silently correct erroneous input").Fixes #13411
Before submitting
set_timesteps; a test for non-monotone input can be added as a follow-up if requested.