Nodes/ComfyUI Image to Video Inserter/WanVideo Latent Zero Frames
ComfyUI Node

WanVideo Latent Zero Frames

Erase specific frames from your Wan video by zeroing them out in latent space

By Yeq6X·Created 2 months ago·Updated 2 months ago· 1
WanVideo Latent Zero Frames
  • samples
  • samples
frame_indices0

Sometimes you want your video model to not see a frame. WanVideo Latent Zero Frames takes a Wan latent tensor and sets chosen frames to zero - pure blank in latent space - before sampling. It's the surgical complement to its sibling WanVideo Latent Insert Frames: instead of stamping a specific image into the timeline, it wipes frames out of it.

It comes from ComfyUI Image to Video Inserter by Yeq6X, and it's one of the pack's two latent-space utilities. Where the pixel-space nodes (Multi Image Inserter) edit decoded frames, this one works on the raw latent, shape B,C,T,H,W. Zeroing a frame there means the sampler has literally nothing to work with at that position - a silence in the signal rather than a black image. That's a meaningful difference, and it's why this node exists: pixel edits and latent edits are not interchangeable.

How it works

The mechanism is exactly what the name says. It clones your samples, parses the frame-index string, and writes zeros across latents[:, :, idx, :, :] for every requested frame. The index parser is the pack's shared one, so you get the full syntax:

  • Single indices - 5
  • Ranges - 6-9
  • Negative indices - -1 (last frame), -2 (second-to-last)
  • Range to negative - 5--1 means frame 5 through the last frame; -5--1 means the last five frames

Duplicates get deduplicated and everything is sorted, and out-of-bounds indices raise a proper error rather than silently ignoring you.

Inputs that matter

  • samples - your Wan video latent.
  • frame_indices - the frames to zero out, comma-separated with range/negative support (the tooltip's example: 0,1,2,6-9,12).

That's it - just those two. The output is samples, the same latent with the selected frames zeroed, ready to hand back to the sampler.

Installing it

Standard pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/Yeq6X/ComfyUI-image-to-video-inserter

then restart ComfyUI (or use ComfyUI Manager, search "Image to Video Inserter"). No weights to download - it operates purely on latents your existing Wan setup already produces.

When to reach for it

Honestly, this one's niche even by this pack's standards. The zero-frame latent trick shows up in experimental workflows - masking out frames the model shouldn't be conditioned on, forcing the sampler to "fill in" a segment you intend to composite later, or as part of a frame-removal placeholder scheme. It's a scalpel, not a hammer. If you're not sure you need it, you probably don't - but it's exactly the kind of low-level lever that becomes indispensable the day you're fighting with a specific frame's behavior and realize the fix is to delete that frame from the model's view. Pair it with WanVideo Latent Insert Frames when you want the full "remove this, put that there" toolkit on a single timeline.

Categoryimage/video

Inputs (2)

NameTypeDefaultDescription
samplesLATENT
frame_indicesSTRING0Comma-separated frame indices to zero out (e.g., '0,1,2,6-9,12')

Outputs (1)

NameTypeDescription
samplesLATENT