Seed
Seed control with a memory, pulled out of the sampler
- X
The default way to handle a seed in ComfyUI is the number widget buried inside the KSampler, with a "control after generate" dropdown set to fixed, increment, decrement, or randomize. It works, but the seed you actually used gets overwritten the instant you queue the next run - so if run #4 was great and you want to go back to it, you're either digging through PNG metadata or out of luck. mxSeed exists to fix that: it's a standalone node that remembers what it just did.
Why you'd reach for it
Pulling seed control off the sampler and into its own node is a common enough itch that other packs have solved it their own way too - rgthree's Seed node, for instance, uses a magic-number convention (-1 for randomize, -2/-3 for step forward/back) borrowed from Automatic1111. mxSeed takes a more literal, button-driven approach instead: an actual randomize button, and the node itself remembers your last two values so you can step back to a previous roll without having gone hunting for it.
How it works
Per the pack's own description: mxSeed randomizes the seed before generation starts and keeps the two most recent values around for reuse. It also has toggles for auto-starting generation the moment you randomize (skip the extra click on Queue) and for auto-interrupting whatever's currently running when you fire off a new seed - so you don't end up queuing on top of a generation you've already mentally abandoned. Hold shift while clicking randomize and instead of a full reroll, it just bumps the seed up by one - a smaller nudge than a completely fresh number, useful when you're exploring seeds that are "close" to one you liked.
The input and output that matter
Despite all that interactive behavior, the graph-level contract is about as simple as it gets:
X- an INT, default0, ranging from0up to4294967296(the standard unsigned-32-bit ceiling ComfyUI seeds live under). This is both the required input and the single output - the node holds the value, and whatever it currently holds is what comes out.
Wire the output into your KSampler's seed input (or fan it into several samplers across a multi-stage pipeline - base, refiner, upscale - to lock the whole chain to one number). Converting a sampler's seed field to an input like this also makes its own "control after generate" dropdown disappear, since there's no widget left for it to control - so there's no risk of the sampler's built-in randomization fighting with mxSeed over who owns the value.
Installing it
Through ComfyUI Manager: search ComfyUI-mxToolkit (or mxToolkit), install, restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/Smirnov75/ComfyUI-mxToolkit
Restart afterward. It's one of five nodes the pack ships (Stop, Slider, Slider2D, and an alternative Reroute alongside Seed), all landing under utils/mxToolkit once installed. No models, no extra Python dependencies called out in the README - it's a UI/graph-logic pack, not anything inference-side.
Common issues
This is the node where the API caveat matters most, because almost all of mxSeed's actual value - the randomize button, the two-value memory, auto-start, auto-interrupt, the shift-click nudge - is interactive JS behavior layered on top of that one integer. If you're triggering this workflow through the API rather than clicking around in the browser, none of that fires. You're just passing a plain integer into X and getting the same integer back out, with zero benefit over any other seed-shaped INT input. If you want actual randomization on an API-driven run, generate the random number on your side before you call the workflow.
Worth knowing if you're scripting values by hand, too: unlike rgthree's -1 sentinel, there's no magic number here that means "randomize" - the field's minimum is 0, so there's no reserved value to trigger anything. Randomization is purely the on-node button; a value you pass in is just... that value.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| X | INT | 00–4294967296 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| X | INT | — |