Backend Random Seed
A seed that actually changes every run — generated on the backend, not in a widget
- seed
- seed_text
ComfyUI's built-in "randomize" on the seed widget has a timing problem baked into the name: it fires after the run. The number in the box is the seed for the next generation, not the one that just rendered - which is exactly how you find a great image, flip the dropdown to fixed to keep it, and discover the good seed is already gone. This node sidesteps the whole category of that pain. Backend Random Seed doesn't touch the frontend widget at all. Every time the workflow actually executes, it rolls a fresh seed on the server and hands it to the graph.
It comes from the Diztraido Nodes pack (jadervasque/ComyUI-Diztraido), a collection of Flux-focused composite nodes, metadata readers, and small utilities. This is the smallest utility in it, and honestly the one most people end up keeping.
How it works
The mechanism is dead simple and it's the point. The node uses Python's secrets module - the cryptographically-strong random source, not the predictable random module - to pick a number below maximum, and returns it two ways: as an INT seed and as the same value as a STRING seed_text.
The clever part is that its IS_CHANGED method returns NaN. In ComfyUI, a node whose IS_CHANGED value is never equal to itself is always considered dirty, so the cache is defeated and the node always reruns. That's the exact opposite of the frontend widget, which only rolls a new value when the UI tells it to. Wire this into a sampler's seed input and every queue item - including API runs and batch queues where nobody is clicking anything - gets a genuinely new seed.
The inputs and outputs that matter
There's only one input:
maximum- the upper bound for the random draw, defaulting to9223372036854775807(a signed 64-bit int). You basically never touch it; if you want seeds in a smaller range for testing, you can clamp it here.
Outputs:
seed(INT) - wire this into theseedinput of a KSampler, or this pack'sFlux Sampler.seed_text(STRING) - the same number as text, handy for filename templates or any node that wants a string.
How to install
It ships inside Diztraido Nodes, so you install the whole pack. ComfyUI Manager is easiest: search "Diztraido Nodes" and install the registry package diztraido-nodes, then restart. Or via CLI:
comfy node install diztraido-nodes
Git fallback:
cd ComfyUI/custom_nodes
git clone https://github.com/jadervasque/ComyUI-Diztraido.git
Restart ComfyUI and the node appears under the Diztraido categories. No extra Python dependencies and no model files - the pack reuses ComfyUI's own modules.
Common issues
The one real gotcha is that a NaN-keyed node poisons the cache for everything downstream of it. ComfyUI works backward from output nodes, re-executing only what might have changed - but anything downstream of this node always reruns. For a seed that's exactly what you want; just don't blame the pack if the branch behind it feels like it never caches.
Two other notes. There's no preview: the seed is generated at execution time, so the box won't show you "the" seed before you run - if you need reproducibility, this node is the wrong tool (use a fixed seed for that). And if you fan one seed out to multiple samplers, they share the same seed - which is usually what you want; if you want each sampler independent, add another node.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| maximum | INT | 92233720368547760001–9223372036854776000 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| seed | INT | — |
| seed_text | STRING | — |