You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug]: LCM scheduler is not reproducible with a fixed seed (FLUX.1, FLUX.2, Z-Image) #9791
FLUX generations with the LCM scheduler change from run to run with identical settings and seed. Euler and Heun are reproducible under the same conditions (bit-identical across repeated runs).
Measured on FLUX.1 dev (int8), 1024², 8 steps, seed 42, three runs of the same graph: mean absolute pixel difference of 7.6 and 7.0 (0–255 scale) relative to the first run.
Cause: FlowMatchLCMScheduler.step() injects fresh noise via randn_tensor(..., generator=generator), and our loops call scheduler.step(model_output=..., timestep=..., sample=...) without a generator. That noise is drawn from the global torch RNG instead of the node's seed. The same call pattern exists in:
Same seed + same settings → same image. Pass a torch.Generator seeded from the node's seed to scheduler.step() when the scheduler accepts one (LCM). Euler and Heun ignore the argument.
How to reproduce the problem
FLUX.1 dev, scheduler LCM, fixed seed.
Invoke the same generation two or three times (with node caching disabled, or after a restart).
Compare the images: they differ visibly in grain and detail.
Additional context
Found while GPU-testing #9724 (unrelated to that PR; it also affects base-vs-PR comparisons).
Activity
fix(flux): seed LCM step noise for FLUX.1, FLUX.2 and Z-Image