Nodes/FlowNodes/πŸ“ƒ Create batch
ComfyUI Node

πŸ“ƒ Create batch

Gather up to 20 values into one list

By gitmyloΒ·Created 2 years agoΒ·Updated about a year agoΒ· 13
πŸ“ƒ Create batch
  • no_cache
  • input0
  • input1
  • input2
  • input3
  • input4
  • input5
  • input6
  • input7
  • input8
  • input9
  • input10
  • input11
  • input12
  • input13
  • input14
  • input15
  • input16
  • input17
  • input18
  • input19
  • Batch

Some workflows need to hand a bunch of values to one node at once - a list of prompts to iterate over, a pile of numbers to sum, several strings to pass into a script. ComfyUI's default instinct is to keep everything on separate wires. "πŸ“ƒ Create batch" is the node that gathers them: connect up to twenty inputs (input0 through input19) and it returns them as a single Python list in order.

The output is named Batch, which is mildly confusing, so let's be precise about what you get: a Python list, built by list(...values()), with unconnected slots skipped. The list is what comes out the *-typed Batch socket.

The batch vs list thing

FlowNodes' own README draws a distinction that trips everyone up: a list (each item is executed separately when it feeds into another node) versus a batch (everything is handed over at once, and the receiving node has to support it). In practice:

  • This node (and the ✏️ Create-empty-object family) produce actual Python lists.
  • The πŸ“ƒ List to Batch and πŸ“ƒ Batch to List nodes convert between the "items run separately" and "all at once" flavors.
  • The 🐍 Execute Python and πŸ“– Generic operation nodes consume real lists happily.

So: gather with Create batch, then either process the list whole with a script/operation node, or unmerge it into separate items with the batch/list converters. That last pattern is the README's headline use: "reading/writing individual batch items using operation nodes, or giving it as an input for a script node."

Why no_cache is there

Create batch has a required no_cache input, same dummy widget as the other FlowNodes function nodes - it produces a random value every run so this node and everything downstream re-executes. The README calls this out specifically: "Uses no-cache, so it won't lead to unexpected results with caching." The failure it prevents is the classic cache trap: you change one of the inputs, but the list node doesn't rerun because ComfyUI thinks nothing it cares about changed. With no_cache, the list is rebuilt every run. Don't touch that socket, just leave it alone.

The write-operation pattern

This is the intended pairing and the thing most people miss: create the list, then modify it with πŸ“– Generic operation (write) nodes - f.append(s), f[s] = t - using flow wires to guarantee the writes happen in order. A list built once and mutated by subsequent writes is how you accumulate results across a loop. The README is explicit: use flow, and merge flow after the last operation.

Install

FlowNodes pack, standard install:

cd ComfyUI/custom_nodes
git clone https://github.com/gitmylo/FlowNodes
# restart ComfyUI

or ComfyUI Manager β†’ search FlowNodes β†’ install. No Python dependencies, no model downloads.

Troubleshooting

  • The list is in the wrong order - the order is by input index (input0 first). Rewire to the right sockets; there's no sorting.
  • A value went missing - unconnected inputs are skipped by design. If you expected 5 items and got 3, two sockets are empty.
  • Output feels "stale" - that's the caching problem no_cache is meant to solve; confirm the node version you have actually renders the no_cache socket (older installs may not show it).
  • Feeding the list into a normal node errors - most stock nodes don't accept a raw list. Go through πŸ“ƒ List to Batch / Unmerge, or into a script node that expects a list.
CategoryπŸ”‚ FlowNodes/convert

Inputs (21)

NameTypeDefaultDescription
no_cacheNO_CACHEβ€”
input0opt*β€”
input1opt*β€”
input2opt*β€”
input3opt*β€”
input4opt*β€”
input5opt*β€”
input6opt*β€”
input7opt*β€”
input8opt*β€”
input9opt*β€”
input10opt*β€”
input11opt*β€”
input12opt*β€”
input13opt*β€”
input14opt*β€”
input15opt*β€”
input16opt*β€”
input17opt*β€”
input18opt*β€”
input19opt*β€”

Outputs (1)

NameTypeDescription
Batch*β€”