Random List Selector
Roll the dice on your prompt styles
- input_list
- selected_items
- count
- first_item
You've got a list of styles - "cinematic", "watercolor", "anime", "photoreal" - and you want the workflow to grab one at random each run, but the same one next time for the same seed. Random List Selector is exactly that: pick random items from a list, reproducibly. It's the poor man's wildcard system, and for a lot of workflows it's all you need.
It ships in DebugPadawan's ComfyUI Essentials, a pure-Python utility pack. The selection logic is random.Random(seed).choice() / .sample() - nothing exotic, nothing requiring models.
How it works
Four required inputs:
input_list- the LIST to draw fromseed- the reproducibility key (INT, default 0)count- how many items to pick (INT, default 1)allow_duplicates- whether the same item can be picked more than once (BOOLEAN, default False)
Three outputs:
selected_items- the LIST of what got pickedcount- how many were actually selectedfirst_item- a convenience output: the first selected item (orNoneif the list was empty), handy when you only want one
The behavior differences are worth knowing. With allow_duplicates on, it does count independent picks with replacement - you can get repeats. With it off (the default), it samples without replacement, and it silently caps the request: asking for 5 items from a 3-item list gives you 3. Empty input list? You get ([], 0, None) - no crash, just nothing.
Where you'll use it
- Random prompt styles. Feed a list of style strings (build it with the pack's
List CreateorText Splitter) and pipefirst_iteminto a prompt orText Joiner. - Random seeds, colors, tags. Any list of options you want to cycle through randomly but reproducibly.
- Variation batches. Pick 3 styles from 10 and iterate a batch - seed controls everything, so the same seed reproduces the same picks.
Installing it
Whole pack, one install. ComfyUI Manager, searching for "DebugPadawans-ComfyUI-Essentials," or:
cd ComfyUI/custom_nodes
git clone https://github.com/DebugPadawan/DebugPadawans-ComfyUI-Essentials
Then restart ComfyUI. Requirements (numpy, torch, opencv-python) are already present in stock ComfyUI; no model downloads. Search carefully: this is DebugPadawan's ComfyUI Essentials, not cubiq's "ComfyUI Essentials" (a different pack, now in maintenance mode).
Gotchas
allow_duplicatesoff silently caps the count. If you set count to 10 on a 5-item list, you get 5 back and thecountoutput tells you so - but it won't error. If selections seem short, that's why.first_itemis type*(any). It's whatever was in the list - string, int, list. Wire it accordingly.input_listmust already be a LIST type; if you're getting a comma-separated STRING, split it first (Text Splitterin this pack).- Small pack, little community footprint - for a node this deterministic the source is the doc.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| input_list | LIST | — | |
| seed | INT | 00–18446744073709550000 | — |
| count | INT | 1 | — |
| allow_duplicates | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| selected_items | LIST | — |
| count | INT | — |
| first_item | * | — |