Nodes/Random Seed Batch Generator/Random Seed Batch Generator
ComfyUI Node

Random Seed Batch Generator

One node that hands KSampler a whole batch of seeds (small print included)

By Glashkoff·Created 2 months ago·Updated 2 months ago· 0
Random Seed Batch Generator
    • seeds
    initial_seed0
    step1
    count1
    groups1

    If you've ever wanted "ten generations from roughly this seed, plus a couple of independent sets," you know the usual routine: wire up a seed node, run, scribble down the seed, bump it, run again. Random Seed Batch Generator collapses that into a single node. Give it a starting seed, a step, a count, and a number of groups, and it hands your sampler a flat list of seeds. One run, N images, zero bookkeeping.

    It's a small, honest utility - one node, zero dependencies, no model files, GPL-3.0, and per the README a descendant of Steudio's Seed Shifter. There isn't a lot to go wrong, which is part of its charm.

    How it works

    The node builds a deterministic random.Random(initial_seed) RNG, then for each group draws a random start in 0..2^64-1 - step - count + 1 and emits count seeds. The shipped math is:

    start + step + i, for i in 0..count-1

    So each group is a run of consecutive integers offset by step from its own random start. That's the small print: the README's example shows pairs spaced by the step ([12345, 12348] with step=3), but the code actually produces [start+3, start+4]. And despite the tooltip on step, setting it to 0 gives you consecutive seeds, not identical ones. Small step still means small variation either way - the point is the systematic sweep, not the exact spacing.

    initial_seed carries the familiar control_after_generate menu (fixed, increment, decrement, randomize). Set it to fixed and the whole sequence becomes reproducible: same starting value, same group starts, every run. That's the debugging-friendly version, and it lines up with the community rule that keeps surfacing in every seed thread - change one variable at a time, on a fixed seed, or you can't tell what caused the change. This node is basically that discipline packaged as a graph.

    Inputs and outputs

    Only four inputs, and a beginner really touches all of them:

    • initial_seed (INT, default 0) - the anchor. Group starts are derived from it deterministically.
    • step (INT, default 1) - the offset applied to each group's run.
    • count (INT, default 1) - seeds per group.
    • groups (INT, default 1) - how many independent sets to run; each starts from its own random start.

    The single output, seeds, is an INT list with count * groups entries. Connect it to the seed input of any sampler node (KSampler, KSampler Advanced) and the batch runs over your seed list.

    Install

    Via ComfyUI Manager, search Random Seed Batch Generator and install. Or the manual way:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Glashkoff/comfyui-random-seed-batch-generator
    

    Then restart ComfyUI. pyproject.toml declares zero dependencies but requires-comfyui >= 0.25.0 - that version floor is the real gotcha. This pack uses the newer extension API and list inputs, so an older ComfyUI simply won't load it. Update ComfyUI first.

    Common issues

    The one that will actually bite: the seed count is your batch size. count=10, groups=5 sends 50 seeds downstream, so whatever feeds your sampler has to handle a 50-image batch. Check your Empty Latent's batch_size and your VRAM budget before you get ambitious - the README's own example of count=1000, groups=1000 is a million seeds, and that's a way to OOM yourself, not a way to speed anything up.

    Second edge case, straight from the docs: if step + count - 1 exceeds 64 bits, the node silently returns an empty list and your sampler errors downstream. Unless you're genuinely exploring the limits of 64-bit integers, don't worry about it - but if you see a mysterious empty seed list, that's where to look.

    Categoryseed_batch_generator

    Inputs (4)

    NameTypeDefaultDescription
    initial_seedINT00–18446744073709550000Starting seed for reproducible randomization. The actual group seeds are derived from this value.
    stepINT10–18446744073709550000Step between seeds within a single group. Set to 0 for all seeds in a group to be equal.
    countINT1Number of seeds per group.
    groupsINT11–18446744073709550000Number of groups to generate. Each group starts from a random seed.

    Outputs (1)

    NameTypeDescription
    seedsINT