π List to Batch
Turn separately-run items into one bundle
- List
- Batch
ComfyUI has a batch/list distinction that confuses everyone once, and this node exists to navigate it. "π List to Batch" takes a value that arrives as a Python list and hands back the same list marked as a single batch. One input, one output, no transformation - the entire value of the node is what the socket types mean.
The trick is in the node's declaration. It sets INPUT_IS_LIST = True, which tells ComfyUI: "when anything feeds into this List socket, give me all the values at once, as a Python list." The node then returns that list unchanged as Batch. So the node converts "items that would have been processed one at a time" into "everything in one bundle, all at once."
The README puts it better than I can:
"Convert a list (Items are executed separately when put into another node) to a batch (Items are all given at once, but the node needs to support it.)"
Why you'd want the other flavor
ComfyUI fans some values out automatically. Feed a list into certain sockets and the engine runs the downstream graph once per item - that's the list behavior, and it's great for "generate one image per prompt." But sometimes you don't want fan-out. You want the whole list in one place so you can:
- Read/write individual items with the π Generic operation nodes (
f[s]to pull item 3 out, the write variant to change it) - much easier when you hold the list whole. - Hand it to a script - the π Execute Python node expects to receive a real list and process it however it likes.
- Batch-processing nodes - nodes that actually support batch semantics get the full list in one call instead of N separate calls.
The sibling node, π Batch to List (Unmerge batch (any)), does the reverse with OUTPUT_IS_LIST = True: it emits the items so the engine processes them separately. Create batch on one end, List to Batch, process, Batch to List back out - that's the loop.
The catch
Because the node does zero validation - it literally return (List,) - the "batch" it emits is only useful to nodes that accept a list-shaped value. A stock node expecting a single IMAGE will choke on a Python list. The README is upfront: the batch is "all given at once, but the node needs to support it." If a downstream node errors with a list-type complaint, it doesn't support batch semantics, and you need to unmerge first.
Install
Part of the FlowNodes pack:
cd ComfyUI/custom_nodes
git clone https://github.com/gitmylo/FlowNodes
# restart ComfyUI
or ComfyUI Manager β search FlowNodes β install. No Python dependencies, no models.
Troubleshooting
- Output is a list when you expected single items - that's exactly what this node does. If you wanted fan-out, use the Batch to List node instead.
- Downstream node errors on the batch - it doesn't accept a Python list. Unmerge it, or feed it to a script/operation node that does.
- An item seems "lost" - the node is a pure pass-through, so any loss happened upstream (e.g. a Create batch that skipped an unwired slot).
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| List | * | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Batch | * | β |