π² Advanced Seed Generator
Fixed, Random, Increment, Decrement
- seed
Let's be honest about what this is before we get romantic: the π² Advanced Seed Generator is one tiny node that outputs an integer seed in four modes. That's it. No model files, no API, no dependencies. If all you ever do is lock the seed on a KSampler and hit the dice button, you genuinely don't need this. You reach for it when the seed stops being a per-generation nicety and becomes a thing you're managing: you're farming seeds across variations, you want a run of sequential seeds without typing them by hand, or you need the seed as a plain INT to wire into something that isn't a sampler.
The interesting half is the stateful modes. The community's number-one debugging rule - change one variable at a time on a fixed seed - is easy to preach and fiddly to practice when the seed box resets between generations. This node turns that discipline into a mode switch.
How it works
There's a dropdown with four choices, and each does exactly what it says:
- fixed - returns whatever you typed in the seed input, every time. This is your reproducibility mode.
- random - a fresh seed in the full 64-bit range (
0to18,446,744,073,709,551,615) on every execution. - increment - returns the last generated seed plus one.
- decrement - returns the last seed minus one.
The increment/decrement modes are the point. They remember the last seed across executions, so run 1 gives 42, run 2 gives 43, run 3 gives 44 - ideal for sweeping a batch of variations or stepping a seed through a long workflow without babysitting it. The counter wraps safely at the 64-bit boundary: past MAX it rolls to 0, and below 0 back to MAX. Obvious-sounding, until you've hit a node that feeds a negative seed into a sampler and watches it complain.
One mechanical thing worth knowing: the counter is class-level, shared across every instance of this node in the running ComfyUI process. And the node tells ComfyUI to re-execute every run for the dynamic modes (via IS_CHANGED), so the increment actually fires each generation instead of getting cached. Fixed mode is cached - that's deliberate, and it's why fixed never disturbs the counter.
The inputs and outputs
Just two inputs and one output, and you'll only touch one of them:
- mode - the dropdown above. The only thing you'll really change.
- seed - an
INTdefaulting to0. It's used directly infixedmode and ignored by the other three. So no, you don't have to pre-seed the increment counter; the "seed" field isn't a starting value, it's just the fixed-mode value.
The output is a single INT named seed. Wire it into the seed input of any KSampler or KSampler Advanced. Because it's a plain integer, you can also feed it to other nodes that take a seed - which is the real reason "advanced" is in the name. It doesn't do anything clever; it just hands you the seed as a value you can actually manage instead of hiding it behind a dice button.
Installing it
Three ways, pick the easiest:
- ComfyUI Manager - search for "Random Seed Generator" and install, then restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/Limbicnation/ComfyUI-RandomSeedGenerator, then restart. - Registry -
comfy node install randomseedgenerator.
After restart it appears under utils. The one thing this pack won't do is fight you: it's pure Python standard library - random, time, logging - so there's no requirements.txt to satisfy, no version conflicts to untangle, no model to download. In an ecosystem where half your install time is dependency hell, that's quietly the best feature.
Where people get burned
Two gotchas, both real:
The counter is shared across all instances. Put two of these nodes in one workflow and set both to increment, and they step on each other - every execution bumps the same counter, so the second node isn't independent of the first. The author is upfront that per-node isolation isn't possible without upstream ComfyUI API changes. If you need two independent counters, use random mode for one of them, or wire different fixed seeds.
The counter lives in process memory only. Restart ComfyUI and increment starts from zero again. If you need a known starting point without restarting, run random mode once - the next increment continues from that random value plus one. Scripters can call AdvancedSeedGenerator.reset_state() to zero the counter directly.
Beyond that, node not appearing in the menu means you need a full restart, and a red import error in the console is worth reading - but with zero external dependencies, there's almost nothing left to go wrong.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | 4 options: fixed, increment, decrement, random | |
| seed | INT | 00β18446744073709550000 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| seed | INT | β |