List Slice
Pull a contiguous chunk out of any ComfyUI list
- list_items
- list_items
The simplest node in the pack, and one of the most quietly useful. List Slice extracts a contiguous chunk from any list-valued input and hands you the slice, item type unchanged. That's it. But in ComfyUI's world of list-valued sockets - especially STRING lists - "take items 2 through 5 of this list" is something you'll want constantly and that vanilla ComfyUI makes you write a custom node for.
Where does this actually come up? The classic case is prompt permutation. The mustache nodes in this pack (Mustache Template → Mustache Variable Sampler) emit a list of rendered prompts; hook that into CLIP Text Encode and ComfyUI runs the sampler once per prompt. Sometimes you don't want all 50 - you want the first batch of 10 to test the waters, or you want to skip the first few because they're known-bad. Slice before the encode and you save the sampler runs. Same trick works on any list-valued socket: model lists, image lists, text lists.
The inputs
list_items- the list to slice. Works on any list-valued type, and non-list inputs are copied through unchanged (handy: you can wire this into a workflow without breaking it if the upstream stops emitting a list).start_index(default 1) - 1-based starting item. This is the footgun: ComfyUI is zero-indexed in most places, and this node is not.start_index=1means the first item.length(default 1) - how many items to include from the start index.
The output list_items is the same type as the input. Values past the list end clamp/truncate rather than erroring, and an empty list input yields an empty list - both behaviors are the forgiving kind, which is nice for the gluing-together phase of a workflow.
Installing and using it
Part of Skoogeer-Noise. Install via ComfyUI Manager (search "Skoogeer-Noise") or:
cd ComfyUI/custom_nodes
git clone https://github.com/ttulttul/Skoogeer-Noise
Restart ComfyUI. No models, no keys; deps are torch, numpy, einops, pyyaml - all already present.
Common issues
If your slice comes back one item off, you've hit the 1-based indexing. start_index=1, length=1 returns the first item; to grab items 3 through 6 you want start_index=3, length=4. That's the whole failure surface, really. A tip: because length defaults to 1, people often slice accidentally when they only meant to preview - if you connect the output and suddenly you're rendering one item instead of many, check that length is set to what you think. The pack's sibling list nodes (Reorder List for seeded shuffles, Concatenate Lists for appending) are the other two-thirds of this little list toolkit, and Join Text List is what you want when you need to actually see a multi-item STRING list in a preview node.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| list_items | * | List-valued input to slice. Non-list inputs are copied through unchanged. | |
| start_index | INT | 11–2147483647 | 1-based starting item to include. Values past the list end clamp to the last item. |
| length | INT | 11–2147483647 | Maximum number of items to include from the start index. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| list_items | * | — |