ComfyUI Node Runs on cloud

Random Float

A random decimal between two bounds

By sipherxyz·Created 3 years ago·Updated 4 months ago· 352
Random Float
    • FLOAT
    • STRING
    min0.00
    max1.00

    Give it a low bound and a high bound, and it hands you a random decimal in between. That's the node. Where it earns its place is variation: wire its output into denoise, CFG, a LoRA strength, or a ControlNet weight, and every run lands on a different value in the range you chose. Instead of babysitting a slider across a batch, you let the graph roll the dice and you go look at what came out.

    It's the continuous cousin of a random seed. A seed randomizes which image; RandomFloat randomizes how strong a knob is. That makes it great for exploration - sweep denoise between 0.4 and 0.7 across a batch and see where the sweet spot is, or jitter CFG a little so a batch doesn't feel same-y. It's also useful in automated pipelines where you want a controlled dose of randomness baked into the workflow rather than dialed by hand.

    How it works

    It picks a uniform random float between min and max each time the node runs. It emits the number both as a float (for feeding numeric sockets) and as a string (for logging or filenames), so you can both use the value and record what it was - which matters, because a random value you can't see is a random value you can't reproduce.

    Inputs and outputs

    Two inputs:

    • min - the low end of the range (default 0).
    • max - the high end (default 1). The default 0–1 range is exactly right for denoise, so out of the box it's tuned for the most common use.

    Two outputs:

    • FLOAT - the random value, into denoise, CFG, strength, or any float socket.
    • STRING - the same value as text, so you can stamp it into a filename or read it in your logs.

    That string output is quietly the useful part: catch the value in your output filename and you can trace any image back to the exact roll that made it.

    Installing it

    Comes with the ArtVenture pack. ComfyUI Manager: search comfyui-art-venture, install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/sipherxyz/comfyui-art-venture
    

    Restart ComfyUI. No downloads.

    Common issues

    Every run is identical. ComfyUI caches node outputs and only re-runs what changed. If nothing upstream of RandomFloat changed, it may reuse the previous value. Tie it to a changing input (like the seed) or otherwise force the node to re-execute so it rolls fresh each queue.

    Wild, unusable values. The max bound goes absurdly high, so if you leave max at some huge number, you'll get huge results. Set the range to something sane for the target - 0–1 for denoise, maybe 1–8 for CFG. The node trusts your bounds completely; it does no sanity-checking.

    "It gave 0.83 to my step count." RandomFloat outputs a float. If a socket wants a whole number (steps, seed), run the value through String to Number, or use an integer randomizer instead. Feeding a raw float where an int is expected is the usual mismatch.

    You wanted the same random value in two places. Wire the single output to both sockets rather than using two RandomFloat nodes - two nodes roll two independent numbers.

    CategoryArtVenture/Utils

    Inputs (2)

    NameTypeDefaultDescription
    minFLOAT0.000–18446744073709550000
    maxFLOAT1.000–18446744073709550000

    Outputs (2)

    NameTypeDescription
    FLOATFLOAT
    STRINGSTRING