Commit 1626f4c
Address PR #13095 review: migrate to FlowMatchEulerDiscreteScheduler
Replace the hand-rolled flow-matching Euler loop with
`FlowMatchEulerDiscreteScheduler`. ACE-Step still computes its own shifted /
turbo sigma schedule via `_get_timestep_schedule`, but now passes it to
`scheduler.set_timesteps(sigmas=...)` and delegates the ODE step to
`scheduler.step()`. The scheduler is configured with `num_train_timesteps=1`
and `shift=1.0` so `scheduler.timesteps` stays in `[0, 1]` (the convention the
DiT was trained on) and the scheduler doesn't re-shift already-shifted sigmas.
The scheduler's appended terminal `sigma=0` reproduces the old loop's
final-step "project to x0" case exactly: `prev = x + (0 - t_curr) * v`.
Parity on jieyue (seed=42, bf16 + flash-attn, turbo text2music, 8 steps):
waveform Pearson = 0.999999
spectral Pearson = 1.000000
max |diff| = 2.5e-3 (fp32 step-math vs previous bf16 step-math)
fp32 Euler-loop A/B against the hand-rolled path: max |diff| = 3.6e-7.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent b46370a commit 1626f4c
2 files changed
Lines changed: 34 additions & 16 deletions
File tree
- scripts
- src/diffusers/pipelines/ace_step
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
332 | 344 | | |
333 | 345 | | |
334 | 346 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
236 | 242 | | |
237 | 243 | | |
238 | 244 | | |
| |||
244 | 250 | | |
245 | 251 | | |
246 | 252 | | |
| 253 | + | |
247 | 254 | | |
248 | 255 | | |
249 | 256 | | |
| |||
253 | 260 | | |
254 | 261 | | |
255 | 262 | | |
| 263 | + | |
256 | 264 | | |
257 | 265 | | |
258 | 266 | | |
| |||
1306 | 1314 | | |
1307 | 1315 | | |
1308 | 1316 | | |
1309 | | - | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
1310 | 1321 | | |
1311 | 1322 | | |
1312 | 1323 | | |
1313 | 1324 | | |
1314 | | - | |
| 1325 | + | |
1315 | 1326 | | |
1316 | 1327 | | |
1317 | | - | |
| 1328 | + | |
| 1329 | + | |
1318 | 1330 | | |
1319 | 1331 | | |
1320 | 1332 | | |
1321 | 1333 | | |
1322 | 1334 | | |
1323 | 1335 | | |
1324 | | - | |
1325 | | - | |
| 1336 | + | |
| 1337 | + | |
1326 | 1338 | | |
1327 | 1339 | | |
1328 | 1340 | | |
| |||
1384 | 1396 | | |
1385 | 1397 | | |
1386 | 1398 | | |
1387 | | - | |
1388 | | - | |
1389 | | - | |
1390 | | - | |
1391 | | - | |
1392 | | - | |
1393 | | - | |
1394 | | - | |
1395 | | - | |
1396 | | - | |
1397 | | - | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
1398 | 1404 | | |
1399 | 1405 | | |
1400 | 1406 | | |
| |||
0 commit comments