Nodes/ComfyUI-JDCN/LogicUtil_Manual Choice Int
ComfyUI Node

LogicUtil_Manual Choice Int

Step through integer presets run after run

By daxcay·Created 2 years ago·Updated about a year ago· 159
LogicUtil_Manual Choice Int
    • INT
    input_string1$2$3
    separator$
    index0

    Some things you only ever want set to one of a few integers: 20$24$32 for steps, 7$8$9 for CFG, 64$128$256 for a tile size. LogicUtil_Manual Choice Int turns that list into a single node where an index input decides which value comes out - the integer sibling of the pack's Manual Choice Float.

    How it works

    Inputs are the same shape: input_string holds your list as one line (default 1$2$3), separator splits it (default $), and index selects the element, 0-based with a default of 0. The output is an INT, cast from the chosen string. Wire index to a counter and you get a preset stepper that walks your list one value per run - ideal for batch or animation workflows where each frame or each item wants the next setting.

    The code is a single choices[index] wrapped in int(), so the failure modes are the same family as its float sibling, and they're worth listing because they're the difference between "this is fine" and a dead queue:

    • No bounds check on index. Pick index 5 in a 3-item list and you get an IndexError. No wrap, no clamp, no mercy.
    • Everything must parse as an int. Drop a 2.5 or a four into the list and int() throws at queue time.
    • Whitespace matters. "1$ 2$3" has a leading space on 2 and int(" 2") actually works in Python, but don't tempt fate - keep the list tight.

    The genuinely nice part is how it composes. Because index is an input rather than a frozen widget, you can drive this node from anything that produces an integer - a seed-derived value, a counter, another gate. That's the whole point of the LogicUtil family, which is a port of aria1th's ComfyUI-LogicUtils riding inside the JDCN pack. Don't expect the JDCN README to help you here: it documents the file and latent batch nodes and never mentions this family.

    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. And when you hit a queue error that screams IndexError, count your $ separators before you blame the node.

    CategoryLogicUtil

    Inputs (3)

    NameTypeDefaultDescription
    input_stringSTRING1$2$3
    separatorSTRING$
    indexINT00–9999999999

    Outputs (1)

    NameTypeDescription
    INTINT