🍒Image_List_Splitter📂图片列表分割器
Hand a batch of images to a node that wants a fixed number
- images
- selected_images
- remaining_images
Somewhere in every batch-heavy ComfyUI workflow you hit the same wall: a node upstream produced a stack of N images, and the node downstream only wants M of them - or you want to process M and keep the rest aside for later. Image_List_Splitter is the pack's answer: take a list of images, cut it into "the first (or randomly-chosen) N" and "everything that's left," and hand you both lists.
It's a pure plumbing node, the kind you install and forget until you actually need it, at which point it saves you from writing a custom list-slicing node or fighting with a batch-to-list converter. It's in the pack's 图像处理 (image processing) section.
How it works
The node is list-aware on both ends (INPUT_IS_LIST and OUTPUT_IS_LIST are both on). Give it an images list, and it splits by split_count - either from the front (fixed order) or, with enable_random on, by shuffling with random_seed first. The first group goes to selected_images, the remainder to remaining_images.
Two edge behaviors worth knowing. First, split_count is clamped to the actual list length, so asking for 50 from a 10-image list just gives you all 10. Second, if the remainder is empty, the node doesn't return an empty list - it returns a single black placeholder image. That's deliberate (downstream nodes often choke on empty lists) but it means "nothing left" looks like "one black image left," so don't be surprised by a black frame at the end of your pipeline.
The inputs that matter
images- the image list to split.split_count- how many go into the first group.enable_random- off = first N in order; on = random N.random_seed- only used when random is on; gives you a repeatable "random" pick.
Outputs: selected_images (list) and remaining_images (list).
Installation
Standard KimNodes pack install - Manager → search "ComfyUI_KimNodes" → Install → Restart, or git clone https://github.com/wjl0313/ComfyUI_KimNodes into custom_nodes. No extra dependencies.
Common issues
- The node behaves oddly with a single image - it's designed around lists. If you feed a non-list IMAGE, it wraps it into a one-element list, so "split 1" just returns the same image in both outputs' placeholders. Make sure upstream is actually a list.
- Black image at the end - that's the empty-remainder placeholder, not corruption. If you genuinely need "nothing" rather than "black," put a filter node downstream.
- Random selection not random - you set the seed once; same seed, same "random" pick. Set
random_seedfresh or vary it if you want variety.
It's not glamorous, but for batch splitting it's a clean, dependency-free tool. And unlike a few nodes in this pack, it does exactly what its description says.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| split_count | INT | 11–99999 | — |
| enable_random | BOOLEAN | false | — |
| random_seed | INT | 00–18446744073709550000 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| selected_images | IMAGE | — |
| remaining_images | IMAGE | — |