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

WanVideo Latent Insert Frames

Surgically drop a single-frame latent into your Wan video — pixel-perfect frame control

By Yeq6X·Created 2 months ago·Updated 2 months ago· 1
WanVideo Latent Insert Frames
  • samples
  • latent_1
  • latent_2
  • samples
frame_indices0
inputcount2

Wan is the local video model people actually reach for, and the moment you start working with it seriously you'll want to reach into the latent space and move frames around. WanVideo Latent Insert Frames is that tool: it takes your video latents and one-frame latents you've encoded separately, and overwrites specific frames of the timeline with those single frames - all before sampling, in latent space.

It's from ComfyUI Image to Video Inserter by Yeq6X, and it's the pack's most specialized node. The insight is that you don't have to insert images into pixels - do it into the latents. Encode a still image with the Wan VAE, and you get a B,1,C,H,W latent. Insert those at chosen positions, and the sampler will treat your stills as if they were always part of the video. This is how you force a specific frame to be a specific image, or stitch a sequence of keyframes into a single generation.

How it works

The node reads your samples latent (shape B,C,T,H,W - batch, channels, frames, height, width), parses the index list, and writes each input latent into the frame dimension at its position. The hard requirements are grounded in the code:

  • Every input latent must be exactly T=1 (a single frame). Multi-frame latents get rejected with a clear error.
  • All dimensions must match - same B, C, H, W as your base latent. Encode your stills at the same resolution with the same VAE and you're fine.
  • You need as many inputs as indices. The node errors if you list more positions than you provided latents.

The frame_indices string supports the full syntax from this pack's parser: 0,1,2 for single positions, 6-9 for ranges, even negative indices like -1 for the last frame (e.g. "0,1,2,6-9,12"). And like the assembler, the node has an inputcount plus an "Update inputs" button - set how many single-frame latents you want, click it, and the latent_1…latent_N sockets appear.

Inputs that matter

  • samples - your base video latent (e.g. from Wan's empty-latent or an existing generation).
  • frame_indices - where to insert, comma-separated with range and negative support.
  • inputcount - how many latent inputs to show (2–100), then click "Update inputs".
  • latent_1latent_N - the single-frame latents to insert, in order.

The output is samples, the modified latent - same shape, ready for the sampler.

Installing it

Same one-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 model downloads - this node works on whatever Wan setup you already have.

When to reach for it

Reach for it when you want deterministic frames inside an otherwise generative video - a title frame you need to survive generation, a specific keyframe in a sequence, or a storyboard where certain shots must match reference images exactly. It's an advanced tool; if you're new to Wan, get a basic I2V working first so you know what the latent shapes look like before you start poking at them. When you do, this is the node that turns "I wish frame 12 were that picture" into a workflow you can actually run. And remember, for the reverse trick - erasing frames - the pack's WanVideo Latent Zero Frames node has you covered.

Categoryimage/video

Inputs (5)

NameTypeDefaultDescription
samplesLATENT
frame_indicesSTRING0Comma-separated frame indices to insert frames (e.g., '0,1,2,6-9,12')
inputcountINT22–100
latent_1LATENT
latent_2LATENT

Outputs (1)

NameTypeDescription
samplesLATENT