You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LTX2Pipeline: dynamic timestep shift mu is constant, ignores the actual sequence length #14243
In LTX2Pipeline.__call__ (src/diffusers/pipelines/ltx2/pipeline_ltx2.py), mu is computed with max_image_seq_len passed as the first argument of calculate_shift — the image_seq_len parameter:
mu=calculate_shift(
self.scheduler.config.get("max_image_seq_len", 4096), # <-- this is image_seq_len; should be the sample's real sequence lengthself.scheduler.config.get("base_image_seq_len", 1024),
self.scheduler.config.get("max_image_seq_len", 4096),
self.scheduler.config.get("base_shift", 0.95),
self.scheduler.config.get("max_shift", 2.05),
)
calculate_shift(image_seq_len, base, max, base_shift, max_shift) returns image_seq_len * m + b. With image_seq_len == max_seq_len, that reduces to max_shift, so mu is constant regardless of resolution or frame count — use_dynamic_shifting=True has no effect.
image_seq_len should be the sample's packed sequence length, latent_num_frames * latent_height * latent_width — which is already computed a few lines above (and even present as the commented line # video_sequence_length = latent_num_frames * latent_height * latent_width). This matches the Flux/SD3 pipelines and the LTX reference (math.prod(latent.shape[2:])).
Fix: pass latent_num_frames * latent_height * latent_width as the first argument.
Opened PR #14373. The fix is two lines — uncomment the existing video_sequence_length line and pass it as image_seq_len. Matches exactly what LTX v1 does in pipeline_ltx.py:725-728.
Activity
AloysJehwin commentedon Aug 3, 2026
Opened PR #14373. The fix is two lines — uncomment the existing
video_sequence_lengthline and pass it asimage_seq_len. Matches exactly what LTX v1 does in pipeline_ltx.py:725-728.fix(ltx2): use actual video sequence length for dynamic timestep shift
fix(ltx2): pass actual sequence length to calculate_shift for dynamic…