Nodes/ComfyUI/LatentCut
ComfyUI Node Runs on cloud

LatentCut

Slice a latent like a video clip — frames, strips, and crops

By Comfy-Org·Created 4 years ago·Updated 32 minutes ago· 129,926
LatentCut
  • samples
  • LATENT
dim
index0
amount1

LatentCut is the scissors. It takes one latent and slices out a contiguous chunk along an axis - a run of frames from a video latent, a strip from the side of an image latent, a crop of a tall composition. If you've ever wanted to trim the first two seconds off a video generation or pull a panel out of a stitched latent, this is the node.

How the slicing works

Three controls do everything: dim (which axis to cut along), index (where the cut starts), and amount (how many slices to keep).

  • t - time/frames. This is the one you'll use most: cut frames [index : index+amount] out of a video latent. Trim the wobble at the start, or keep a loop segment.
  • x - width. Pull a vertical strip out of the latent.
  • y - height. Pull a horizontal strip.

index can go negative (counts from the end), and amount is how long the extracted chunk is. The output is a new LATENT containing only the sliced region - everything outside the cut is gone, not masked or hidden.

Where it fits

The most common real-world use is frame surgery on video latents: a video model gives you 81 frames, you only want 33 of them, you cut them out before VAE decode so you're not decoding frames you'll throw away. Combined with LatentConcat it's also the two halves of an edit - cut out a bad segment, then stitch the good parts back together.

For stills it's less glamorous but still handy: pulling one panel out of a multi-panel latent, or isolating a strip for a targeted pass without re-encoding pixels.

Inputs and output

LatentCut takes samples, dim, index, and amount, and returns a single LATENT of the sliced region. There's no visual preview - you're cutting a tensor, so verify your index math against the latent's actual size, not the pixel size.

Common issues

The big one is mixing up latent-space and pixel-space coordinates. A 480-tall video latent isn't 480 pixels tall in the tensor - the latent is downscaled by the model's factor (8x for most, 16x for some newer ones). If your index and amount are in pixels, you'll slice into the middle of what you meant to keep or error out on out-of-range. Count in latent steps, which is exactly why the dim options say t/x/y rather than frames/width/height. Second gotcha: cutting frames doesn't change the temporal semantics of the sampler - a 20-frame latent will just generate 20 frames, not make 20 frames out of a 60-frame expectation. Cut first, then sample, and the model does the rest.

Categorymodel/latent/advanced

Inputs (4)

NameTypeDefaultDescription
samplesLATENT
dimCOMBO3 options: x, y, t
indexINT0-16384–16384
amountINT11–16384

Outputs (1)

NameTypeDescription
LATENTLATENT