Nodes/ComfyUI-JDCN/LogicUtil_String List to Combo
ComfyUI Node

LogicUtil_String List to Combo

Turn a $-separated text blob into one picked item — useful, despite the name

By daxcay·Created 2 years ago·Updated about a year ago· 159
LogicUtil_String List to Combo
    • *
    string
    separator$
    index0

    LogicUtil_String List to Combo is a small data-plumbing node from the LogicUtil subpack of ComfyUI-JDCN, and its name is a bit of a lie. Despite the word "Combo," it doesn't give you a dropdown - it splits a text string on a separator and hands back whichever element you point at. It's a picker, not a UI widget, and understanding that distinction is the whole trick to using it.

    What it actually does

    You give it a string like portrait$landscape$closeup, a separator (default $), and an index (default 0). It splits the string on the separator and returns the element at that index - so index=0 gives portrait. The wildcard * output means the result plugs straight into prompt concatenation, a CLIP encoder, or whatever else eats text.

    The edge cases are where the implementation shows its personality:

    • If index is past the end of the list, it returns the last element instead of erroring. Graceful, but easy to misread - index=9 on a 3-item list silently gives you item 3.
    • If the separator isn't in the string at all (or is empty), it returns the whole string untouched.
    • If you feed it a number, float, or bool, it passes the value through as-is rather than trying to split it.

    So really it's three behaviors in one: pass-through for non-strings, split-and-pick for lists, and a "return the tail" fallback for out-of-range indices.

    Why you'd use it

    Its natural home is next to the pack's random and iterator nodes. LogicUtil_Uniform Random Choice picks a random item from a $-separated list; this node picks a deterministic item by index. Chain them or swap between them and you get the classic pattern: a text blob containing your prompt variants, selected either randomly (seeded, so reproducible) or by a counter that walks through them one per run. It's also handy for pulling a specific option out of a packed string that some upstream node produced - parsing, essentially, without writing a regex.

    Honestly, if all you ever need is "pick item 0 from a list," a plain Static String does the job. This node earns its place when the index comes from somewhere dynamic - an iterator, a random int, a UI value - so the graph can navigate a list it didn't have to hardcode.

    Installing it

    It's part of ComfyUI-JDCN, so one install covers it. ComfyUI Manager: Install Custom Nodes → search "JDCN", install, restart. Or:

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

    Only dependency is piexif; no models. It's a small two-person hobbyist pack (Daxton Caylor and Jerry Davos), and nodes like this one are why people install it and forget it's there - unglamorous, type-tolerant, and quietly useful when you're juggling lists of prompts. Just remember the out-of-range behavior, and you'll never be surprised by which item comes out.

    CategoryLogicUtil

    Inputs (3)

    NameTypeDefaultDescription
    stringSTRING
    separatorSTRING$
    indexoptINT0

    Outputs (1)

    NameTypeDescription
    **