List To PyList
Collect a running ComfyUI List back into one value
- ANY
- PYLIST
At some point in a List-processing pipeline you usually want to stop running per-item and treat everything that came out as one collected array - count how many results you got, feed them all into Exec at once, or just hold them as a single value instead of ten separate parallel executions. List To PyList is the exit ramp: it takes a ComfyUI List and collapses it into one PYLIST value.
How it works
Connect any ComfyUI List-processing input and the node gathers every item into a single raw Python list, output as one PYLIST value. This is the inverse of PyList To List (the pack's other conversion node), and between the two of them you can freely move back and forth between "run once per item" mode and "one bundled array" mode wherever your graph needs it.
Where this actually matters: List processing in ComfyUI is implicit and can be surprising once you have more than one List floating around a graph - nodes that touch multiple Lists run once per combination unless you're careful, which is a classic footgun for anyone new to it. Collecting a List into a PyList with this node is a clean way to "pin" a result - get everything that List produced, hold it as one value, and stop it from interacting with List-processing rules further downstream.
The inputs and outputs that matter
ANY- the ComfyUI List-processing input to collect. Accepts any type; whatever the List was carrying, it gets gathered into the resulting array.
One output: PYLIST, the entire input List collected as one Python list value, in the same order the items came in. From there it behaves like any other PyList in the pack - index it, slice it, merge it, count it, or hand it to Exec.
How to install it
Search "ComfyUI-List-Utils" in ComfyUI Manager and install, or clone by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/godmt/ComfyUI-List-Utils.git
Restart ComfyUI. No models, nothing heavy - this node in particular is just "gather everything into a list," which is close to free computationally.
Common issues & troubleshooting
Downstream nodes stopped running per-item after adding this. That's exactly what it's supposed to do - this node is a deliberate stopping point for List processing. If you still need per-item execution after this point in the graph, you've collected too early; move this node further downstream, or reconsider whether you need it at all for that branch.
Order of items looks scrambled. It shouldn't be - items are collected in the order ComfyUI's List processing produces them, which normally matches the order they entered the List. If order genuinely looks wrong, check further upstream where the List was originally built (a Merge List, for instance, concatenates in connection order, which is easy to get backwards if you wired inputs in a different order than you intended).
Wired a PYLIST into this node and it won't connect. This node's input wants a ComfyUI List, not a PYLIST - if you already have a PyList, there's nothing to collect, it's already one value. This node is specifically for converting the other direction.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| ANY | * | ComfyUI List-processing input to collect into one Python list value. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| PYLIST | PYLIST | The whole input List collected as one Python list value. |