Nodes/AUN ComfyUI Nodes/Random Number
ComfyUI Node

Random Number

The plainest random integer you'll ever wire up

By loz2754·Created 8 months ago·Updated about 17 hours ago· 5
Random Number
    • INT
    minimum0
    maximum1

    Random Number is the AUN pack at its most minimal: two inputs, one output, no modes, no state. You give it a minimum and a maximum, it hands you a random integer in that range (both ends inclusive). That's the whole node. If that sounds too boring to deserve a page, you've never needed a random seed in a workflow without wanting to bolt on ten more features.

    What it's for

    Seed variation, mostly. ComfyUI's own KSampler wants a seed value, and wiring a random integer into it (or into a Seed node that remembers it) is the standard way to explore. This node also feeds anything that takes an INT - an index, a CFG value you want to jitter, a controlnet strength you want to fuzz for A/B exploration. Because it's a pure function with no state, it composes cleanly: one INT out, wire it anywhere an INT is expected.

    The catch, honestly stated: there's no seed input and no mode. You can't reproduce a specific roll (change your ComfyUI queue seed, not this node), and you can't tell it to cycle instead of randomize. For those, the same pack's AUN Random/Select INT is the grown-up version - it adds Select, Increment, and Range modes plus a fixed select value, all in one node. Random Number is the "I just want a die roll" option; Random/Select INT is "I want to switch between roll/cycle/fixed."

    The two inputs

    • minimum (INT) - inclusive lower bound.
    • maximum (INT) - inclusive upper bound.

    Output: INT (INT). Yes, the output is literally named INT. It's not a typo, it's just that straightforward.

    A real setup

    Wire INT into a Seed-style node or directly into a sampler's seed input, set minimum to 1 and maximum to 2147483647 for full-range seeds, and every run gets a fresh one. Want the same seed back after a lucky result? ComfyUI keeps the executed value in the UI, so you can read it off the queue or the seed node that recorded it. That workflow - randomize, find a good one, note the seed - is the entire reason nodes like this exist.

    Install

    Part of AUN ComfyUI Nodes (loz2754):

    cd ComfyUI/custom_nodes
    git clone https://github.com/loz2754/AUN-ComfyUI-Nodes
    

    or ComfyUI Manager → search "AUN ComfyUI Nodes" → install → restart. Pack deps (piexif, opencv-python-headless, imageio-ffmpeg, requests) install via Manager; nothing to download manually.

    There's a genuine case for a node this dumb: it has zero failure modes and zero learning curve. When you just need a random integer and don't want to think about it, that's a feature.

    CategoryAUN Nodes/Utility

    Inputs (2)

    NameTypeDefaultDescription
    minimumINT00–100000Minimum value for random number generation (inclusive).
    maximumINT11–100000Maximum value for random number generation (inclusive).

    Outputs (1)

    NameTypeDescription
    INTINT