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でシグマをどのように変換するかを比較してください。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時間
- マージ済み PR(30日)
- 57
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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