UniPCMultistepScheduler.set_timesteps(sigmas=...) raises TypeError for a list when use_flow_sigmas=True
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 85/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
调研方向
阅读 src/diffusers/schedulers/scheduling_unipc_multistep.py,并比较 Euler、FlowMatch Euler 和 FlowMatch LCM 在 set_timesteps 中如何转换 sigma。为启用 use_flow_sigmas=True 的普通列表添加回归测试;如果支持,也要包含动态偏移。列表能够正常工作且现有的 scheduler 测试通过后,即为完成。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
UniPCMultistepScheduler.set_timesteps documents sigmas as list[float], but with use_flow_sigmas=True a plain list fails in the shift calculation:
flow_shift * sigmas→TypeError: can't multiply sequence by non-int of type 'float'- with
use_dynamic_shifting=True,time_shiftcomputes1 / sigmas→TypeError: unsupported operand type(s) for /: 'int' and 'list'
The same values passed as a NumPy array work. Euler, FlowMatch Euler and FlowMatch LCM already convert sigmas with np.array(sigmas).astype(np.float32) before using them; UniPC doesn't.
Reproduction
from diffusers import UniPCMultistepScheduler
scheduler = UniPCMultistepScheduler.from_pretrained("Wan-AI/Wan2.1-T2V-1.3B-Diffusers", subfolder="scheduler")
print("use_flow_sigmas:", scheduler.config.use_flow_sigmas, "| flow_shift:", scheduler.config.flow_shift)
# A custom 8-step schedule, written as a list (the documented type).
sigmas = [1.0, 0.9, 0.8, 0.65, 0.5, 0.35, 0.2, 0.1]
scheduler.set_timesteps(sigmas=sigmas)
print("timesteps:", scheduler.timesteps.tolist())
Only the scheduler config is downloaded.
Context
I wanted to try a custom sigma schedule with Wan's default scheduler (UniPC with use_flow_sigmas=True, flow_shift=3.0), so I called set_timesteps(sigmas=...) with a list, as the docstring describes. Passing np.array(sigmas) works around it.
None of the in-tree pipelines currently send a list down this path, so this only shows up when calling the scheduler directly, from a custom pipeline, or when swapping UniPC into a pipeline that forwards a user-provided sigmas list.
I have a one-line fix (convert to an array at the top of set_timesteps, same as the other schedulers) plus a regression test, and can open a PR if that sounds good.
Logs
File "src/diffusers/schedulers/scheduling_unipc_multistep.py", line 434, in set_timesteps
sigmas = self.config.flow_shift * sigmas / (1 + (self.config.flow_shift - 1) * sigmas)
~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
TypeError: can't multiply sequence by non-int of type 'float'
System Info
- diffusers:
main@f7fc4389e - Python 3.14.6, torch 2.14.1, numpy 2.5.4
- macOS 26.5.2 (arm64)
Who can help?
@yiyixuxu @dg845
- 主要语言
- Python
- 星标
- 34.9k
- 派生
- 7.5k
- 平均合并
- 2 天 16 小时
- 30 天内合并 PR
- 57
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
huggingface/diffusers 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
huggingface/diffusers#15211 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
huggingface/diffusers#15210 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 78/100
huggingface/diffusers#15170 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 70/100
huggingface/diffusers#15163 · 3 条评论 ·
维护者通常 1 天内回复
-
`encode_video` truncates a fractional `fps`, so the video runs longer than its audio可能已有人在做 @guptaishaan 于 18 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 83/100
huggingface/diffusers#15104 · 1 条评论 ·
维护者通常 1 天内回复
查看 huggingface/diffusers 的全部 Issue
相似的 Issue
-
bug drawing-tools
难度 2/5 1-3 小时 新手友好度 76/100
cofade/open-garden-planner#827 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
bug documentation good first issue help wanted testing
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 88/100
hololinked-dev/hololinked#213 ·
-
Show evidence time and supersede warnings in the memory inspector可能已有人在做 @Sinchanak-212 今天认领。 未关闭area: ux good first issue priority: medium
难度 2/5 1-3 小时 新手友好度 84/100