Nodes/ComfyUI-Rennart/🎲 Rennart Random Number
ComfyUI Node

🎲 Rennart Random Number

Random numbers with a seed you can actually hold onto

By Rennart2025·Created 4 days ago·Updated 4 days ago· 2
🎲 Rennart Random Number
    • int
    • float
    • number
    • string
    • seed
    number_typeinteger
    minimum0.0
    maximum100.0
    enable_roundingfalse
    round_to1
    seed0

    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, or bool.
    • 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 of round_to. That's the difference between getting 37 and getting 35 when 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: if minimum and maximum are left with maximum below minimum, randint will 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.

    CategoryRennart/Utils

    Inputs (6)

    NameTypeDefaultDescription
    number_typeCOMBOinteger3 options: integer, float, bool
    minimumFLOAT0.0-1000000000000–1000000000000
    maximumFLOAT100.0-1000000000000–1000000000000
    enable_roundingBOOLEANfalseВключить округление числа
    round_toINT11–1000Шаг округления (1, 5, 10, 16, 64 и т.д.)
    seedINT00–18446744073709550000

    Outputs (5)

    NameTypeDescription
    intINT
    floatFLOAT
    numberNUMBER
    stringSTRING
    seedINT