🎈List-Image-Splitter
Pull specific frames out of an image batch by index
- images
- images
Ever decode a video to a batch of frames and need only 3 of the 48? That's this node. ImageListSplitter takes an IMAGE input - a batched tensor or a list - and a comma-separated index string, and returns the frames you asked for as a list. It's the "slice by explicit indices" tool, and it fills the gap ComfyUI's built-in batching leaves: there's no core node that just says "give me items 0, 2, and 5."
It's part of Comfyui-LG_GroupExecutor, LAOGOU-666's small utility pack. Don't install the whole pack for this alone if you only need one thing - but if you're already in for the group-execution stuff, this is a free bonus. No dependencies, no models.
How it works
The indices string gets split on commas and parsed to ints (0,1,3,4). The node handles two input shapes:
- A single batched tensor
[B, H, W, C]- indices pick from the batch dimension. - A list of images - indices pick from the list.
Each selected image is kept as a [1, H, W, C] tensor, and the result comes out as an IMAGE list (OUTPUT_IS_LIST = True). Out-of-range indices are skipped with a log line rather than crashing, and if nothing is valid you get an empty list - so guard downstream for the empty case.
Inputs & outputs
- images (IMAGE) - batch or list in.
- indices (STRING) - the whole control surface.
0,1,3,4, or1,2for a range.
Output: images (IMAGE list). Feed it to anything that accepts a list - a batch process, a per-frame loop, a video encoder.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/LAOGOU-666/Comfyui-LG_GroupExecutor
or ComfyUI Manager → "Comfyui-LG_GroupExecutor", then restart.
Small print
- Order is preserved and not forced to be ascending -
5,0,2gives you frame 5, then 0, then 2. Handy for reordering. - Duplicates are allowed:
2,2,2yields three copies. - Bad index text (letters, stray spaces) just logs "索引格式错误" and returns an empty list.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| indices | STRING | 输入要提取的图片索引,用逗号分隔,如:0,1,3,4 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |