Nodes/Bjornulf_custom_nodes/โ™ป๐ŸŽฒ Loop Random Seed
ComfyUI Node

โ™ป๐ŸŽฒ Loop Random Seed

Generate a reproducible list of random seeds to iterate over

By justUmenยทCreated 2 years agoยทUpdated about a year agoยท 545
โ™ป๐ŸŽฒ Loop Random Seed
    • INT
    โ—„num_seeds10โ–บ
    โ—„generator_seed0โ–บ

    This node produces a batch of random seeds - a whole list of them in one shot - that you can iterate through to generate a series of varied images. You tell it how many seeds you want and give it one master seed to derive them from, and it hands back that many integers as a list. The point is variety with reproducibility: every run of the same master seed produces the same set of random seeds, so your batch is repeatable, but each seed inside it is different, so your images actually differ from one another.

    That "repeatable but varied" property is the useful bit. Plain looping in ComfyUI tends to reuse a single seed across iterations (which is great for comparing settings, but hands you near-identical images when you actually wanted different ones). This node solves the opposite problem - when you want N genuinely different generations and you want to be able to reproduce that exact batch later.

    How it works

    You give it a count and a generator_seed. That generator seed seeds a random number generator, which then spits out num_seeds values. Because the RNG is seeded, the sequence is deterministic: same generator_seed, same list of seeds, every time. Change the generator_seed and you get a completely different set. The output is a list of integers, which downstream nodes can iterate over - feed it into your KSampler's seed input and the workflow runs once per seed in the list.

    The inputs and outputs that matter

    • num_seeds - how many seeds to generate (1 to 1000, default 10). This is effectively your batch size.
    • generator_seed - the master seed the list is derived from (0 to 1,000,000, default 0). Keep it fixed to reproduce a batch; change it to roll a whole new set.

    Output is INT, and it's a list - that's the key detail. It's not a single number, it's num_seeds numbers meant to be iterated.

    How to install it

    ComfyUI Manager: search Bjornulf_custom_nodes, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/justUmen/Bjornulf_custom_nodes
    

    Restart ComfyUI. No extra dependencies for this one.

    Common issues

    The thing that surprises people is the list output. Because it emits a list of seeds rather than one, wiring it into a seed input makes the downstream chain run once per seed - so num_seeds = 10 means ten generations, not one. That's the intended behavior, but if you didn't expect a batch, it looks like the workflow "ran too many times." Set num_seeds to what you actually want to produce.

    Also don't confuse this with a node that changes the seed within a running loop - this is about generating a fixed, reproducible set up front. If you specifically want to force a fresh seed on every iteration of one of the pack's other loops, the "Text with random Seed" node is the tool for that job. And keep in mind large num_seeds values mean a lot of generations; on paid or metered compute, ten seeds is ten runs' worth of GPU time.

    CategoryBjornulf

    Inputs (2)

    NameTypeDefaultDescription
    num_seedsINT101โ€“1000โ€”
    generator_seedINT00โ€“1000000โ€”

    Outputs (1)

    NameTypeDescription
    INTINTโ€”