Batch Splice Ovum
Cut items out of a list and insert new ones in the same move
- py_list
- insert_list
- *
- *
Slice gives you a chunk out of a list; splice changes the list. This node is JavaScript's Array.prototype.splice in ComfyUI form: you pick a start position, say how many items to delete, optionally insert new items at that spot, and you get back both the modified list and the stuff you removed. It's the node you reach for when a list needs surgery - remove a bad seed from a batch, swap a subset of prompts, interleave a new item into the middle of a sequence.
It's the same family as the pack's Batch Slice and Batch Extend, and it shares their philosophy: JavaScript-style indexing (negative counts from the end) and bounds clamping instead of exceptions. The two outputs are what make it genuinely useful - one for the new list, one for the removed elements, so you can route the "outtakes" somewhere if you care about them.
The inputs
- py_list (*) - the target list.
- start (STRING) - where the splice begins. Negative counts from the end; blank means 0. Clamped.
- delete_count (STRING) - how many items to remove. Blank means "delete everything from start to the end." Negatives are treated as 0. Clamped to the list length.
- insert_list (*) - the items to insert at the splice point. Leave it empty for pure deletion.
Outputs are both lists:
- list (*) - the modified list (the same instance after splicing - this node does mutate its input).
- removed_elements (*) - what was deleted, so you can log or keep it.
A couple of recipes
start=0, delete_count=1, insert_list=[X]→ replace the first item with X.start=-1, delete_count=0, insert_list=[X]→ insert X before the last item.start=2, delete_count=2(no insert) → remove items 2 and 3.
The honest warning
Unlike the pack's slice and extend nodes, this one mutates the input list in place. In a graph that caches and re-evaluates, in-place mutation can leak between runs in ways that are hard to debug. The source even ships a companion "uncachable list copy" node in the same pack for exactly this reason. If you're feeding a list from a shared source, make a copy upstream before you splice, or you'll be chasing "why is my list different on the second run" later.
Installing it
Part of comfy-ovum:
cd ComfyUI/custom_nodes
git clone https://github.com/sfinktah/comfy-ovum
Restart, or ComfyUI Manager → "comfy-ovum". No models, no heavy deps.
Gotchas
Beyond the mutation gotcha, the start and delete_count fields are string-typed like the pack's other slice nodes - keep them clean integers or blank. And note the distinction from List Splice in the pack's ovum/lists/python group: this one operates at the list/batch level with the JS semantics; the python-flavored one does the same thing with different list-awareness. Use whichever matches the type of the list you're feeding it.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| py_list | * | — | |
| start | STRING | — | |
| delete_count | STRING | — | |
| insert_list | * | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| * | * | — |
| * | * | — |