ComfyUI Node

Tiny Random

Random numbers that cluster toward the middle — the CFG jitter you want

By TinyBeeman·Created about a year ago·Updated about a month ago· 1
Tiny Random
    • rnd_int
    • rnd_float
    • rnd_str
    min0.00
    max1.00
    power1
    precision3
    seed0

    Plain random is easy; useful random is not. Tiny Random's trick is that it doesn't just roll a number between min and max - it averages several rolls, so the result clusters toward the middle of your range instead of spreading flat. That's the difference between a seed jitter that occasionally lands somewhere silly and one that nudges things around a sensible center. It's a small node with a genuinely thoughtful behavior hidden in the name.

    How it works

    Five inputs: min and max (floats, default 0–1), power (INT, default 1, clamped 1–10), precision (INT, default 3, clamped 0–15), and seed (INT, default 0, with the usual "control after generate" behavior so it rolls a fresh value each run).

    Mechanically it draws power uniform random samples between min and max and averages them. At power = 1 you get flat uniform random - the boring kind. Crank power to 3 or 5 and the average pulls toward the midpoint, so you get a bell-curve-ish distribution: most results near the middle of the range, fewer near the edges. That's the whole personality of the node, and it's exactly what you want when you're jittering a value that has a happy middle ground.

    The output value gets rounded to precision decimals, and you get all three representations of the same number:

    • rnd_int - the value truncated to an integer (int() of the float)
    • rnd_float - the rounded float
    • rnd_str - the same number as a string, trailing zeros stripped

    Where you'd use it

    Anywhere you want controlled, reproducible randomness. Jitter the seed to explore a prompt. Nudge CFG or denoise strength around a base value without flat-out guessing. Because the seed fully determines the result, a fixed seed gives you the same "random" values every run - which is the difference between a chaos generator and a tunable knob. The string output is handy when you need to embed the value in a prompt or filename.

    Install

    It's part of ComfyUI-TinyBee. ComfyUI Manager → search ComfyUI-TinyBee → install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/TinyBeeman/ComfyUI-TinyBee
    

    It's under 🐝TinyBee/Util. Pure stdlib - no models or extra dependencies (the pack's pillow/jsonata requirements serve its image and JSON nodes).

    Gotchas

    Three things. rnd_int is a truncation, not a round - 3.9 becomes 3. If you need proper rounding, use the float output. Second, min and max aren't auto-sorted: feed it min=5, max=1 and you'll get values outside your mental range. And power is where the "random" reputation breaks down on purpose - remember that at high power you're explicitly asking for values that hug the middle. If you wanted flat uniform random, leave power at 1 and save the surprise.

    Category🐝TinyBee/Util

    Inputs (5)

    NameTypeDefaultDescription
    minFLOAT0.00
    maxFLOAT1.00
    powerINT11–10
    precisionINT30–15
    seedINT00–18446744073709550000

    Outputs (3)

    NameTypeDescription
    rnd_intINT
    rnd_floatFLOAT
    rnd_strSTRING