huggingface / huggingface/diffusers

[BUG] FlowMatchEulerDiscreteScheduler.__init__ computes sigma_min/sigma_max after shift, causing duplicate shift in set_timesteps

Abierto
#13,243 2 comentarios 0 reacciones 1 asignado Reclamado por @dg845 Ver en GitHub
bug
Lenguaje dominante
Python
Estrellas
34.5k
Forks
7.3k
Merge medio
3 d 3 h
PR fusionados (30 d)
91

Descripción

### Describe the bug

There is an initialization order issue in the FlowMatchEulerDiscreteScheduler class that causes set_timesteps to apply timestep shifting twice, resulting in different sigma values for the same timestep settings.
https://github.com/huggingface/diffusers/blob/07a63e197e10860a470576cf4f610381b31a4dd7/src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py#L132-L143
Then in the set_timesteps method:
https://github.com/huggingface/diffusers/blob/07a63e197e10860a470576cf4f610381b31a4dd7/src/diffusers/schedulers/scheduling_flow_match_euler_discrete.py#L333-L350

sigma_min will be saved after shift and used to generate a new list of sigma, then there is another shift happening :).

### Reproduction

scheduler = FlowMatchEulerDiscreteScheduler.from_pretrained(
os.path.join(model_path, "scheduler"),
)
# default scheduler.num_train_timesteps=1000,shift=3.0
print(scheduler.sigmas)
scheduler.set_timesteps(1000)
print(scheduler.sigmas)

### Logs

```shell

```

### System Info

Environment
diffusers version
Python 3.13
Affected file: diffusers/schedulers/scheduling_flow_match_euler_discrete.py

### Who can help?

_No response_

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.