huggingface / huggingface/diffusers
[BUG] FlowMatchEulerDiscreteScheduler.__init__ computes sigma_min/sigma_max after shift, causing duplicate shift in set_timesteps
- Vorherrschende Sprache
- Python
- Sterne
- 34.5k
- Forks
- 7.3k
- Ø Merge
- 3 T. 3 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
### 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_
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.