Nodes/Kyusu Nodes/πŸ”€ Text Input Switch (8 way)
ComfyUI Node

πŸ”€ Text Input Switch (8 way)

Route Strings With an Integer

By TaIIo4KuHΒ·Created 4 months agoΒ·Updated 4 months agoΒ· 0
πŸ”€ Text Input Switch (8 way)
    • STRING
    β—„Input1β–Ί
    β—„text1β€”β–Ί
    β—„text2β€”β–Ί
    β—„text3β€”β–Ί
    β—„text4β€”β–Ί
    β—„text5β€”β–Ί
    β—„text6β€”β–Ί
    β—„text7β€”β–Ί
    β—„text8β€”β–Ί

    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 on text2, flip Input and 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 - optional STRING inputs (wired in, not typed).
    • STRING output - 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.

    CategoryKyusu/logic

    Inputs (9)

    NameTypeDefaultDescription
    InputINT11–8β€”
    text1optSTRINGβ€”
    text2optSTRINGβ€”
    text3optSTRINGβ€”
    text4optSTRINGβ€”
    text5optSTRINGβ€”
    text6optSTRINGβ€”
    text7optSTRINGβ€”
    text8optSTRINGβ€”

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGβ€”