WanVideo VACE Start To End Frame
Build the frame batch and masks VACE needs
- start_image
- end_image
- control_images
- inpaint_mask
- images
- masks
VACE is Alibaba's official control framework for Wan - reference-to-video, video extension, and inpainting driven by control videos. It's powerful and it's fiddly, and a lot of the fiddliness is in preparing its inputs correctly: VACE wants a full frame batch with the right frames populated and the rest masked, plus a matching mask sequence. This helper node builds exactly that. Its description says it plainly: it creates the start/end frame batch and masks for VACE.
So instead of hand-assembling an 81-frame image batch with your start image at index 0, your end image at the last index, empty frames in between, and a mask that marks which frames are "known," you set a few values here and it produces the images and masks pair VACE consumes.
How it works
You tell it how many frames the sequence is and hand it a start image, an end image, and/or control images. It lays them out into a frame batch at the right positions, fills the gaps with neutral frames at your chosen empty_frame_level, and generates a corresponding mask sequence - white where the model should generate, preserving where you've provided real frames. That images+masks pair is the standard VACE conditioning shape.
The inputs that matter
num_frames- the length of the batch, stepping by 4 (default 81). Match this to the clip length your VACE workflow targets.start_image(optional) - the first known frame.end_image(optional) - the last known frame, for first-frame/last-frame setups.control_images(optional) - a control sequence (e.g. pose or depth frames) to drive the whole clip.inpaint_mask(optional) - feed a mask when you're doing VACE inpainting rather than start/end interpolation.empty_frame_level(default 0.5) - the gray level used for the unknown frames. Mid-gray is the neutral default; rarely needs changing.start_index/end_index- where in the batch the provided frames land, if you don't want them at the very ends.
Outputs are images (the frame batch) and masks (the mask sequence), which go into your VACE encode.
How to install it
Part of the pack. Via ComfyUI Manager: search WanVideo Wrapper, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-WanVideoWrapper
pip install -r ComfyUI-WanVideoWrapper/requirements.txt
then restart. VACE itself is a separate model you attach via the model loader's extra_model input - this node only prepares frame/mask inputs, it doesn't load VACE.
Common issues & troubleshooting
Frame count mismatches downstream. The num_frames here has to line up with the length your VACE encode and sampler expect. A mismatch between this batch and the rest of the graph is a common source of shape errors. Keep them consistent, and keep the count on the 4n+1 grid.
The generated middle ignores your start/end. Check the mask is actually reaching VACE and that your start/end images are at the indices you think they are. If you set start_index/end_index oddly, the known frames land in the wrong place.
You wanted inpainting, not interpolation. Then you need inpaint_mask, and the control/known frames set up differently. This node covers both jobs, but the start/end path and the inpaint path use different inputs - don't mix them expecting one behavior.
VACE is painfully slow. That's VACE, not this node - it's known to be slow. The community fix is a distillation LoRA (CausVid/LightX2V) to bring it down to a few steps; this helper just feeds it.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| num_frames | INT | 811–10000 | Number of frames to encode |
| empty_frame_level | FLOAT | 0.500–1 | White level of empty frame to use |
| start_imageopt | IMAGE | — | |
| end_imageopt | IMAGE | — | |
| control_imagesopt | IMAGE | — | |
| inpaint_maskopt | MASK | Inpaint mask to use for the empty frames | |
| start_indexopt | INT | 00–10000 | Index to start from |
| end_indexopt | INT | -1-10000–10000 | Index to end at |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| masks | MASK | — |