Smart Selector 🎯
Pool, selector, freeze, and file loading
- selected
- item_count
Smart Selector is the pack's everything-node: it folds the Item Pool, the random picker, and the freeze/lock into one graph object, and adds two things the separate nodes don't have - a sequential mode and the ability to read its items from a file. If the freeze-workflow idea from the pack's other selectors appeals to you but you don't want to manage three connected nodes per prompt slot, this is the one to reach for.
How it works
The mode dropdown picks between random and sequential. In random mode it behaves like Random Selector: draw count items from the pool, join with commas, emit. In sequential mode it walks the list in order, starting at the index widget and stepping forward count items per run, wrapping around when wrap is on. Sequential is the mode for batch or animation work - frame 0 gets item 0, frame 1 gets item 1, and so on.
The genuinely neat part is the index auto-increment. After each sequential run, the node pushes a new index back to its own widget, so you don't have to touch anything between queue items - it just steps. Same trick the display widget uses for showing your current selection: the pack's JS extension syncs these widget values back to the UI after every execution.
Freezing works exactly like the rest of the pack: check frozen, and the node stops generating and re-emits whatever sits in display. That value persists in the workflow JSON, so a locked selection survives reloads.
The inputs that matter
mode-randomorsequential. The JS extension hides the irrelevant widgets for you:allow_duplicatesdisappears in sequential mode,index/wrapdisappear in random mode. Nice touch.use_file/file_path/items- flipuse_fileon anditemsis hidden, replaced byfile_path. The file is re-read on every execution, so you can edit a plain text file outside ComfyUI (add a line, save, re-run) without touching the workflow. It tolerates both#and//comments and blank lines.count- items per run.frozen- the lock. Your best friend.index/wrap- only in sequential mode. Start position and whether to loop back to the top when you hit the end.
It outputs selected (the comma-joined string, ready for a prompt node) and item_count (the pool size as an INT, handy if you ever want to show or log it).
Gotchas
No seed input here either - the source rolls unseeded and un-frozen runs are forced to re-execute via IS_CHANGED returning NaN. Reproducibility means freezing, not seeding. And if a file load fails, the node doesn't crash - it outputs the error text as your "selection" (e.g. [File not found: ...]), which can silently poison your prompt if you don't notice it. Worth knowing before you wonder why your prompt suddenly contains a file path.
How to install
Same story as the rest of the pack - zero pip dependencies, zero model downloads. It's pure stdlib and ComfyUI's own SaveImage:
cd ComfyUI/custom_nodes
git clone https://github.com/Ckrest/comfyui-easy-randomize.git
Restart ComfyUI, or install "comfyui-easy-randomize" from ComfyUI Manager. The node registers under Local Custom/Selection (the README's "Easy Randomize" category is out of date).
The honest verdict
For a one-node prompt slot that can also step through a list for batch work, Smart Selector is the pack's best value - you get random, sequential, freeze, and live file editing without juggling three nodes. The trade-off is that everything is in one big panel, which gets visually crowded. If you'd rather keep pools separate and reusable across a workflow, the Item Pool + Random Selector combo is cleaner. But for "I just want this one slot to pick from a file and freeze," this is the node.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| use_file | BOOLEAN | false | — |
| items | STRING | item1 item2 item3 | — |
| file_path | STRING | — | |
| mode | COMBO | 2 options: random, sequential | |
| count | INT | 11–100 | — |
| allow_duplicates | BOOLEAN | false | — |
| index | INT | 00–10000 | — |
| wrap | BOOLEAN | true | — |
| frozen | BOOLEAN | false | — |
| display | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| selected | STRING | — |
| item_count | INT | — |