Nodes/comfy-ovum/List Splice
ComfyUI Node

List Splice

Splice a list in place (JavaScript Array.prototype.splice semantics). Behavior: - start (optional): - If empty/unspecified -> 0. - If negative -> n + start, clamped to [0, n]. - If positive -> clamped to [0, n]. - delete_count (optional): - If empty/unspecified -> n - start (delete to end). - If negative -> 0. - Otherwise -> clamped to [0, n - start]. - insert_list (optional): - If empty/unspecified -> inserts nothing. - If a list -> its items are inserted. - If a single non-list value -> inserted as one element. Returns: - [0]: the mutated original list reference after splicing. - [1]: a new list of removed elements. Notes: - Matches JavaScript splice behavior including negative indices and optional parameters.

By sfinktah·Created 12 months ago·Updated 9 months ago· 6
List Splice
  • py_list
  • insert_list
  • *
  • *
start
delete_count
Categoryovum/lists/any

Inputs (4)

NameTypeDefaultDescription
py_list*
startSTRINGOptional start index as integer string. Blank/whitespace -> 0. Negative -> n+start (clamped).
delete_countSTRINGOptional number of elements to delete as integer string. Blank/whitespace -> delete to end. Negative -> 0. Clamped to [0, n-start].
insert_list*Optional list of items to insert at start. Blank -> insert nothing.

Outputs (2)

NameTypeDescription
**
**