fix(ltx2): pass actual sequence length to calculate_shift for dynamic timestep shift - #14373
Open
AloysJehwin wants to merge 1 commit into
Open
fix(ltx2): pass actual sequence length to calculate_shift for dynamic timestep shift#14373AloysJehwin wants to merge 1 commit into
AloysJehwin wants to merge 1 commit into
Conversation
… timestep shift LTX2Pipeline passed max_image_seq_len as the first argument to calculate_shift(), which also receives it as the third argument (the maximum). Since calculate_shift returns image_seq_len * m + b, passing the maximum as image_seq_len always returns max_shift — making mu constant regardless of resolution or frame count. The commented-out line below already computed the correct value. Uncommented it and passed video_sequence_length as image_seq_len, matching LTX v1 pipeline (pipeline_ltx.py:725-728) and the LTX reference implementation. Fixes huggingface#14243 Signed-off-by: Aloys Jehwin <aloysjehwin@gmail.com>
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?
Fixes #14243
In
LTX2Pipeline.__call__,muwas computed by passingmax_image_seq_lenas both the first (image_seq_len) and third (max_image_seq_len) arguments tocalculate_shift. Since the function returnsimage_seq_len * m + b, passing the maximum always yieldsmax_shift— souse_dynamic_shifting=Truehad no effect.The fix was already suggested in the code: a commented-out line
# video_sequence_length = latent_num_frames * latent_height * latent_widthsat directly above. Uncommented it and passed the result asimage_seq_len, matching LTX v1 pipeline (pipeline_ltx.py:725-728) and the LTX reference implementation.Before
After
Implemented with Claude Code assistance. All changed lines reviewed manually.