Select Latents π₯π ₯π π ’
Select Latents
- latent
- LATENT
Select Latents plucks specific frames out of a latent batch by index. You type in which ones you want - 0, 5, 12 - or a range like 0:16, and it hands you back exactly those latents, in the order you asked for. If you've ever wanted "just the first 8 frames," "every other frame," or "the last one," this is the surgical tool for it.
In a video workflow your latents are a stack, one slice per frame. Most nodes treat that stack as a monolith. Select Latents is the one that lets you address it like a Python list - because under the hood, that's basically what it's doing.
The index syntax (this is the whole node)
The indexes field is a comma-separated string, and it's genuinely expressive. Assuming 16 items (indices 0 through 15):
0β returns item[0]-1β returns the last item,[15](negative indexing works)0, 1, 13β those three, in that order0:5, 13β a range plus a single: items 0,1,2,3,4, then 13 (ranges exclude the end index, Python-style)0:-1β everything except the last0:5:-1β[4, 3, 2, 1, 0]- a step of -1 reverses the range0:5:2β[0, 2, 4]- step of 2::-1β the entire batch, reversed
That reversal trick (::-1) is a genuinely handy one - it's how you flip a clip backwards without a dedicated node. And because output order follows the order you type, you can reorder frames freely, not just filter them.
Inputs and outputs
- latent (LATENT) - the batch to select from.
- indexes (STRING, default
0) - the selection expression above. - err_if_missing (BOOLEAN, default true) - if you reference an index that doesn't exist (say index 20 in a 16-frame batch), error out instead of silently skipping it. Leave it on while you're building so typos are loud.
- err_if_empty (BOOLEAN, default true) - error if the selection ends up empty rather than passing nothing downstream.
Output is a single LATENT batch containing exactly your selection.
Installing it
comfy.icu ships VideoHelperSuite in the image already - nothing to install.
Locally, use ComfyUI Manager (search ComfyUI-VideoHelperSuite, install, restart) or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite
then restart. It's Kosinkadink's pack, the standard kit for anyone doing AnimateDiff, Wan, or LTX work in ComfyUI.
Common issues
The two error toggles are your friends, so know what they do. With err_if_missing on (the default), an out-of-range index throws instead of quietly dropping - which is what you want, because a silently-shortened batch downstream is a nightmare to debug. If you're intentionally over-selecting (grabbing "up to 16" from a variable-length batch) and want the extras to just not appear, turn it off deliberately.
Remember ranges exclude their end: 0:8 gives you eight frames (0β7), not nine. Off-by-one here is the single most common mistake, especially when you're trying to line up a selection with a context window.
If the node's missing entirely, that's the pack failing to import - check the ComfyUI startup log for the real cause (usually ffmpeg or a NumPy version clash) and reinstall through Manager.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | β | |
| indexes | STRING | 0 | β |
| err_if_missing | BOOLEAN | true | β |
| err_if_empty | BOOLEAN | true | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | β |