Nodes/ComfyUI_Fill-Nodes/FL Random Number
ComfyUI Node

FL Random Number

A seeded random INT and FLOAT for driving parameters

By filliptm·Created 3 years ago·Updated about 15 hours ago· 628
FL Random Number
    • INT
    • FLOAT
    min_value0.0
    max_value1.0
    seed0

    Sometimes you want a number to wander a little between runs - a slightly different LoRA strength, a jittered CFG, a random pick from a range - but you also want to be able to reproduce any given result later. FL_RandomNumber is the small utility for that: pick a min and max, and it hands you a random value in that range as both an INT and a FLOAT, with a seed so the "random" is repeatable when you need it to be.

    It's the kind of node you don't think about until a workflow needs controlled variation. Then it's exactly right: one node, two typed outputs, deterministic when you pin the seed and free-running when you don't.

    How it works

    Given a range and a seed, it draws a value between min_value and max_value. The seed makes it reproducible - same seed, same number every time - which is the whole reason to use a node like this instead of true randomness you can never recover. The one behavior to know: a seed of 0 means "generate a fresh random seed each run," so leaving it at 0 gives you genuinely varying output, while any non-zero seed locks the result.

    You get the drawn value out in two forms so you don't need a converter: an INT for parameters that want whole numbers, and a FLOAT for ones that want decimals.

    The inputs and outputs that matter

    All optional (it works with defaults):

    • min_value (FLOAT, default 0) and max_value (FLOAT, default 1) - the range to draw from. Defaults give you a 0-to-1 float, handy for strengths and blend factors.
    • seed (INT, default 0) - 0 auto-randomizes every run; set a specific number to lock and reproduce a result.

    Two outputs from the same draw: INT and FLOAT. Wire whichever the downstream input expects - the INT into a step count or a batch index, the FLOAT into a strength or a denoise.

    When you'd reach for it

    Batch exploration where you want each run to vary a parameter within bounds. Randomizing a LoRA or ControlNet strength across a sweep. Feeding a random index into a selector. Any spot where a hardcoded constant would make every run identical and you'd rather have controlled, recoverable variation.

    Installing it

    ComfyUI ManagerComfyUI_Fill-Nodes → install → restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/filliptm/ComfyUI_Fill-Nodes
    

    then restart. No dependency beyond the pack itself - it's pure Python.

    Common issues & troubleshooting

    It keeps giving the same number. You've set a non-zero seed, which locks the value. Set seed to 0 for a new draw each run, or change the seed to move it.

    It never repeats and I wanted it to. Opposite problem - seed is 0, so it re-randomizes every time. Pin it to a specific integer once you've found a value you like.

    The INT and FLOAT don't match up how I expected. They come from the same draw; the INT is the whole-number form of that value. If your range is 0–1, the INT will mostly be 0 or 1 - widen min_value/max_value if you actually want a spread of integers.

    Range feels off. Remember min_value and max_value are floats. Set them to whole numbers if you're driving something integer-shaped and want clean bounds.

    Category🏵️Fill Nodes/Utility

    Inputs (3)

    NameTypeDefaultDescription
    min_valueoptFLOAT0.0-1000000–1000000
    max_valueoptFLOAT1.0-1000000–1000000
    seedoptINT00–1000000

    Outputs (2)

    NameTypeDescription
    INTINT
    FLOATFLOAT