append
Append — build a list one item at a time without mutating anything
- list
- item
- LIST
append does exactly one thing: take a LIST, stick one new item on the end, hand you back a new LIST. It's the "add to collection" primitive you use when you're assembling a list incrementally - collecting seeds, filenames, prompts, or conditions one at a time as a workflow runs.
How it works
Under the hood it's the same list.append() every Python programmer knows, with one ComfyUI-critical twist:
result = list.copy()
result.append(item)
return (result,)
The input list is copied first, and the new list is what comes out. The original is never touched. That matters in ComfyUI because one node's output can feed several branches - if append mutated its input in place, you'd get "which branch saw the item" races and workflow poisoning. Here, each call produces a fresh list, so fan-out is safe.
The item input accepts any type (* in the schema), so you can append a number, a string, a boolean, even a whole nested list or dict. The output is a single LIST you can feed into the next append for another round.
The trap: append vs extend
This is the classic beginner foot-gun, and it's worth spelling out. append adds its item as a single element. If you append a list, you get a nested list:
append([1, 2], 3)→[1, 2, 3]append([1, 2], [3, 4])→[1, 2, [3, 4]]- note the brackets!
If you meant to merge the contents of two lists, that's the extend node in the same pack, and it's the one you want. Also: because the trailing input slot on the pack's dynamic create LIST nodes gets dropped, append is often the cleaner way to add a final element once you already have a list built.
Where you'd use it
- Building a collection in a loop-style workflow, where each iteration appends the result of the last step.
- Gathering items for a batch: append each frame's filename, then pass the finished LIST to something that consumes the whole set at once.
- Gradual condition collection, then collapse with
alloranywhen the list is complete.
Installing
It's part of the "Basic data handling" pack by StableLlama. ComfyUI Manager: search "Basic data handling", install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
Restart. No extra dependencies, no models - the pack is pure Python with zero declared dependencies, so the install is quick and clean.
Gotchas worth knowing
- It appends one item. For merging two lists, use
extend. - The original list is preserved - if you see unexpected duplicates, check whether you're feeding an already-extended list back in rather than the original.
- Remember this operates on the pack's LIST type (a single Python list variable), not a native ComfyUI data list where each item gets processed individually. Different tool for a different job.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| list | LIST | — | |
| item | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LIST | LIST | — |