Nodes/comfyui-adaptiveprompts/Random Integers 4
ComfyUI Node

Random Integers 4

Four independent random ints from one seed

By Alectriciti·Created 12 months ago·Updated 23 days ago· 87
Random Integers 4
    • value1
    • value2
    • value3
    • value4
    min_value0
    max_value10
    seed0

    The integer twin of Random Floats 4, and just as generic - this is a bare math utility bundled into Adaptive Prompts rather than a prompt-processing node, and it lives under ComfyUI's plain Math category instead of the pack's own adaptiveprompts/* namespaces. If you need four reproducible random whole numbers wired to different parts of a graph - batch sizes, step counts, an index into a list, an alternate seed for a sub-process - this covers it without stacking four separate seed nodes.

    How it works

    Set min_value and max_value, set a seed, and it draws four independent integers from that inclusive range, deterministically - same seed, same four numbers, every run. The four outputs don't relate to each other beyond sharing the seed and range; they're separate draws, not a sorted set or a spread pattern.

    The inputs and outputs that matter

    • min_value (default 0) and max_value (default 10) - the inclusive range each output is drawn from.
    • seed - drives all four draws.
    • Outputs: value1 through value4, all INT - wire any of them into any node accepting an integer input.

    How to install it

    Bundled with the rest of the pack - no separate step. Search comfyui-adaptiveprompts in ComfyUI Manager, or install manually:

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

    Restart ComfyUI. No models, no dependencies beyond the base pack.

    Common issues & troubleshooting

    There's not much surface area for this one to go wrong - it's a small, self-contained utility. The main thing to keep in mind is the same as its float sibling: the four outputs are independent draws, not a related set, so don't expect value1 to always be smaller than value2 or any other ordering relationship. If you need that, sort or compare the outputs yourself downstream.

    If your actual goal is randomizing something inside a resolved prompt string - a count for a {3$$__fruit__}-style bracket selector, say - that number needs to live in the prompt text itself and get resolved through a Prompt Generator, not fed in from a separate INT socket; this node is for cases where the target genuinely accepts an integer input directly, like a batch count, a step count, or a seed for another node.

    Range is inclusive on both ends, so a min_value of 0 and max_value of 10 can produce either 0 or 10, not just the values strictly between them - worth checking if you're relying on an exclusive upper bound somewhere downstream (a list index, for instance) and don't want to risk an off-by-one from an unexpectedly maxed-out draw. And because this node ships bundled inside a prompt-crafting pack rather than a general math pack, it's easy to overlook entirely when you're hunting for a lightweight multi-output random-integer node - if you already have Adaptive Prompts installed for its wildcard nodes, you don't need anything else for this.

    CategoryMath

    Inputs (3)

    NameTypeDefaultDescription
    min_valueINT0
    max_valueINT10
    seedINT00–18446744073709550000

    Outputs (4)

    NameTypeDescription
    value1INT
    value2INT
    value3INT
    value4INT