ComfyUI Node

Pipe Get List

The list half of the pipe, and why it can't cross wires with the scalar half

By tom-m-2020·Created about a month ago·Updated 7 days ago· 1
Pipe Get List
  • pipe
  • items
◄keyitems►

Every context bus in ComfyUI eventually runs into the list problem. A pipe is a tidy way to carry a model, a latent, a prompt and a seed down one wire - but a list of images is a different kind of value, and mixing the two inside one container is how you get a node that works until the third item. This pack's answer is to keep two namespaces inside the pipe: scalar fields and list fields. Pipe Get List reads a list field.

Inputs and output

  • pipe - a UTILITY_ANY_PIPE, required.
  • key - STRING, default "items". The name the list was stored under by Pipe Set List.
  • Output: items, marked as a list output. That matters - what comes out is a genuine Comfy list, not an IMAGE/MASK tensor batch and not a single tensor that happens to be stacked. Downstream nodes that iterate a list will iterate it; nodes that want a batch won't take it.

Because the output is any-type and list-flagged, the graph has no idea what's inside. The pipe stores items without inspecting them, which is why you can carry masks in one slot and strings in another.

The two strict failures

KeyError: ... has no field 'items' - nothing was stored under that name. Same story as Pipe Get Any: a typo, or a setter that never ran because its branch was bypassed.

TypeError: field 'value' is scalar; use Pipe Get Any. - you asked for a list from a key that holds a scalar. The namespaces are genuinely separate; a scalar stored as "anything" and a list stored as "anything" are different fields, and the node will refuse rather than coerce a scalar into a one-item list.

That refusal is deliberate and worth appreciating. The forgiving version - wrap the scalar in a list and move on - would make the two most common mistakes in this layer (reading the wrong namespace, reading a value from the wrong point in the graph) completely silent.

There's also a small immutability detail you'll only notice if you go looking: lists are handed back as a fresh copy, so a downstream node editing the list does not reach back into the pipe and change what other readers see. It's the same design decision as the frozen pipe object - you get isolated snapshots, not shared mutable state.

When you need it

Three uses, in descending order of how often they come up:

  1. Carrying a batch of things as items. Masks, images, prompts - anything you want to process one at a time. This is the difference that matters for ComfyUI: a batch goes through one sampler as one job, a list goes through a list node as N jobs. The plumbing doc's framing is the one to keep: batches are things that run together, lists are things that run one at a time.
  2. Getting the list back out for a selector. Pair it with a range picker like Mask From List, or with the pack's accumulator nodes, when you're building results up across iterations.
  3. Keeping the schema explicit. Two namespaces force you to say whether a field holds one thing or many, which is information an untyped dict-style pipe usually loses.

Install

Manager: search ComfyUI Utility Suite (publisher tom-m) → install → restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/tom-m-2020/ComfyUI-Utility-Suite

Nothing to download. The pack's only listed dependency is opencv-python-headless. It's built on ComfyUI's newer V3 node API - the custom pipe socket type comes from there - so if you install it and no Utility Suite/* categories appear, your ComfyUI is too old rather than the pack being broken.

Troubleshooting

"is scalar; use Pipe Get Any." Wrong accessor for what was stored. The widget default is "items", and so is Pipe Set List's - check you didn't accidentally name a scalar field items.

My node says it wants a batch and I'm handing it a list. Different types. Convert first (the pack has Image List To Image Batch for exactly this) rather than wondering why nothing runs.

Order is wrong. Lists come back in the order they were stored, and the pipe doesn't sort anything. Ordering is the job of whatever built the list.

CategoryUtility Suite/Pipe

Inputs (2)

NameTypeDefaultDescription
pipeUTILITY_ANY_PIPE—
keySTRINGitems—

Outputs (1)

NameTypeDescription
items*—