π π £π § LTXV Select Latents
Trim a frame range out of an LTX video latent
- samples
- LATENT
Simple node, genuinely useful. LTXVSelectLatents slices a range of frames out of a video latent - pick a start and end index, get just that chunk back. It's the latent-space equivalent of trimming a clip, and it does the trimming before you decode to pixels, which is exactly where you want it in an LTX pipeline.
Where does this earn its keep? All over long-video workflows. LTX's music-video crowd generates 10β12 second clips with a couple seconds of "filler" at the head to let motion settle, then trims that filler off - this is the node that drops it. Extending a video? You grab the last few frames of one clip to seed the next. Chaining segments with a transition? You cut each piece to length first. Small node, shows up constantly.
How it works
It indexes into the frames dimension of the latent and returns the closed interval you asked for - both endpoints included. Because it operates on the latent, you keep everything in the model's compressed representation and avoid a decode/re-encode round trip that would cost time and a little quality.
The inputs and outputs that matter
samples(LATENT) - the video latent to trim.start_index(INT, default 0) - first frame to keep.0is the beginning.end_index(INT, default -1) - last frame to keep, inclusive. Negative indexing works like Python:-1is the last frame,-2the second-to-last, and so on. So the defaults (0 to -1) pass the whole clip through unchanged - handy as a starting point you then narrow.
One gotcha worth internalizing: the interval is inclusive of both ends. start_index 0 and end_index 5 gives you six frames, not five. And remember these are latent frames, not raw video frames - LTX's VAE compresses temporally, so one latent frame covers several output frames.
Output is a single LATENT containing just the selected range.
How to install it
The pack installs cleanly from ComfyUI Manager: Ctrl+M β Install Custom Nodes β search LTXVideo β Install β restart (the README's recommended way). Or clone it:
cd ComfyUI/custom_nodes
git clone https://github.com/Lightricks/ComfyUI-LTXVideo
then restart ComfyUI. It's under latent/video. Nothing to download for this node; the LTX-2 model it feeds is the heavy part (32GB+ VRAM, 100GB+ disk per Lightricks).
Common issues & troubleshooting
Off-by-one on the frame count. Because both endpoints are inclusive, you get end - start + 1 frames. If you're consistently one frame long or short, that's why.
You cut too much (or too little). Keep the latent/pixel distinction straight. The number you type is in latent frames, and the VAE's temporal compression means each one expands to several decoded frames. Decode a test to see how your indices map to actual video length before committing to a range in a big batch.
Index out of range. If end_index points past the clip's length you'll error. Use negative indices (-1 for "last, whatever the length") when you don't know the exact frame count - that's the safe way to say "up to the end."
Empty output. A start_index greater than end_index (once negatives are resolved) selects nothing. Double-check the two indices actually describe a forward range.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| samples | LATENT | β | |
| start_index | INT | 0-9999β9999 | β |
| end_index | INT | -1-9999β9999 | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | β |