Slice List
Python slicing, exposed as a node — start, end, done
- list
- LIST
Slice List is the trim tool of kenjiqq's pack: give it a LIST and two integers, get back a sub-list. It's the kind of node that feels pointless until the day you need it, and then it's exactly the thing you needed - no Python scripting, no workarounds, just list[start:end] exposed as a node.
It exists because the pack's whole job is handing lists around - to XY Grid Helper, to Any List Iterator, to axis packing - and real lists need pruning. You don't want to regenerate a 200-line prompt file just because you want to test rows 3–10.
How it works
- list - the input LIST.
- start - an INT, default 0. Where the slice begins.
- end - an INT, default 1. Where the slice stops.
- LIST - the output,
list[start:end].
The behavior is exactly Python slicing, which comes with two rules that surprise people:
endis exclusive. A slice of0to10gives you 10 items (indices 0–9), not 11. Off-by-one confusion here is the classic bug.- Negative indices work.
start = -3withend = 0grabs the last three items. And out-of-range values don't error - Python just clamps to the edges, soend = 9999on a short list silently gives you everything.
Where you'll actually use it
- Splitting a big grid sweep. Have 50 prompts in a file but only want to run 5? Slice the LIST feeding
row_listand queue a 5-row grid instead of re-editing the file. - Batching. With the pack's
page_sizeon XY Grid Helper already handling grid splitting, Slice List is more useful when you're feeding Any List Iterator - slice the list to whatever window you want to step through. - Quick subsets. "Test every other value" is two slices and a compare, not an edit.
The honest version
This is a utility node, and it has no hidden depths - which is its charm. There's no state, no reset button, nothing to forget. If you know how Python slicing works, you know this node; if you don't, the two rules above are the whole manual.
Installing it
Part of qq-nodes-comfyui, no pip requirements:
cd ComfyUI/custom_nodes
git clone https://github.com/kenjiqq/qq-nodes-comfyui
Restart, or install qq-nodes-comfyui via ComfyUI Manager. You'll find it under QQNodes/List, right next to Any List and Any List Iterator - the family resemblance is clear.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| list | LIST | — | |
| start | INT | 0 | — |
| end | INT | 1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LIST | LIST | — |