🎲 Rennart Random Number
Random numbers with a seed you can actually hold onto
- int
- float
- number
- string
- seed
Rennart Random Number is a utility node that generates a random value inside a range you set and hands it back in every shape a downstream node might want: int, float, number, and string outputs all at once, plus a seed output so you can see (and reuse) exactly what produced the value. It's from the ComfyUI-Rennart pack, and it's the kind of node that sounds trivial until you need a random integer feeding a strength slider or a random pick from a set of options and realize you've been hardcoding values to avoid wiring one up.
How it works
The important detail is that it seeds Python's random module with your seed input before drawing. That makes it deterministic: same seed, same number, every time. Set seed to a fixed value and a node downstream gets a stable result you can reproduce; turn on the seed widget's "randomize" in control_after_generate and you get a fresh roll on every run - and because the node hashes the seed in IS_CHANGED, each new seed actually triggers a re-execution instead of getting swallowed by ComfyUI's cache.
number_type picks the draw: integer uses randint, float uses uniform, bool is a coin flip (which is a nice compact way to toggle something on/off randomly in a batch).
The inputs that matter
number_type-integer,float, orbool.minimum/maximum- the range. Both are FLOAT even for integers, and they can go negative (the range spans ±1e12).enable_rounding+round_to- the sleeper feature. With rounding on, the result snaps to the nearest multiple ofround_to. That's the difference between getting37and getting35when you need steps of 5, or a number divisible by 16 when you're feeding a dimension that must stay latent-friendly. The tooltip spells it out: round to steps like 1, 5, 10, 16, 64.seed- the reproducibility knob. Watch out: ifminimumandmaximumare left withmaximumbelowminimum,randintwill throw, so keep the range sane.
Outputs are int, float, number, string, and seed. The string output is handy for prompt assembly and filename templates; seed lets you log or reuse the value that produced a given output, which is a genuinely nice touch for reproducibility debugging.
Install and gotchas
Part of ComfyUI-Rennart, so one install covers everything:
# ComfyUI Manager: search "ComfyUI-Rennart", or:
cd ComfyUI/custom_nodes
git clone https://github.com/Rennart2025/ComfyUI-Rennart
Restart ComfyUI; it's under Rennart/Utils. No models, no extra deps beyond torch/numpy.
Two things to watch. First, the tooltips in this node are in Russian (Включить округление числа = enable number rounding) - the author's native language leaks through, and it's worth knowing so the tooltip doesn't read as a mystery. Second, for integers the outputs are a bit quirky: float output is int(value) cast to float when you didn't enable rounding, so with integer type the float output always ends in .0. Not a bug, just a shape to expect when you wire it around.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| number_type | COMBO | integer | 3 options: integer, float, bool |
| minimum | FLOAT | 0.0-1000000000000–1000000000000 | — |
| maximum | FLOAT | 100.0-1000000000000–1000000000000 | — |
| enable_rounding | BOOLEAN | false | Включить округление числа |
| round_to | INT | 11–1000 | Шаг округления (1, 5, 10, 16, 64 и т.д.) |
| seed | INT | 00–18446744073709550000 | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| int | INT | — |
| float | FLOAT | — |
| number | NUMBER | — |
| string | STRING | — |
| seed | INT | — |