Commit a6bf8b4
committed
Fix double timestep shifting in
`__init__` records `self.sigma_max` / `self.sigma_min` *after* applying the
`shift * sigmas / (1 + (shift - 1) * sigmas)` transform. `set_timesteps` then
fed those already-shifted endpoints back into `np.linspace(...)` and applied
the same shift again, producing a different schedule for the same
`(num_train_timesteps, num_inference_steps, shift)` triple than `__init__`.
Use the pre-shift `[num_train_timesteps, ..., 1]` range directly when no
custom timesteps are provided so the shift is applied exactly once. After the
fix, `__init__` and `set_timesteps(num_train_timesteps)` produce identical
sigmas (to atol=1e-5) for every value of `shift` (verified for 1.0 and 3.0).
`self.sigma_max`/`self.sigma_min` are left as-is to preserve their public
attribute semantics for any downstream consumers.FlowMatchEulerDiscreteScheduler.set_timesteps (#13243)1 parent 48f39c2 commit a6bf8b4
1 file changed
Lines changed: 6 additions & 2 deletions
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
336 | 340 | | |
337 | | - | |
338 | | - | |
| 341 | + | |
| 342 | + | |
339 | 343 | | |
340 | 344 | | |
341 | 345 | | |
| |||
0 commit comments