ComfyUI Node

DP Random Min Max

One node, four random numbers, your range

By DesertPixelAi·Created 2 years ago·Updated about a year ago· 25
DP Random Min Max
    • random_float_1
    • random_float_2
    • random_int_1
    • random_int_2
    min0.0
    max1.0
    step

    A lot of parameter randomization in ComfyUI ends up needing more than one random node stacked in a row - one for a float, another for an int, maybe a second pair for a second parameter. DP Random Min Max collapses that into one: set a range and a step precision, and it hands you back four random values at once - two floats, two ints - all drawn from the same bounds.

    How it works

    You set min and max to define the range, and step to control the precision the randomizer works at: int_1 for whole numbers, or float_0.1 / float_0.01 / float_0.001 for progressively finer float precision. From that single configuration it generates four independent random draws and hands back both float and int versions - which is genuinely convenient when you're randomizing something like a pair of coordinates, or you want to drive two different downstream parameters from the same range without wiring up two separate randomizer nodes.

    Because it produces two of each type rather than just one, you can also use it to randomize a pair of related values in one shot - an x/y jitter, a min/max pair for some other node, two independent strength values - without doubling your node count.

    Inputs and outputs

    Required:

    • min (default 0, range -10000 to 10000, step 0.1) - lower bound.
    • max (default 1, range -10000 to 10000, step 0.1) - upper bound.
    • step - precision: int_1, float_0.1, float_0.01, or float_0.001.

    No optional inputs.

    Four outputs: random_float_1, random_float_2, random_int_1, random_int_2 - pick whichever pair matches the type the downstream input expects, and ignore the rest.

    Installing it

    ComfyUI Manager: search ComfyUI-Desert-Pixel-Nodes, install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/DesertPixelAi/ComfyUI-Desert-Pixel-Nodes
    

    Restart ComfyUI - pure math, nothing to download.

    Where people get tripped up

    The step setting is a precision control, not a range cap - it doesn't clamp your values to a smaller window, it just determines how fine-grained the randomizer's output is within whatever min/max you set. If you set step to int_1 but expected the float outputs to also carry decimal precision, that's not going to happen - the step setting governs both pairs of outputs together, not independently.

    Also worth knowing: this node has no fixed/randomize toggle and no seed input the way some of this pack's other random-generator nodes do. Every queue re-rolls all four outputs. If you need a specific combination of values to persist across runs while you tweak something else, you'll need to capture that output (paste it into a primitive, or use ComfyUI's own value-locking on the widget) rather than expecting this node to hold still on its own.

    CategoryDP/utils

    Inputs (3)

    NameTypeDefaultDescription
    minFLOAT0.0-10000–10000
    maxFLOAT1.0-10000–10000
    stepCOMBO4 options: int_1, float_0.1, float_0.01, float_0.001

    Outputs (4)

    NameTypeDescription
    random_float_1FLOAT
    random_float_2FLOAT
    random_int_1INT
    random_int_2INT