Nodes/Basic data handling/create Data List from BOOLEANs
ComfyUI Node

create Data List from BOOLEANs

Build a BOOLEAN list from toggles — feed a mask without touching Python

By StableLlama·Created about a year ago·Updated 4 days ago· 48
create Data List from BOOLEANs
    • list
    item_0

    Boolean lists are the masks of the ComfyUI world - the filter data that decides which items get kept, which branch of an if/else fires per-element, which toggles are on. create Data List from BOOLEANs is how you build one by hand: a row of checkboxes that becomes a data list of true/false values.

    It's part of Basic data handling, StableLlama's zero-dependency utility pack, and it's the boolean-flavored sibling of the pack's generic and typed list builders (INT, FLOAT, STRING versions all exist).

    How it works

    Same dynamic-input pattern as the other create-list nodes: you start with item_0, a BOOLEAN toggle, and right-click to add item_1, item_2, and so on. Each widget you add becomes one element of the output list. The values are coerced through bool(), so anything truthy lands as True - though since the inputs are already boolean toggles, that's mostly a formality.

    Output list is a BOOLEAN data list: connect it to a node that consumes booleans per item and ComfyUI will run that node once per element. That's exactly what you want when feeding a filter or a per-item selection.

    What you set

    • item_0 (BOOLEAN, optional) - the first toggle; add more as needed.

    One output: list, the assembled data list of booleans.

    A realistic use

    Hand-built boolean lists are the manual version of a mask. If you have five items and want to keep items 1, 3, and 5, set toggles True, False, True, False, True and feed the result into the pack's filter select node alongside your value list - it'll split out exactly the true-marked and false-marked subsets. It's the low-tech, fully-visible way to gate a batch, no logic nodes required.

    Installing it

    ComfyUI Manager → search "Basic data handling", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
    

    Restart. No dependencies, no models.

    Common issues

    • "The list has an extra empty entry." The dynamic container reserves a slot; if a widget is left blank it coerces to False. Fill or remove the inputs you aren't using so the mask lines up with your value list.
    • "My mask is misaligned." Boolean masks are position-sensitive - the toggle order must match the order of the value list you're filtering. Count your toggles against your items.
    • "I want a computed mask, not a manual one." This node is for hand-set toggles. If the booleans should be derived from your data, build the list from a comparison or logic node instead.
    CategoryBasic/Data List

    Inputs (1)

    NameTypeDefaultDescription
    item_0optBOOLEAN

    Outputs (1)

    NameTypeDescription
    listBOOLEAN