ComfyUI Node

Random Floats 4

Four independent random floats from one seed

By Alectriciti·Created 12 months ago·Updated 23 days ago· 87
Random Floats 4
    • value1
    • value2
    • value3
    • value4
    min_value0.00
    max_value1.00
    seed0

    Not every node in Adaptive Prompts is about prompts. Random Floats 4 is a plain math utility the pack ships alongside its wildcard machinery - it lives in ComfyUI's generic Math category rather than under adaptiveprompts/*, and it has nothing to do with prompt text at all. It exists because the author needed reproducible random numbers for other parts of their own workflows and figured other people would too.

    How it works

    Give it a min_value, a max_value, and a seed, and it draws four independent random floats from that range, deterministically - the same seed always produces the same four numbers. There's no correlation between the outputs beyond sharing the same seed and range; they aren't sorted, averaged, or related to each other in any way, just four separate draws from one RNG state.

    The inputs and outputs that matter

    • min_value (default 0) and max_value (default 1) - the range each output is drawn from.
    • seed - drives all four draws; same seed, same four numbers, every time.
    • Outputs: value1 through value4, all FLOAT - wire any of them into any node that accepts a float input.

    How to install it

    It comes bundled with the rest of the pack, no separate install needed. Search comfyui-adaptiveprompts in ComfyUI Manager, or clone it directly:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Alectriciti/comfyui-adaptiveprompts
    

    Restart ComfyUI afterward. It's about as lightweight as a node gets - no models, no dependencies, no config beyond the three inputs above.

    Common issues & troubleshooting

    There's genuinely not much to trip over here - it's a four-line-of-logic utility node. The one thing worth knowing: if you're expecting a relationship between the outputs (say, value1 always coming out lower than value2 for a min/max pair), that's not how this node works. Each output is an independent draw from the same range; if you need an ordered pair, sort them yourself downstream or wire them into a Min/Max-style compare node.

    If you want reproducible float variety wired into something inside a prompt string rather than into a numeric socket - say, randomizing a LoRA's weight as text, <lora:cool_lora:__weight__> - that's not what this node is for. That pattern needs a wildcard .txt file resolved through a Prompt Generator, since a LoRA tag's weight is parsed out of resolved prompt text, not fed in as a separate FLOAT socket. Reach for this node instead whenever the target actually accepts a FLOAT input directly - CFG scale, denoise strength, or any other numeric slider you've converted to an input.

    It's easy to miss entirely. Because it ships bundled inside a prompt-crafting pack rather than a standalone math pack, people searching for "random float node ComfyUI" often don't think to look inside Adaptive Prompts for it. If you've already got this pack installed for its wildcard and prompt-processing nodes, you don't need a second math-utility pack just to get four reproducible random floats out of one seed - this one's sitting right there under the Math category alongside its integer sibling.

    CategoryMath

    Inputs (3)

    NameTypeDefaultDescription
    min_valueFLOAT0.00
    max_valueFLOAT1.00
    seedINT00–18446744073709550000

    Outputs (4)

    NameTypeDescription
    value1FLOAT
    value2FLOAT
    value3FLOAT
    value4FLOAT