Nodes/ComfyLab Pack/List: from String (lab)
ComfyUI Node

List: from String (lab)

Turn a comma-separated string into a list the XY Plot will eat

By bugltd·Created 2 years ago·Updated about a year ago· 11
List: from String (lab)
    • list
    • count
    string
    separator,
    convertdisabled

    Every XY Plot workflow starts the same way: you've got a handful of values - three CFG settings, five seeds - and you need them as a list to feed into the Queue node's dim1 or dim2. List: from String (lab) is the fastest way to get there: you type 7.5, 8, 8.5 into a widget, and out comes a LIST you can wire straight into the plot.

    How it works

    The mechanics are honestly just Python's split(). You give it a string, it splits on separator (default ,), and it trims whitespace around each value so 7.5,8,8.5 and 7.5 , 8 , 8.5 behave the same. Then the convert dropdown decides what each element becomes:

    • disabled - you get strings back, exactly as typed.
    • integer / float - casts each value.
    • boolean - accepts the usual suspects: true/false, yes/no, on/off, 0/1. It also treats the literal string none as Python None, which is handy for "no value" slots.

    Two outputs come out: list (the LIST) and count (an INT, how many values you ended up with).

    The inputs that matter

    Only three, and you'll touch all of them:

    • string - the raw text to split. It's a single-line widget; don't paste a 50-line block in here, that's what the multiline list nodes are for.
    • separator - default ,. It's a literal string, not a regex, so , or | both work. If your values contain the separator, you're going to have a bad time.
    • convert - the one that bites people. See below.

    Where people get burned

    The classic failure is forgetting convert. The Queue node passes values through untouched - "what you send is what you get," as the pack's own docs put it. Wire a list of strings into a KSampler's cfg and you'll get a type error the moment it runs. If your values are meant to be numbers, set convert to integer or float and test the count output before you queue.

    The other trap is integer conversion on something like 7.5 - int() raises, and the node goes red. If your list might mix whole and fractional values, pick float and let KSampler handle it.

    Install and context

    It's part of ComfyLab Pack, so install once and the whole family (list nodes, queues, XY plot) comes along. ComfyUI Manager → search ComfyLab Pack, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/bugltd/ComfyLab-Pack.git
    cd ComfyLab-Pack
    pip install -r requirements.txt
    

    No model downloads, and the dependencies are light apart from opencv-python. Restart ComfyUI after installing. For a more structured list source - one value per line in a real file you edit outside ComfyUI - check the pack's List: from File (lab) instead.

    CategoryComfyLab/list

    Inputs (3)

    NameTypeDefaultDescription
    stringSTRINGsingle string to be splitted by separator
    separatorSTRING,element seperator (spaces surrounding values will be trimmed)
    convertCOMBOdisabledconvert each value to int, float or boolean for booleans, values like true/false, yes/no, on/off, 0/1... are accepted.

    Outputs (2)

    NameTypeDescription
    listLISTlist of values, splitted using the separator, optionally converted
    countINTnumber of values