ComfyUI Node

String To Combo

The tiny node that unlocks combo widgets

By wenchengxiang·Created about a month ago·Updated a day ago· 1
String To Combo
    • any
    text

    String To Combo exists to solve one of ComfyUI's most annoying interface quirks: dropdown widgets. Half the loaders you care about - LoRA loader model names, checkpoint pickers, upscaler selectors - present their options as a combo box, and combo boxes can't be driven by a normal text wire. You have to click the dropdown by hand. This node is the workaround: it takes a STRING, splits it on commas, and outputs the first item as a wildcard any type, which is exactly the type combo widgets accept. A wire that normally won't plug in now plugs in.

    The practical payoff: you can store "the LoRA I want this run" in a text box, a prompt book, or a CSV row, and let this node feed the LoRA loader's lora_name dropdown at runtime. That unlocks batch workflows where a list of names drives a loader per pass - the "one text source, many runs" pattern - and it's how people wire preset systems into loaders that the authors never expected to be scriptable. It's a tiny piece of plumbing with an outsized effect, because it converts the most manual widget in ComfyUI into a data-driven input.

    Two honesty notes before you get excited. First, it takes only the first comma-separated item - the source is explicit that this deliberately matches the original behavior so downstream nodes read a single clean string, not a list. If your text is lora1.safetensors, lora2.safetensors, you get lora1.safetensors and nothing else. Second, it prints the result to the console on every run ([StringToCombo Output]: ...), which is genuinely useful for debugging and mildly annoying once you're past debugging.

    How it works

    One input, one output. text is a STRING (force-input, so it must come from a wire). The node splits on commas and returns the first non-empty item as a plain string - the wildcard output type is what makes the connection to a combo socket legal, but the payload is always a str. Wire it to any loader or selector's combo input and that dropdown now follows your text.

    A note on whitespace: lora1.safetensors, lora2.safetensors splits to lora1.safetensors and lora2.safetensors (leading space) - the first item is unaffected, but if you later use the comma-split elsewhere, trim your inputs.

    How to install it

    Part of ComfyUI-Practical-Tools by wenchengxiang. ComfyUI Manager → search ComfyUI-Practical-Tools → install → restart, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/wenchengxiang/ComfyUI-Practical-Tools
    

    No dependencies beyond the standard library.

    Common issues

    • "I wired it and the loader ignores it." Make sure the target widget is actually a combo/dropdown socket and that you're connecting to the input socket, not typing into the widget. Combo inputs accept any; plain text widgets don't need this node at all.
    • Only the first item is used. If you expected a comma-separated list to flow through as multiple values, it won't. This is single-item by design.
    • Console spam. The debug print is a feature for troubleshooting; if your log scrolls and you don't care, that's expected behavior, not an error.
    CategoryPractical-Tools/utils

    Inputs (1)

    NameTypeDefaultDescription
    textSTRING

    Outputs (1)

    NameTypeDescription
    any*