Diffusers Random Noise
A Diffusers-Style Noise Generator, Seeded and Byte-Reproducible
- NOISE
ComfyUI's samplers mostly generate their own noise, silently, in the background. But some pipelines - ones replicating a specific diffusers workflow, or doing tricks like outpainting where you need the same noise to continue a latent - want the noise to be a first-class object they control. DiffusersRandomNoise is that object: a NOISE generator that matches the interface diffusers uses (generate_noise(input_latent)), with a seed you own.
It exists because "make noise exactly like diffusers makes noise" is a real compatibility problem. Diffusers' RandomNormalNoise initializes a generator on a specific device with a seed and draws from a normal distribution at the latent's shape - and ComfyUI doesn't always reproduce that byte-for-byte. This node gives you the same thing deterministically.
How it works
The node doesn't produce a noise tensor at generation time. It hands back a NOISE object holding your noise_seed, device, and dtype, which the sampler later calls to create the actual random tensor for each latent's shape. When invoked, it seeds a torch.Generator on the given device, draws torch.randn in the requested dtype, and reshapes to the latent.
That separation matters: same seed, same device, same dtype → same noise, every run. That's what makes your outpainting seams or your A/B comparisons reproducible.
Inputs
- noise_seed (INT, with the standard control-after-generate toggle) - the seed that fixes the noise. This is the one you'll touch.
- device (STRING, default
cuda:0) - where the generator lives. Match this to your GPU or the node may misbehave on multi-GPU setups. - dtype (STRING, default
bfloat16) - tensor precision of the generated noise.
Output is a single NOISE that feeds a sampler's noise input.
Installing it
It's part of Duanyll Nodepack:
cd ComfyUI/custom_nodes
git clone https://github.com/Duanyll/duanyll_nodepack
or via ComfyUI Manager. No models, no downloads - just torch math.
Where people get burned
- It only works where a NOISE input exists. Not every sampler exposes a noise slot; this node is pointless in a vanilla graph that doesn't ask for one. Wire it where the workflow explicitly expects a diffusers-style noise generator.
- Device/dtype mismatches are silent. If your sampler runs on
cuda:0with fp16 latents but the generator is set to a different device orfloat32, you can get precision drift that's hard to pin down. Keep device and dtype aligned with the rest of the graph. - Seeds are the whole point. Change the seed and you change everything downstream. If runs look identical when they shouldn't, check the seed isn't stuck at a fixed value.
It's a niche node - you won't need it for everyday prompting - but when a workflow asks for exact diffusers noise semantics, it's the difference between matching the reference behavior and quietly not.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| noise_seed | INT | 00–18446744073709550000 | — |
| device | STRING | cuda:0 | — |
| dtype | STRING | bfloat16 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| NOISE | NOISE | — |