IO Slice & Dice
Keep a Batch, Its Latents, and Its Captions in Lockstep
- indices
- image
- image_list
- latents
- pos_cond
- neg_cond
- indices
- image
- image_list
- latents
- pos_cond
- neg_cond
- pos_txt
- neg_txt
- filenames
What it is
Say you detected six faces in an image, you've decided you only want to re-render two of them, and you need to slice the image batch, the latent batch, the positive and negative conditioning, the text prompts, and the filename list - all by the same indices, at the same time. Wire that by hand and you'll be chasing mismatched list lengths for an hour. IO Slice & Dice does the whole thing in one node.
The display name is the accurate one. It takes an incoming list of indices plus any of eight optional inputs, slices every connected input by those indices, and passes the indices through so whatever you chain downstream knows what it's working with. Slice, dice, and keep everything aligned.
How it works
Every input is optional except the index list, and it only touches the ones you connect - that's the standard optional-input-is-None convention ComfyUI uses. Connected inputs get sliced by the index list, and the outputs mirror the inputs one for one. The design detail worth noting is that it handles both shapes: a raw image batch (the image input) and a list of individual images (image_list), and it emits the sliced result in the matching shape - batch stays batch, list stays list.
The outputs carry the types through with the right is_list flags, so a sliced latent batch or conditioning set comes out as a list you can feed straight into a "for each" loop. Because the indices are also passed downstream, a later node can re-apply the same selection to something this node wasn't built to handle.
The inputs that matter
- indices (required) - the confirmed selection indices to slice by. This is the list your selector, detector, or manual picker produces.
- image / image_list - raw batch or list of images.
- latents - latent batch.
- pos_cond / neg_cond - positive and negative conditioning.
- pos_txt / neg_txt - the text prompts.
- filenames - a filename list, so filenames stay matched to the images they belong to.
Outputs mirror each connected input, plus the passed-through indices. Unused inputs simply don't appear in the outputs you need to look at.
When you'd use it
Any batch-selection workflow where multiple data streams must stay index-aligned. The classic case is an automated detailing loop: detect regions, pick a subset, and slice the image, latent, conditioning, and prompt together so each selected region gets its own correctly-paired render. It's also the answer in batch captioning and image-selection pipelines where you want to process "these two, not those four" without rebuilding the batch by hand.
Installing it
It's part of ComfyUI_Eclipse:
cd ComfyUI/custom_nodes
git clone https://github.com/r-vage/ComfyUI_Eclipse
pip install -r ComfyUI_Eclipse/requirements.txt
then restart ComfyUI, or just use Manager and search "Eclipse". Remember the pack's history if you're resurrecting old workflows: it used to be RvTools_v2, and legacy nodes were removed in v4.0.0 - the bundled migration tool exists for a reason.
Common issues
The two things that trip people up are both about input shape. First, the image_list input expects a list of individual images, not a batch tensor - feed it the wrong shape and the slicing semantics get weird. Second, if you slice by indices that exceed the length of a connected input, you'll get out-of-range behavior, so make sure the index list was actually generated against the same batch you're slicing. Other than that, the node is straightforward: connect what you want sliced, leave the rest disconnected, and everything stays aligned.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| indices | LIST | Confirmed selected indices to slice by. | |
| imageopt | IMAGE | Optional raw image batch. | |
| image_listopt | IMAGE | Optional list of individual images. | |
| latentsopt | LATENT | Optional latent batch. | |
| pos_condopt | CONDITIONING | Optional positive conditioning. | |
| neg_condopt | CONDITIONING | Optional negative conditioning. | |
| pos_txtopt | STRING | Optional positive text. | |
| neg_txtopt | STRING | Optional negative text. | |
| filenamesopt | STRING | Optional filename list. |
Outputs (9)
| Name | Type | Description |
|---|---|---|
| indices | LIST | Passed-through selection indices. |
| image | IMAGE | Sliced image batch [N,H,W,C]. |
| image_list | IMAGE | Sliced list of individual images. |
| latents | LATENT | Sliced latent batch. |
| pos_cond | CONDITIONING | Sliced positive conditioning. |
| neg_cond | CONDITIONING | Sliced negative conditioning. |
| pos_txt | STRING | Sliced positive text. |
| neg_txt | STRING | Sliced negative text. |
| filenames | STRING | Sliced filename list. |