ComfyUI Node

Prompt Switch (20)

Twenty prompt slots — and when that's not overkill

By itom0717·Created 6 months ago·Updated 6 months ago· 0
Prompt Switch (20)
    • selected_text
    id1
    text_01
    text_02
    text_03
    text_04
    text_05
    text_06
    text_07
    text_08
    text_09
    text_10
    text_11
    text_12
    text_13
    text_14
    text_15
    text_16
    text_17
    text_18
    text_19
    text_20

    The same node as the Prompt Switch (10), just wider. Prompt Switch (20) takes an id between 1 and 20 and passes through the matching text_01text_20 input, out as selected_text. Same mechanism, same two-digit labels (text_02, not text_2), same behavior where an unconnected pin outputs an empty string instead of erroring, same ,\n appended to the output so it chains into an aggregator.

    When is twenty inputs not ridiculous?

    A couple of honest use cases exist. A catalog workflow where prompts come from somewhere else - generated, loaded from files, or swept per image in a batch - and you want one graph that covers the whole set, picked by number. Or a character/outfit matrix where "which of twenty variants" genuinely changes per run. Those are real.

    But if you're hand-wiring twenty individual strings into the graph, ask whether twenty is the problem. At that point the pack's file-based selectors (the nodes that read data/character/*.txt into a dropdown) are a better home for the text than twenty spaghetti wires - that's literally what the pack was built for, and it's why the README frames everything around text files, not graph inputs.

    The inputs and outputs

    From the schema: id is required, INT, default 1, min 1, max 20. text_01text_20 are optional STRINGs with forceInput, so they want upstream connections. Output is selected_text (STRING). Nothing else - it's a dumb pipe, and that's a feature.

    The practical downside

    The silent out-of-range failure gets worse as the range grows. id = 21 from an upstream node looks for text_21, finds nothing, and quietly returns an empty string - no error, no red highlight. With twenty pins on one node, the canvas footprint is also real; expect the thing to be large. And because id is a static INT input, there's no auto-advance: if you want to cycle or randomize, you supply the integer source yourself (the pack's ID Select node, or any INT node you have around).

    Install

    Identical to the rest of the pack - no dependencies, no models, MIT:

    cd ComfyUI/custom_nodes
    git clone https://github.com/itom0717/ComfyUI-Prompt-String-Selector
    

    Restart ComfyUI, or install via ComfyUI Manager → Install via Git URL.

    The verdict

    The (5) or (10) is what 95% of people want. Reach for the 20 when you have a real library behind it, not as a default - and if you do, keep your prompt text in files rather than in the node, so the graph stays readable.

    CategoryPrompt String Selector

    Inputs (21)

    NameTypeDefaultDescription
    idINT11–20
    text_01optSTRING
    text_02optSTRING
    text_03optSTRING
    text_04optSTRING
    text_05optSTRING
    text_06optSTRING
    text_07optSTRING
    text_08optSTRING
    text_09optSTRING
    text_10optSTRING
    text_11optSTRING
    text_12optSTRING
    text_13optSTRING
    text_14optSTRING
    text_15optSTRING
    text_16optSTRING
    text_17optSTRING
    text_18optSTRING
    text_19optSTRING
    text_20optSTRING

    Outputs (1)

    NameTypeDescription
    selected_textSTRING