EmAySee Integer String Selector
Pick one of four strings with a slider — your prompt-switcher
- SELECTED_STRING
Four prompts, one slider, zero rewiring
The boring-but-frequent ComfyUI problem: you have a few variations of a prompt (or a negative, or a set of LoRA trigger phrases) and you want to flip between them without digging into a text box every time. EmAySee_IntegerStringSelectorNode is a four-slot version of exactly that - type your four strings, pick a number from 1 to 4, and the matching string comes out the other end.
It's a tiny utility from the EmAySee pack, but tiny is fine when the alternative is building the same thing out of three ConditioningCombine-style hacks. Where it earns its keep is when the index isn't coming from your hand - hook select_index up to a seed, a random int, or a previous workflow stage and you get automated A/B/C/D prompt rotation for batch runs. Combined with a Var Text Replacer-style fill-in, it's a crude but effective poor-man's wildcard.
How it works
The mechanism is about as simple as it gets: an if/elif chain checks which index is selected and returns that input's string. There's a failsafe branch that returns an empty string if the index somehow lands outside 1–4 - which shouldn't happen since the widget constrains the slider, but it won't crash your workflow if it ever does.
The inputs that matter
string_input_1…string_input_4- your four candidate strings. Plain text fields.select_index(INT, 1–4) - the picker. A slider in the UI, but it's a regular input, so another node can drive it.
Output: SELECTED_STRING - the one string the index points at. Feed it into a text encode, a filename, or any STRING input downstream.
Install
Part of ComfyUI_EmAySee_CustomNodes:
cd ComfyUI/custom_nodes
git clone https://github.com/EmAySee/ComfyUI_EmAySee_CustomNodes
# restart ComfyUI
Or find it in ComfyUI Manager under "ComfyUI_EmAySee_CustomNodes". No extra dependencies - this pack has no requirements.txt, so it runs on what ComfyUI already ships. You'll see the pack's SPECTRE ASCII banner in the console at startup; ignore it.
Gotchas
Two things worth knowing. First, the four slots are required inputs, so the node always wants all four strings filled even if you only use two - fill the rest with a blank or a copy. Second, there's a sibling node, EmAySee_IntegerStringSelectorNodeDynamic, that does the same trick with 20 slots; this four-slot version exists because you don't always want 20 text boxes cluttering your graph. If you only ever need a handful of choices, this one is the cleaner pick. The name "Dynamic" on its big sibling is a bit of a misnomer, by the way - both take fixed text fields, not runtime-wired values.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| string_input_1 | STRING | Input String 1 | — |
| string_input_2 | STRING | Input String 2 | — |
| string_input_3 | STRING | Input String 3 | — |
| string_input_4 | STRING | Input String 4 | — |
| select_index | INT | 11–4 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| SELECTED_STRING | STRING | — |