convert to Data List
The bridge from Python sets to ComfyUI's per-item processing
- set
- *
convert to Data List takes a SET - a Python set travelling as a single variable - and turns it into a ComfyUI data list, which is the native list type where each item gets processed individually by the nodes downstream. It's the bridge between the pack's SET world and the rest of ComfyUI.
This is the node you'll hit constantly if you use sets, because sets are great for building unique pools and useless for feeding them to nodes that expect individual items. Want to run each tag in a set through a text node, or each value through a per-item operation? You can't wire a SET into those directly - ComfyUI won't expand it. Convert to Data List first, and every element becomes its own item the downstream node processes in turn.
The README for this pack draws the line you'll keep hitting: data list = items processed individually; LIST = Python list as a single variable; SET = unique, unordered, single variable. This node is the "SET → data list" leg of that triangle.
How it works
The mechanism is a thin one: list(set) - iterate the set and emit each element as an item. The output is marked OUTPUT_IS_LIST = (True,) in the source, which is ComfyUI's signal that this output is a genuine data list rather than a single value. Downstream nodes that accept lists will fan out across the items.
One consequence of that mechanism is unavoidable: the order is arbitrary. Sets are unordered, so the data list you get reflects the set's internal ordering, not your insertion order. If the processing order matters, sort after converting.
Inputs and output
set(SET) - the set to convert.- A data list (output,
*type) - each set element as an individual list item, ready for per-item processing.
Installing
It's part of Basic data handling by StableLlama. ComfyUI Manager - search "Basic data handling", install, restart - is the easy way. Manual install:
cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
Restart ComfyUI after either route. No dependencies, no models - this pack installs in seconds and won't fight your other extensions.
Common issues
The big misunderstanding is expecting this to preserve order - it can't, because the set it starts from is unordered. If order matters, convert the set to a LIST and sort it first (using the pack's sort node), then fan out from there. And remember this converts unique items: duplicates already collapsed when the set was built, so don't expect the data list to contain repeats.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| set | SET | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | * | — |