Uniform Random Int
Uniform Random Int (UniformRandomInt) — ComfyUI-LogicUtils
- INT
You want a random whole number, but you also want to be able to get the same random number back later. That combination is the whole reason this node exists, and it's the thing that separates it from its cousin SystemRandomInt in the same pack.
The trick is the seed. UniformRandomInt draws a number uniformly between a minimum and a maximum, but the draw is seeded, which means a given seed always produces the same result. Same seed, same number, every single run. That's exactly what you want when you're jittering a parameter but still need runs to be reproducible: pick a random step count, a random index into a list of prompts, a random offset, whatever, and then pin the seed when you find a combination worth keeping. Change the seed and you get a fresh number; hold it and the workflow is deterministic again.
This lives in ComfyUI-LogicUtils, the logic-and-math grab-bag from aria1th, the handle behind AngelBottomless who trained Illustrious XL. It's a personal toolkit rather than a shipped product, so expect terse nodes and near-zero docs. You mostly learn these by wiring them and watching what comes out.
Inputs and outputs
Three required inputs, all integers. min_val (default 0) and max_val (default 1) set the range, and both are bounded to roughly plus or minus a billion, so you can't ask for absurd values by accident. seed (default 0) is the reproducibility knob. The single output is an INT.
A couple of practical notes. Because the output only changes when the seed changes, if you want a genuinely new number on every run you need to feed the seed from something that moves, or use ComfyUI's own seed widget behavior to randomize it. And this is an output node, so it'll run when you queue even if nothing downstream is pulling on it.
Installing it
- ComfyUI Manager: Custom Nodes Manager, search "ComfyUI-LogicUtils," install, restart.
- Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/aria1th/ComfyUI-LogicUtils, then restart.
No models, no weighty dependencies. There's an opt-in dependency auto-installer gated behind COMFYUI_LOGICUTILS_AUTO_INSTALL=1 (and a COMFYUI_LOGICUTILS_SKIP_INSTALL=1 to force it off), but a random-number node has nothing to install.
Where it bites
The single most common confusion is "why isn't my random number changing?" The answer is almost always that your seed isn't changing. Seeded means deterministic, on purpose. If you leave the seed fixed, the node is doing its job by giving you the same value.
The flip side is worth knowing too: if you specifically want unrepeatable, don't-care-about-reproducibility randomness, this isn't the node, because you'd be fighting the seed the whole time. That's what SystemRandomInt is for. Pick UniformRandomInt when reproducibility matters, which for most serious generation work it does.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| min_val | INT | 0-999999999–999999999 | — |
| max_val | INT | 1-999999999–999999999 | — |
| seed | INT | 00–9223372036854776000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |