Nodes/ComfyUI-JDCN/LogicUtil_Uniform Random Float
ComfyUI Node

LogicUtil_Uniform Random Float

A seeded random float between two bounds — for denoise jitter and strength wobble

By daxcay·Created 2 years ago·Updated about a year ago· 159
LogicUtil_Uniform Random Float
    • FLOAT
    min_val0.00
    max_val1.00
    decimal_places1
    seed0

    Sometimes you want a number that isn't fixed, isn't sequential, but is still reproducible. That's LogicUtil_Uniform Random Float. It hands you a random decimal between min_val and max_val, rounded to a configurable precision, and - the important part - every value is derived from a seed, so the same seed always produces the same float. It's from the LogicUtil subpack of ComfyUI-JDCN, and it's the node for adding controlled chaos to parameters like denoise, CFG, or LoRA strength.

    How it works

    Under the hood it's exactly what the name promises: random.Random(seed).uniform(min_val, max_val), rounded to decimal_places. That's the whole mechanism - a uniform distribution between your two bounds, no weighting, no curve. The FLOAT output plugs into any node that takes a float, which in ComfyUI is nearly everything.

    The four inputs:

    • min_val and max_val - your bounds (FLOAT, both defaulting sensibly to 0 and 1). Gotcha: if min_val is greater than max_val, the node doesn't error or swap them - it just returns min_val. So check your order.
    • decimal_places - how much precision you want, 0 to 10. Set it to 0 and you effectively get an integer, which is a neat way to reuse this node for coarse values.
    • seed - the reproducibility control. Same seed, same number, forever.

    Why you'd use it

    The classic use is parameter jitter in batch experiments. You're testing whether a workflow holds up across variations, so instead of hand-editing denoise between runs, you wire a random float in the 0.4–0.6 range and let each run pick a value. The seed does double duty: set it to the same seed as your KSampler and every part of the graph varies coherently; or vary it independently to wobble one parameter while everything else stays locked.

    That last point is where the community's "change one variable at a time" rule comes in. Because the value is seeded, you get the benefit of randomness and the ability to reproduce an exact run later - a random node that can't reproduce its own results is a debugging nightmare, and this one sidesteps that entirely.

    Installing it

    It's part of ComfyUI-JDCN, so one install covers the pack. ComfyUI Manager: Install Custom Nodes → search "JDCN", install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/daxcay/ComfyUI-JDCN.git
    cd ComfyUI-JDCN
    pip install -r requirements.txt
    

    The pack's only dependency is piexif; no models to download. It's a small two-person hobbyist pack (Daxton Caylor and Jerry Davos), and the random nodes are among its better-thought-out pieces. The one thing to remember: bounds order matters, and the seed is your friend - keep it locked while you're testing, change it when you want a genuinely different run.

    CategoryLogicUtil

    Inputs (4)

    NameTypeDefaultDescription
    min_valFLOAT0.00-999999999–999999999
    max_valFLOAT1.00-999999999–999999999
    decimal_placesINT10–10
    seedINT00–9999999999

    Outputs (1)

    NameTypeDescription
    FLOATFLOAT