Skip to content

[bug]: LCM scheduler is not reproducible with a fixed seed (FLUX.1, FLUX.2, Z-Image) #9791

Open

Description

@Pfannkuchensack

Is there an existing issue for this problem?

  • I have searched the existing issues

Install method

Manual

Operating system

Windows

GPU vendor

Nvidia (CUDA)

GPU model

RTX 4090

GPU VRAM

24GB

Version number

main @ 3289f16

What happened

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:

  • invokeai/backend/flux/denoise.py (FLUX.1)
  • invokeai/backend/flux2/denoise.py (FLUX.2)
  • invokeai/app/invocations/z_image/z_image_denoise.py (Z-Image)

What you expected to happen

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

  1. FLUX.1 dev, scheduler LCM, fixed seed.
  2. Invoke the same generation two or three times (with node caching disabled, or after a restart).
  3. 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

  1. added a commit that references this issue on Oct 16, 2026
    664fd20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions