Nodes/ComfyUI Seed Wildcard Pack/Seed Generator (Strict Random)
ComfyUI Node

Seed Generator (Strict Random)

A seed that refuses to be zero

By sinanzoo2nd·Created 8 months ago·Updated 3 months ago· 0
Seed Generator (Strict Random)
    • SEED_INT
    • SEED_FLOAT
    • SEED_STRING
    seed1

    Seed 0 is a lie you've probably told yourself: it's a perfectly valid seed to every sampler, and then it quietly breaks the one node that indexes lines by seed. This is the node that fixes that specific, annoying failure mode.

    SeedGeneratorWithMin ("Seed Generator (Strict Random)") is part of the ComfyUI Seed Wildcard Pack. It's a tiny guard: feed it a seed, and if that seed is less than 1, it rolls a brand-new random integer in the safe range and hands it back. That's the whole job. Feed it 1 or anything above, and it passes the number through untouched.

    Why bother? Because this pack's wildcard nodes are 1-based. SeedBasedWildcardImpact and SeedBasedWildcardLora pick a line using (seed - 1) % number_of_lines, so seed 1 means "first line of the file." Feed them a 0 and Python's modulo wraps around to -1, which lands you on the last line - every single time, regardless of which seed you thought you were testing. The README says it plainly: this node exists to "prevent errors in 1-based indexing logic." It's a two-node workflow's worth of frustration condensed into a single guard.

    How it works

    The mechanism is embarrassingly simple and all the better for it. The single input, seed (an INT, default 1), gets checked: if it's below 1, the node calls random.randint(1, 0xffffffffffffffff) and uses that instead. Otherwise it's a pass-through. Nothing else happens, no state, no hidden logic.

    What makes it more than a one-trick pony is the outputs - it hands you the same number three ways:

    • SEED_INT - the integer, for wiring into KSamplers or the wildcard nodes
    • SEED_FLOAT - the same value as a float, for nodes that want a numeric prompt weight or a CFG-ish input
    • SEED_STRING - the same value as text, for dumping into a prompt string or for nodes that read seeds as strings

    One seed in, three typed representations out. It's the kind of adapter you don't think you need until you're staring at a node that demands a string seed.

    The workflow pattern

    The intended shape is: seed → this node → the seed-based wildcard selectors. You get the reproducibility of a fixed seed and the safety net that 0 never reaches the 1-based index math. If you're building seed grids (X/Y plots over seeds) this is genuinely handy - it guarantees every grid cell is a "real" seed for the wildcard layer.

    Install

    It ships in the ComfyUI Seed Wildcard Pack. Easiest path is ComfyUI Manager - search for Seed Wildcard and install. Or, from your ComfyUI/custom_nodes directory:

    git clone https://github.com/sinanzoo2nd/ComfyUI-Seed-Wildcard-Pack
    

    Restart ComfyUI afterward. The pack has no requirements.txt and downloads no models; this node itself depends on nothing beyond the Python stdlib, so it'll run on a machine that has never touched any of the pack's fancier nodes.

    Troubleshooting

    There's really only one thing to get wrong, and it isn't this node's fault: if you wire its output straight into a sampler and see no change in behavior from a raw seed input, that's correct - it's a pass-through for anything ≥ 1. The value shows up when the seed feeds one of the pack's wildcard selectors or any other 1-based consumer. Also note the inputs say the min is 0, so you can't type a negative in the UI - that's the guard doing its job, not a bug.

    CategoryCustom/Wildcard

    Inputs (1)

    NameTypeDefaultDescription
    seedINT10–18446744073709550000

    Outputs (3)

    NameTypeDescription
    SEED_INTINT
    SEED_FLOATFLOAT
    SEED_STRINGSTRING