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 length
self.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.
In
LTX2Pipeline.__call__(src/diffusers/pipelines/ltx2/pipeline_ltx2.py),muis computed withmax_image_seq_lenpassed as the first argument ofcalculate_shift— theimage_seq_lenparameter:calculate_shift(image_seq_len, base, max, base_shift, max_shift)returnsimage_seq_len * m + b. Withimage_seq_len == max_seq_len, that reduces tomax_shift, somuis constant regardless of resolution or frame count —use_dynamic_shifting=Truehas no effect.image_seq_lenshould 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_widthas the first argument.