List Remove
Pull Items Out of a ComfyUI List and Get Them Back, Too
- list
- list
- removed
- count
The flip side of the pack's List Insert: where that one slides items in, List Remove slides them out - and unlike most "remove" nodes, it hands you what it removed. That matters more than it sounds. If you're chopping frames or prompts out of a collected list and then want to do something with the discarded ones (preview them, save them, feed them somewhere else), having removed as an output is the difference between a workflow and a dead end.
What it takes
list(optional) - the list to remove from. Works on a ComfyUI list of any type.index- where to start removing, 0-based. Negative counts from the end, so-1starts at the last item.count- how many items to remove, starting atindex.
Outputs: list (the remainder), removed (the items you took out), and count (the new length). Because it's a generic list node, the removed items come back as a list too - a multi-item removal gives you a multi-item list on removed, ready to iterate.
When you'd use it
The natural companion to List Insert and the pack's For Each / List Output collection machinery. A few shapes that come up constantly:
- Trim a collected batch. You ran a sweep, collected N prompts or images, and want to drop the first two or the last one before the comparison grid.
List Removeatindexwith the rightcountdoes it without touching the collection loop. - Split a list in two. Remove
countitems, wire the remainder down one path andremoveddown another. Two lists out of one, positionally. - Filter the tail. Negative indices make "drop the last 3 of a batch of unknown length" a one-node operation - no need to know the length.
One rule from the pack to keep in mind: for same-size IMAGE batches, use Image Batch Remove instead - it works frame-wise on the [B,H,W,C] tensor and returns both the batch remainder and the removed frames. The generic ListRemove is for mixed-type lists where items aren't uniform images.
Install
Part of the Kinburg-Nodes pack - ComfyUI Manager (search "Kinburg-Nodes"), or cd ComfyUI/custom_nodes && git clone https://github.com/Kinburg/Kinburg-Nodes, restart. No dependencies. It's a small utility, but "remove with a receipt" is genuinely rarer than it should be in this ecosystem - most remove operations just drop data into the void. This one gives it back to you.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| index | INT | 0-100000–100000 | 0-based item to start removing at. Negative counts from the end (-1 = last item). |
| count | INT | 10–100000 | How many items to remove, starting at 'index'. |
| listopt | * | The list to remove item(s) from. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| list | * | — |
| removed | * | — |
| count | INT | — |