ComfyUI Node

AQ_Random

A random number that ignores its input — and that's fine

By 2frames·Created about a year ago·Updated 6 months ago· 1
AQ_Random
    • INT
    initial0

    AQ_Random is the smallest node in the whole AQnodes pack and it does exactly one thing: spit out a random integer whenever it runs. That's it. You drop it in when you want a fresh seed without thinking, or when you want each queue run to roll different dice - a seed here, a value for a variation node there. It's the node you reach for because wiring a seed through a KSampler by hand is annoying, and this is a zero-config way to get variety.

    The thing to know up front: the initial input is a lie. Look at the source and it's just

    randNumber = random.randint(0, 0xffffffffffffffff)
    

    The initial INT field you see in the node (default 0) is accepted and then completely ignored. It's not a seed, it doesn't bound the range, it doesn't do anything. If you were hoping to feed it a value and get a "random but starting from X" number, that's not what this is. Set it to whatever and move on.

    What you get

    The output is a single INT, and it can be a big one - the range is 0 to 2^64−1, which is about 18.4 quintillion. That's comfortably bigger than anything ComfyUI's seed inputs accept (those usually cap at 2^53 or so), so you can run this into a KSampler's seed without worrying about overflow. Every execution draws a fresh value from random.randint, which means:

    • Run the workflow twice and you get two different numbers.
    • ComfyUI re-runs the node when something upstream changes, so the value will shuffle on you mid-tinkering.
    • There's no memory of what it produced last run. If you need reproducibility - same seed every time, or "remember what I generated" - grab a seed node that persists state instead. AQ_Random is deliberately forgetful, and that's the feature.

    The one thing to set

    Inputs: just initial (INT, default 0, min 0). As covered, it does nothing. The output INT wires into any seed input - KSampler, empty latents, anything that takes a seed.

    Installing it

    AQnodes is a small, clearly-personal collection (this pack has essentially no community footprint - you're unlikely to find tutorials for it, so the source is your doc). Install the pack, not the node:

    cd ComfyUI/custom_nodes
    git clone https://github.com/2frames/ComfyUI-AQnodes
    

    then restart ComfyUI. Or use ComfyUI Manager and search for "AQnodes". Note the pack's README still shows git clone https://github.com/yourusername/ComfyUI-AQnodes.git - that's a template they never updated, so use the real URL above. The pack's requirements.txt is heavy (transformers, insightface, segment-anything, onnxruntime-gpu…) but none of that matters for this node - AQ_Random only needs the Python standard library. If pip chokes on the big deps, this node will keep working regardless.

    Troubleshooting

    There's basically one way this node confuses people: you set initial to a value, expect it to matter, and it doesn't. That's not a bug - it's just dead weight in the input schema. Use it as a seed source for variation, don't use it when you need a repeatable value, and you'll have no trouble with it at all.

    CategoryAQ/numbers

    Inputs (1)

    NameTypeDefaultDescription
    initialINT0

    Outputs (1)

    NameTypeDescription
    INTINT