UniPCMultistepScheduler.set_timesteps(sigmas=...) raises TypeError for a list when use_flow_sigmas=True

Aperta Adatta ai principianti
#15,207 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@marlonferreira1800-hue ci sta già lavorando.

Dal 9/11/2026.

  • #15214 di @marlonferreira1800-hue — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
85/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
numpy, python, pytorch

Direzione di ricerca

Leggi src/diffusers/schedulers/scheduling_unipc_multistep.py e confronta come Euler, FlowMatch Euler e FlowMatch LCM convertono i sigma in set_timesteps. Aggiungi un test di regressione per una lista semplice con use_flow_sigmas=True, incluso lo spostamento dinamico se supportato. Il lavoro è concluso quando la lista funziona e i test esistenti dello scheduler passano.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
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_shift computes 1 / 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

Lingua principale
Python
Stelle
34.9k
Fork
7.5k
Merge medio
2g 16h
PR unite (30g)
57

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di huggingface/diffusers

Tutte le issue di huggingface/diffusers

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.