Nodes/comfyui-AGSoft/AGSoft Text Input Switch X2
ComfyUI Node

AGSoft Text Input Switch X2

Flip between two prompts with one integer — the A/B tester's switch

By Art-xmaster·Created 12 months ago·Updated a day ago· 23
AGSoft Text Input Switch X2
    • STRING
    text1
    text2
    input_selector1

    The cleanest A/B test in ComfyUI is two prompts, one switch, and a 1/2 flip. AGSoft Text Input Switch X2 is exactly that: two multiline text fields and an integer selector. Set input_selector to 1 and text1 flows out; set it to 2 and text2 does. Nothing else happens - which is precisely why it's reliable.

    How it works

    Three inputs, one output:

    • text1, text2 - your two options. Both multiline, both accept incoming wires (so a prompt node can feed either slot).
    • input_selector - an INT, 1–2, default 1. The whole interface.

    The output is the chosen string (STRING). Because the selector is a plain integer rather than a dropdown, it can be driven by other nodes - a counter, a loop, an integer from a workflow control - which is what turns it from a manual toggle into a real A/B switcher that cycles between two prompts per batch item.

    Why this over a typed switch or Switch Any

    For text-only routing, this fixed X2 is the tidy option. The pack's AGSoft_Switch_any handles any data type but exposes a 30-entry dropdown; the fixed text switch is a compact 1/2 knob that's instantly readable in a shared workflow. And compared to hand-wiring conditionals, an integer-indexed switch is simpler to reason about: selector 1 → text1, selector 2 → text2, no off-by-one anywhere.

    Installing

    cd ComfyUI/custom_nodes
    git clone https://github.com/Art-xmaster/comfyui-AGSoft
    

    Restart ComfyUI, or ComfyUI Manager → "comfyui-AGSoft". No models, no extra dependencies.

    The gotcha is selector clamping: input_selector is bounded 1–2, so there's no "0 = disabled" or "3 = both." If you're feeding it from an unbounded loop that emits 0, you'll get the minimum (text1) rather than nothing - usually fine, but worth knowing when you wire up automation. And remember the empty-string case: switch to an empty text2 and the output is an empty string, passed through faithfully. It won't silently fall back to text1.

    CategoryAGSoft/Text

    Inputs (3)

    NameTypeDefaultDescription
    text1STRINGThe first text option. Первый текстовый вариант.
    text2STRINGThe second text option. Второй текстовый вариант.
    input_selectorINT11–2Select which input text to output (1 or 2). Выберите, какой входной текст выводить (1 или 2).

    Outputs (1)

    NameTypeDescription
    STRINGSTRING