huggingface / huggingface/diffusers
[BUG] FlowMatchEulerDiscreteScheduler.__init__ computes sigma_min/sigma_max after shift, causing duplicate shift in set_timesteps
- Lingua principale
- Python
- Stelle
- 34.5k
- Fork
- 7.3k
- Merge medio
- 3g 3h
- PR unite (30g)
- 91
Descrizione
### 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_
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.