Nodes/ComfyUI-JakeUpgrade/Text Input Switch JK๐Ÿ‰
ComfyUI Node

Text Input Switch JK๐Ÿ‰

The JK Text Input Switch that routes your prompts

By jakechaiยทCreated 2 years agoยทUpdated 3 months agoยท 147
Text Input Switch JK๐Ÿ‰
    • string_output
    • boolean
    โ—„boolean_valuefalseโ–บ
    โ—„text_falseโ–บ
    โ—„text_trueโ–บ

    The whole JK switch family does one unglamorous thing: take a boolean and two inputs of the same type, and pass through the one the boolean points at. Text Input Switch JK is the version for strings, and it's quietly the most useful of the bunch because text is what you're usually toggling - prompts, filenames, tags, the random vs. curated version of a negative. It saves you the classic ComfyUI maneuver of building two parallel branches and manually bypassing one when you want the other.

    This is one of a dozen typed switches in JakeUpgrade (Image, Int, VAE, TriMesh, ControlNet Stack and so on). They exist because every workflow eventually needs a route - you're A/B testing prompts, you want an "empty" fallback string, or you're building a group node that lets the user pick between two options without rewiring. Instead of reaching for Impact Pack's generic Switch(Any), a typed switch keeps the wires honest: it can only ever carry what it says.

    How it works: dead simple under the hood. boolean_value decides, text_false is returned when false, and text_true (optional) when true. Two outputs come out: string_output and boolean, so you can chain the condition downstream without a separate node. That second output is the sleeper feature - wire it into a second switch and you've got a mini routing tree.

    What you actually set:

    • boolean_value - your condition. Usually fed from a Bool node, a comparison, or an exposed group-node toggle.
    • text_true / text_false - the two candidate strings. Defaults are empty, so wire at least one.

    Install. It ships in ComfyUI-JakeUpgrade (Jake's pack - a huge, actively maintained workflow-and-nodes bundle that runs his Wan video, img2mesh and imgen workflows). ComfyUI Manager โ†’ search "JakeUpgrade" and install, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jakechai/ComfyUI-JakeUpgrade
    cd ComfyUI-JakeUpgrade
    pip install -r requirements.txt
    

    Windows portable build: run install.bat or ../../../python_embeded/python.exe -s -m pip install -r requirements.txt. Restart ComfyUI. The utility nodes have light dependencies (opencv, piexif, simpleeval, PyYAML, toml) - no model downloads.

    Gotchas: if you load a shared JakeUpgrade workflow and see this node flagged as missing, check the pack's config.ini - deprecated nodes are hidden unless LOAD_DEPRECATED_NODES = True. (These switches aren't deprecated themselves, but the flag trips people up constantly.) Also note the README's warning that ComfyUI MultiGPU can cause CUDA errors with the latest ComfyUI - disable it if your setup goes sideways. And remember: if text_true is left unconnected, the node always returns text_false, which trips up more than a few people. Connect both sides or you'll wonder why flipping the boolean does nothing.

    Category๐Ÿ‰ JK/๐Ÿ”€ Switch

    Inputs (3)

    NameTypeDefaultDescription
    boolean_valueBOOLEANfalseCondition to select between inputs (True=text_true, False=text_false)
    text_falseSTRINGText value to return when condition is False
    text_trueoptSTRINGText value to return when condition is True (optional)

    Outputs (2)

    NameTypeDescription
    string_outputSTRINGโ€”
    booleanBOOLEANโ€”