Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

LTX2Pipeline: dynamic timestep shift `mu` is constant, ignores the actual sequence length

未关闭 适合新手
#14,243 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
python

调研方向

从 src/diffusers/pipelines/ltx2/pipeline_ltx2.py 中的 LTX2Pipeline.call 开始,阅读附近的 latent 维度计算和 calculate_shift 调用。确认 packed sequence length 是如何推导的,并比较 Flux/SD3 pipeline 中对应的逻辑。当 dynamic shifting 使用实际的 latent sequence length,并随分辨率或帧数变化时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

bug pipelines

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.

主要语言
Python
星标
34.6k
派生
7.4k
平均合并
3 天 7 小时
30 天内合并 PR
73

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

huggingface/diffusers 的其他 Issue

查看 huggingface/diffusers 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。