Nodes/ComfyUI-ProtoTeller/Conditional Text Switch
ComfyUI Node

Conditional Text Switch

A two-text switch keyed to your card's parity

By DoctorDiffusion·Created 5 months ago·Updated 5 months ago· 1
Conditional Text Switch
    • STRING
    text_odd
    text_even
    number0

    The job

    Conditional Text Switch picks between two strings based on the parity of a number. Odd → text_odd. Even → text_even. That's it - the whole node is an if statement with text on both branches, sitting under the "Conditional Text Switch" name in the ProtoTeller category.

    Why it exists

    Same family, same trick as its siblings in this pack: a tarot draw lands either upright or reversed, and the two readings are genuinely different texts. ConditionalTextConcat builds one string and conditionally appends a tail; this node is for when the branches are whole, different strings. Keep the full upright and reversed readings as separate strings, switch between them on the draw's parity, and you never have to assemble or split anything.

    Inputs and output

    • text_odd - returned when number is odd.
    • text_even - returned when number is even.
    • number - INT, 0–100.
    • Output: one STRING, whichever branch won.

    The one thing to keep straight

    The polarity doesn't line up across the pack, and it's worth noticing: ConditionalImageRotate flips on even, ConditionalTextConcat appends on even, and this node returns text_odd on odd. There's no "invert" flag. If you wire one number into all three and get a card whose flipped title and switched text disagree, check which field you dropped the reading into - the parity convention is the author's, not the universe's.

    Wiring it

    STRING out → into your LLM prompt builder or the text input of PreviewTextImage. Feed number from the same source as the other conditionals so a single draw drives the image flip, the text switch, and the concat in lockstep. Swap the two inputs to invert the behavior without touching the number.

    Install

    Same as the rest of the pack: ComfyUI Manager → search "ProtoTeller", or

    cd ComfyUI/custom_nodes
    git clone https://github.com/DoctorDiffusion/ComfyUI-ProtoTeller
    

    then restart. No models, no extra dependencies - like the rest of the conditional utilities in this pack, it runs on core Python with nothing downloaded.

    CategoryProtoTeller

    Inputs (3)

    NameTypeDefaultDescription
    text_oddSTRING
    text_evenSTRING
    numberINT00–100

    Outputs (1)

    NameTypeDescription
    STRINGSTRING