π Text Input Switch (8 way)
Route Strings With an Integer
- STRING
You know the workflow: three positive prompts, three negative prompts, and you spend half your session pasting one into the encoder and another back out. Text Input Switch (8 way) is the routing valve for strings - it takes up to eight text inputs, and an Input integer (1β8) decides which one comes out the other side as a single STRING. Same skeleton as the pack's model and CLIP switches, and the source credits Comfyroll's CR Input Switch as the design ancestor.
Mechanically it's one line: texts[Input - 1]. One-indexed, no processing, no trimming - the exact string you wired in is the exact string that comes out. That's the whole job, and it's the right job. Where it earns its place is keeping a handful of prompt variants in one workflow so you can flip between them without touching a text box or a wire.
What you'd actually use it for
- Prompt A/B testing - style A on
text1, style B ontext2, flipInputand rerun. Same seed, same sampler, clean comparison. - Multi-style workflows - one KSampler branch, but the positive prompt changes by region or character, routed in from separate prompt-builder nodes.
- Paired with Cycle Int (1-8) - queue with batch count 8 and it steps through every variant automatically. This is probably the intended setup, given the pack ships both.
One behavior to know up front: the text inputs are declared with forceInput, so you can't type a value straight into the switch's socket. You must wire strings in from somewhere - a text box node, a Prompt Appender, a wildcard processor, whatever produces the text. If you wire nothing, the output is None, and the encoder downstream will complain. Keep the selector on slots you actually connected.
Inputs and output
Input- the selector. INT, 1β8, default 1.text1β¦text8- optionalSTRINGinputs (wired in, not typed).STRINGoutput - goes into a CLIP Text Encode, prompt merger, or any string consumer.
Category: Kyusu/logic.
Install
No dependencies, no models, pure Python. ComfyUI Manager β search "Kyusu Nodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/TaIIo4KuH/kyusu-nodes
Restart ComfyUI.
The trap worth remembering
Same as its siblings: this is a strict manual router. Point it at an empty slot and you get None, not a fallback to slot 1. And all eight upstream producers still run every time - ComfyUI executes every connected input, it doesn't skip the ones the switch doesn't select. For strings that's nearly free, so the practical advice is just: keep the selector inside the slots you filled, and don't expect it to act as a "first non-empty wins" switch - that's rgthree's Any Switch's job.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| Input | INT | 11β8 | β |
| text1opt | STRING | β | |
| text2opt | STRING | β | |
| text3opt | STRING | β | |
| text4opt | STRING | β | |
| text5opt | STRING | β | |
| text6opt | STRING | β | |
| text7opt | STRING | β | |
| text8opt | STRING | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | β |