Nodes/ComfyUI-GTE/Seed Range Noise (gte)
ComfyUI Node

Seed Range Noise (gte)

Give every candidate in the batch its own seed

By mgkgng·Created 2 days ago·Updated 2 days ago· 4
Seed Range Noise (gte)
    • noise
    seed0

    Here's something that surprises people who've used ComfyUI for a year: batch item 3 does not have a seed. Not really.

    When you set batch size to 8 on a KSampler, ComfyUI draws one noise tensor from one seeded generator and slices it eight ways (prepare_noise in comfy/sample.py). Item 3's identity is therefore the pair - the seed and the position 3 - and that pair only reproduces inside a batch of the same size. You can't write it down. You can't re-run it alone. You can't send it to anyone.

    Seed Range Noise fixes that by reseeding per item: item i gets its own generator at seed + i. Its noise is then bit-identical to what a plain batch_size=1 run at seed i would have drawn, so a candidate's identity collapses back to one integer that means the same thing in a stock workflow, with no batch context to carry around.

    Why you'd reach for it

    This is the first node in the pack's staged workflow, and it's the one that makes the rest possible. Step A render 20 cheap candidates from consecutive seeds; you pick one by eye; you branch from it. None of that works if "the one you picked" isn't a thing you can name. The whole point of the pack is that you stop paying full price for a seed before you know whether it's any good - and the seed is the unit you keep.

    It also pairs directly with Candidate Select, which reports origin_seed + index as a portable seed. Feed both nodes the same origin seed and the number that comes out of the pick is re-usable anywhere.

    How it works

    The node implements ComfyUI's NOISE contract, which is one method: generate_noise(latent) -> tensor. Instead of one tensor sliced N ways, it draws one small tensor per batch item, each from a private CPU generator seeded seed + i, then concatenates. If the latent carries a batch_index (it came through Latent From Batch), the per-item seeds are taken from those positions rather than 0..N - so a candidate keeps the seed it had before you sliced it out.

    Two details worth knowing, both straight from the source. The generator is private, so your global RNG is untouched. And nested latents (the packed formats video models use) raise an error rather than silently doing the wrong thing - use core's RandomNoise for those.

    Inputs and outputs

    One input that matters: seed. It's the origin. Item i is seed + i. It has the usual control_after_generate dropdown, so if you leave it on randomize the whole family re-rolls every queue - usually what you want for the discovery pass, and definitely not what you want once you've found something (docs/knowledge/comfyui-node-plumbing.md has the full "seed got eaten after the run" story).

    One output: noise (NOISE). It goes into SamplerCustomAdvanced's noise input. That's a hard requirement, not a preference - a plain KSampler builds its own noise internally and has no NOISE socket at all, so it cannot use this node. The pack's staged approach runs on SamplerCustomAdvanced with explicit sigmas throughout.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/mgkgng/ComfyUI-GTE
    

    Restart ComfyUI. The console prints [gte] loaded 8 node(s) when it worked. There are no Python dependencies - the pack's requirements.txt is deliberately empty, because everything runs on the torch/numpy/Pillow ComfyUI already ships. You can also find it in ComfyUI Manager by searching the pack title, ComfyUI-GTE (display name "Generative Trajectory Explorer"). The nodes have no model dependencies; the example workflow needs rgthree-comfy, ComfyUI-KJNodes and ComfyUI-Easy-Use, but only for its helper nodes.

    The trap: "reproducible" is not "byte-identical"

    Measured on this pack: re-running candidate 2 alone lands about 2.2/255 mean pixel difference from its batched original, against 38–51 for the other candidates. Unmistakably the same image, not the same bytes. The noise going in is exact; the UNet forward pass at batch 5 and at batch 1 picks different kernels and reduction orders, and a few CFG-guided steps amplify that. Sampling is deterministic at a fixed batch size.

    So exact reproduction means one of two things: re-run at the same batch size, or continue from the saved latent instead of regenerating. If you're chasing a pixel, stop regenerating.

    Categorygte/sampling

    Inputs (1)

    NameTypeDefaultDescription
    seedINT00–18446744073709490000

    Outputs (1)

    NameTypeDescription
    noiseNOISE