π² Random Seed
One Fresh Seed Per Run, Without Touching the Sampler
- seed
A KSampler already has a seed widget with a randomize option, so why would you want a separate node that just produces a number? Because widgets live on one node. The moment your seed needs to reach two places - the sampler and a filename, or the sampler and a second sampler at a different resolution - you want one source wired to both, otherwise the values drift and you're debugging a mismatch you created on purpose.
π² Random Seed is that source. Nothing in, one integer out, between 0 and 2^64-1. It rolls a new one on every execution.
How it works
The node has no inputs at all, and it's not flagged as an output node - so on its own ComfyUI would happily cache it forever and hand you the same number every queue. It avoids that deliberately: the pack pins its fingerprint_inputs to time.time(), which is the V3 equivalent of the older IS_CHANGED returning NaN idiom. Different fingerprint every execution means the cache never matches, so the node genuinely re-runs and genuinely re-rolls. That's a small but non-obvious piece of engineering, and it's why this node behaves differently from its siblings - the seeded random nodes in the pack don't carry that fingerprint.
The cost is the same as any always-dirty node: it invalidates the cache for everything downstream. Since a seed change invalidates the sampler anyway, here that's free.
Inputs and outputs
No inputs. One output, seed, typed INT. Convert the KSampler's seed widget to an input (right-click β Convert widget to input, or just drag off it in newer frontends), and wire this into it.
The classic setup: Random Seed β the sampler's seed input and β a String Concat feeding Save Image's filename prefix. Now the filename carries the exact seed of the image, which is the difference between "I liked this one, no idea how I made it" and a reproducible run. Seed-to-filename is one of the few metadata habits worth adopting, and the pack's own Save Image With Metadata handles the automatic version.
One caveat on the sampler side: control_after_generate still applies to that widget. Leave it on fixed while you're driving the seed from here, or you'll have two things fighting over the same value.
Install
ComfyUI Manager β "ComfyUI-mnemic-nodes" β install β restart. Or manual:
cd ComfyUI/custom_nodes
git clone https://github.com/MNeMoNiCuZ/ComfyUI-mnemic-nodes
Zero dependencies needed for this node specifically - though the pack's requirements.txt installs the whole list (transformers, tiktoken, opencv-python, piexif, groq, tqdm and so on) regardless, because other nodes in it want them. No models, no API keys.
Common issues
Reproducing a specific image. This node can't help you - it's the opposite tool. Set the sampler's seed to a fixed value instead. If you already lost the seed, drag the output PNG back onto the canvas; the whole workflow, seed included, is inside the file.
The seed in your filename doesn't match the sampler. Almost always the control_after_generate setting on the sampler's seed widget overwriting the wired value. Set it to fixed (or switch the global "widget control mode" to Before, once per install, and stop being bitten by this class of bug).
Nothing changes between runs. Check that the sampler's seed input is actually wired, not just that the node is present. A dangling Random Seed node that nothing connects to is decorative.
Inputs (0)
No inputs
Outputs (1)
| Name | Type | Description |
|---|---|---|
| seed | INT | A fresh random seed, 0 to 2^64-1. Re-rolls on every run. |