fix: correct MiniMax H3 audio Euler steps - #1908
Open
jk212h20 wants to merge 1 commit into
Open
Conversation
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
Fix MiniMax H3 generated audio degradation with Euler sampling, especially at the low step counts used by the Turbo LoRA.
H3 conditions video and audio on different shifted flow schedules (video shift 12, audio shift 3). The existing implementation converts the audio velocity to the video clock with the local derivative
d sigma_audio / d sigma_video. That is an infinitesimal conversion, but the Euler sampler advances over finite sigma intervals. Because the mapping between schedules is nonlinear, the derivative approximation over-advances audio at low step counts.For ordinary Euler evaluations, this PR instead scales audio velocity by the exact finite-step ratio:
This makes the packed-latent Euler update algebraically equivalent to advancing audio with its own shift-3 sigma interval. Other samplers retain the existing local-slope behavior because they may make intermediate or repeated model evaluations and need a more general dual-clock integration design.
Impact
The derivative approximation's cumulative audio advance is about:
This explains why H3 Turbo audio is affected most strongly while higher-step full-model output can still be degraded.
The issue applies to generated audio in T2VA, FL2VA, and Ref2VA. It is separate from the reference-audio encoder correction in #1886.
Validation
sd-clibuild on macOS/Metal against currentmaster.sd-cli --helpsmoke test.Scope
Only the standard Euler path supplies a next sigma. Unsupported sampler paths continue using the previous derivative conversion, avoiding behavior changes until they can carry independent audio schedule state correctly.