Batch Selector
Pick one prompt batch out of five
- batch_1
- batch_2
- batch_3
- batch_4
- batch_5
- string_batch
If you've ever had five prompt variants sitting in separate String Batch nodes and wished you could just flip a switch to pick which one feeds the sampler - this is that switch. BatchSelector takes up to five STRING_BATCH inputs and passes exactly one through, chosen by a single select integer. It's a multiplexer for text, and it exists so you can build "presets" into your graph instead of editing prompt widgets by hand.
It comes from the String Batch category of the Mickmumpitz pack, which also ships the StringBatch producer, a StringSelector for pulling single entries out of a batch, and PromptStitcher for gluing style onto prompts. This node is the routing piece of that family.
How it works
select- an INT,1through5, choosing which input to output.batch_1…batch_5- the optional STRING_BATCH inputs. Wire only the ones you use.
The output, string_batch, is just the chosen input passed through unchanged - no reordering, no deduping, no editing. If the selected input is unwired, it returns a single empty string rather than erroring, which keeps the graph alive but can quietly feed an empty prompt downstream if you forget to wire something. That's the one real gotcha.
Where it fits
Drive select from a seed, a slider, a math expression, or even the same boolean-driving nodes that power an output switch. Typical patterns:
- Variant A/B/C testing - three style prompts, one knob.
- Character presets - a batch of prompts per character, selected by story beat.
- Batch orchestration - multiple String Batch sources feeding one sampler path.
It pairs naturally with the pack's PromptStitcher: load base prompts as batches, stitch a style on, then use BatchSelector to route the final list.
Installing it
Part of Mickmumpitz-Nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/mickmumpitz/ComfyUI-Mickmumpitz-Nodes.git
or ComfyUI Manager → search "Mickmumpitz" → install → restart. Nothing heavy; the pack runs on numpy, Pillow and opencv-python.
Troubleshooting
- Empty prompt downstream - the selected input isn't wired.
selectpicks a slot, not "the one that has data." selectout of range - the widget limits 1-5, but if you drive it from elsewhere, an out-of-range value selects an unwired slot and you get the empty string. Clamp it if you're computing it.- "Why no multi-select?" - not this node's job. It routes one batch; if you want a mix, you want the pack's other string utilities or a concat, not a selector.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| select | INT | 11–5 | — |
| batch_1opt | STRING_BATCH | — | |
| batch_2opt | STRING_BATCH | — | |
| batch_3opt | STRING_BATCH | — | |
| batch_4opt | STRING_BATCH | — | |
| batch_5opt | STRING_BATCH | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| string_batch | STRING_BATCH | — |