Nodes/ComfyUI-YCNodes/Seed List (YC)
ComfyUI Node

Seed List (YC)

Give every iteration of a loop its own seed — deterministic batch variety

By yichengup·Created 2 years ago·Updated 4 months ago· 48
Seed List (YC)
    • seed
    • total
    min_num0
    max_num1125899906842624
    methodrandom
    total1
    seed0

    The seed problem in ComfyUI batch workflows: a KSampler with a fixed seed gives you the same image on every pass, so a loop that should produce variation produces copies. This node generates a list of seeds up front - random, incrementing, or decrementing - so each iteration of your loop pulls a different value, deterministically. The description in the pack says it plainly: it's for use in a for loop, picking a distinct seed per iteration.

    What it's actually for

    Batch variety with control. You're running a workflow that loops over prompts, LoRAs, or whatever, and you want each iteration to sample differently - but you also want the whole run reproducible. This node hands you that: give it a seed to seed the RNG, and it emits a reproducible list of total seeds. Feed each one into the sampler per iteration and every pass samples fresh, with the whole run replayable.

    How it works

    It calls Python's random.seed(seed) once, then generates total values:

    • random - a randint(min_num, max_num) per item (the common choice)
    • increment - min_num, min_num+1, … capped at max_num
    • decrement - max_num downward, floored at min_num

    The seed output is a list of total integers - the node says INT, but it returns a sequence, and the loop picks one per iteration (pair it with an index node; the author's description mentions easy's indexAny for exactly this). The total output just echoes your count so downstream nodes know how many iterations to run. IS_CHANGED is keyed off the seed, so the node re-evaluates when the seed changes and stays put when it doesn't - your run is reproducible, not chaotic.

    Inputs and outputs

    • min_num / max_num - the range seeds are drawn from (huge upper bound, so effectively unbounded)
    • method - random / increment / decrement
    • total - how many seeds to generate (1–100000)
    • seed - the RNG seed that makes it all reproducible

    Outputs: seed (the list - index into it per iteration) and total.

    Install

    In ComfyUI-YCNodes. ComfyUI Manager → search "ComfyUI-YCNodes" → install, restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/yichengup/ComfyUI-YCNodes
    

    Standard deps (torch, numpy, pillow, opencv-python, scipy), no models.

    Where people get burned

    • Thinking the seed output is a single int. It's a list. Wire it into an index node inside your loop, or you'll feed a list where a KSampler wants an integer and get a type error.
    • Forgetting it's deterministic. Same seed + same params = same list, every run. That's a feature for reproducibility - but if your loop "never changes," check that you're actually consuming a different item per iteration.
    • Swapped min/max. If min_num > max_num, the node swaps them for you - nice safety, but it can mask a bug where your intended range never gets used.

    It's a small node that quietly solves a classic annoyance: consistent batch variety in loop workflows, with the numbers you'd expect on every replay.

    CategoryYCNode/Logic

    Inputs (5)

    NameTypeDefaultDescription
    min_numINT00–1125899906842624
    max_numINT1125899906842624
    methodCOMBOrandom3 options: random, increment, decrement
    totalINT11–100000
    seedINT00–1125899906842624

    Outputs (2)

    NameTypeDescription
    seedINT
    totalINT