TCDScheduler ignores set_alpha_to_one in the terminal update
维护者通常 1 天内回复
还没有人认领这个 Issue。
- #15292 来自 @twojian —— 已关闭,未合并
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 18/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 领域
- ai, machine-learning
调研方向
The terminal-step alpha is read from alphas_cumprod[0] in the TCDScheduler step logic, not from final_alpha_cumprod, so set_alpha_to_one has no effect there. Run the reproduction snippet on CPU to confirm both flags return about 0.0292. Done means the True case returns 0 while the False case is unchanged, and this needs a maintainer decision on the intended semantics. Linked PR #15292 already proposes a fix, so check it before starting.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
TCDScheduler documents that set_alpha_to_one=True sets the final alpha cumulative product to 1. However, the terminal update currently uses alphas_cumprod[0], regardless of that setting.
As a result, set_alpha_to_one=True and False produce the same terminal output in the following CPU reproduction.
The terminal update uses alphas_cumprod[0] instead of final_alpha_cumprod, bypassing the set_alpha_to_one configuration.
The TCD reference implementation also uses index 0 at the endpoint, so this may be an intentional compatibility choice rather than an implementation oversight. However, it differs from the documented behavior.
I have submitted PR #15292 with a proposed fix and CPU regression tests. Maintainer guidance on the intended terminal-alpha semantics would be appreciated.
Reproduction
import torch
from diffusers import TCDScheduler
for flag in (True, False):
scheduler = TCDScheduler(
prediction_type="sample",
set_alpha_to_one=flag,
)
scheduler.set_timesteps(1, device="cpu")
sample = torch.ones(1, 1)
result = scheduler.step(
torch.zeros_like(sample),
scheduler.timesteps[0],
sample,
)
print(flag, result.prev_sample.item())
Observed behavior: both settings return approximately 0.0292233.
Expected behavior under the documented terminal-alpha semantics: the True case returns 0, while the False case retains the existing output.
Context
While investigating TCDScheduler's terminal-step behavior and validating scheduler correctness on CPU, I found that changing set_alpha_to_one had no effect on the terminal output.
This matters for users relying on the documented scheduler configuration and for reproducibility when comparing different terminal-alpha settings.
Logs
System Info
- OS: Windows
- Diffusers: 0.44.0.dev0 (development version)
- Device: CPU
- PyTorch: 2.9.0+cu126
- Python: 3.12.8
The minimal reproduction uses CPU only and does not require CUDA.
Who can help?
No response
- 主要语言
- Python
- 星标
- 35k
- 派生
- 7.5k
- 平均合并
- 2 天 22 小时
- 30 天内合并 PR
- 58
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
huggingface/diffusers 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
huggingface/diffusers#15436 · 1 条评论 ·
维护者通常 1 天内回复
-
InpaintProcessor crashes when padding_mask_crop is set and a dimension is omitted可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
huggingface/diffusers#15433 ·
维护者通常 1 天内回复
-
LTXEulerAncestralRFScheduler skips signal scaling with s_noise=0可能已有人在做 @hparik11 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
huggingface/diffusers#15423 · 2 条评论 ·
维护者通常 1 天内回复
-
Docs: 13 docstrings document parameters their functions don't have可能已有人在做 @M-Colley 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
huggingface/diffusers#15363 · 2 条评论 ·
维护者通常 1 天内回复
-
`ZImageImg2ImgPipeline` / `ZImageInpaintPipeline`: explicit height/width different from the input image raises RuntimeError可能已有人在做 @chessing234 于 11 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 70/100
huggingface/diffusers#15337 · 3 条评论 ·
维护者通常 1 天内回复
查看 huggingface/diffusers 的全部 Issue
相似的 Issue
-
[19.0] pos_sale: settling an order with a 0 down payment line crashes (reading 'reward_id') and leaves a wrong amount due可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 79/100
developmentseed/titiler-covjson#164 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
awslabs/visual-asset-management-system#2164 ·
维护者通常 1 天内回复
-
needs-triage
难度 2/5 1-3 小时 新手友好度 86/100
MakazhanAlpamys/Soup#3589 ·
维护者通常 1 天内回复
-
channels status reports the wrong Enabled value for Feishu instances and default-enabled WebSocket未关闭
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复