Nodes/ComfyUI-JDCN/LogicUtil_Manual Choice String
ComfyUI Node

LogicUtil_Manual Choice String

A cheap dropdown for anything ComfyUI won't give you one for

By daxcay·Created 2 years ago·Updated about a year ago· 159
LogicUtil_Manual Choice String
    • STRING
    input_stringa$b$c
    separator$
    index0

    ComfyUI has no native "pick one of these options" control for arbitrary text. There's the combo-input trick some nodes expose, but for a plain list of strings you're usually stuck typing. LogicUtil_Manual Choice String is the stopgap: one line of text, a separator, an index, and out pops exactly one string. It's the string member of the Manual Choice trio, and it's the one I'd install the pack for on its own.

    How it works

    Same three inputs as the Int and Float variants: input_string (default a$b$c), separator (default $), and index (default 0, 0-based). Output is a STRING. The code is literally input_string.split(separator)[index] - no cast, no validation, so what goes in the list is what comes out, character for character.

    That lack of validation is both the feature and the trap. Since there's no int() or float() in the middle, this is the safest of the three when you feed it arbitrary text - but index is still unbounded, and an out-of-range index throws an IndexError at queue time. Count your separators. And empty entries count: a$$b splits to ['a', '', 'b'], so a double separator gives you an empty string as a legitimate choice, which is almost never what you meant.

    The killer use case is prompt variations. Put a handful of style suffixes or subject modifiers in the list, drive index from a counter or seed, and you get deterministic variation run to run - change the index, change the prompt. It also composes cleanly with LogicUtil_Merge String to build a full prompt out of picked pieces, and with the Random Shuffle nodes if you'd rather scramble the list. That's the whole point of the LogicUtil family, a port of aria1th's ComfyUI-LogicUtils riding inside the JDCN pack - a grab-bag utility pack from Daxton Caylor and Jerry Davos whose README only bothers documenting the file and latent batch nodes.

    Install

    Install is the standard JDCN routine: ComfyUI Manager → "Install Custom Node" → search JDCN → install → restart, or:

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

    Only piexif on the requirements list, no models to fetch. If a downloaded workflow references this node and Manager can't find the pack, install JDCN first and reload - the missing-node error resolves as soon as the pack lands.

    CategoryLogicUtil

    Inputs (3)

    NameTypeDefaultDescription
    input_stringSTRINGa$b$c
    separatorSTRING$
    indexINT00–9999999999

    Outputs (1)

    NameTypeDescription
    STRINGSTRING