Random/Select INT
One integer generator to drive every index in your workflow
- index
Half of ComfyUI automation boils down to "give me a number that changes each run." Random/Select INT is the AUN node that does exactly that - a single INT output with four modes for how the number changes: Select (fixed), Increment (cycle through a range), Random (random within a range), and Range (cycle through a custom list like 1,2,5-8,12). It's the utility that makes everything else in the pack move, and the README's own example workflow is built around it.
The four modes
- Select - outputs the fixed
selectvalue. Useful when you want a manual number that's easy to find, or when a value needs to be switchable by editing one widget. - Increment - cycles from
minimumtomaximum, wrapping around. Each run advances by one. This is the "generate one of each" mode for batch exploration. - Random - a random integer between
minimumandmaximum, inclusive. The workhorse for seed variation and shuffling. - Range - cycles through a comma-separated list of indices or ranges, e.g.
1,2,5-8,12. This is the mode the others can't fake - "skip the bad ones" becomes one string.
The single output is index (INT), and that's it. The simplicity is the feature: it has no opinions about what you're indexing, so it composes with everything.
How you'll actually use it
The canonical pattern (from the pack's own docs): AUN Random/Select INT → AUN Text Index Switch → CLIP Text Encode. Set the range to match the number of text inputs on the switch, pick Random or Increment, and you've got rotating prompts. The same index can be split to drive AUN Negative Prompt Selector (which_negative), a Multi Bypass Index (Index), a LoRA loader's slot, or AUN Prompt Cycler - anything that takes an INT. One number, half your workflow orchestrated.
Pairing tips: when driving a 20-slot selector, set maximum to the actual number of slots you configured, not 20 - otherwise you'll roll empty slots and get nothing. And remember Random in a batch re-rolls per image, which is usually what you want for seed variety but occasionally a surprise when you expected the same pick across a batch.
Install
It ships in AUN ComfyUI Nodes (loz2754):
cd ComfyUI/custom_nodes
git clone https://github.com/loz2754/AUN-ComfyUI-Nodes
or install "AUN ComfyUI Nodes" from ComfyUI Manager, then restart. Pack deps (piexif, opencv-python-headless, imageio-ffmpeg, requests) come via Manager or pip install -r custom_nodes/AUN-ComfyUI-Nodes/requirements.txt; no model downloads.
Why this over a bare random node?
A plain Random Number gives you a random integer; this gives you modes, a defined range, and the Range-list option in one place, so you can switch between "fixed seed for this test" and "random every run" without rewiring anything. It's the upgrade path when your workflows start needing reproducible, switchable index generation.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| minimum | INT | 00–100000 | The minimum value for random number generation (inclusive). |
| maximum | INT | 11–100000 | The maximum value for random number generation (inclusive). |
| mode | COMBO | Random | Select mode: Select for fixed index, Increment for cycling through range, Random for random index within range, Range for selecting from a list of indices. |
| range | STRING | 1,2,5-8,12 | A comma-separated list of indices or ranges to select from in 'Range' mode (e.g. 1, 2, 5-8, 12). |
| select | INT | 11–100000 | The integer value to output when in 'Select' mode. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| index | INT | — |