πͺ VACE Extend
Keep a Wan clip going from any frame, not just the end
- video
- control_video
- control_mask
- width
- height
- length
- start_images
- context_frames
- new_frames
Wan's native context is 81 frames. Longer than that, and you're stitching segments - which is why extension nodes exist. VACE Extend is the "continue this clip" prep node, with one useful twist over the usual end-of-video extension: you can extend from any frame position, not just the last one. Hand it a clip, tell it where to keep going, and it builds the VACE control video and mask that make Wan continue seamlessly from that point.
This is the sibling of VACE Join (same pack, same author, same design language). Join morphs two clips together; Extend just grows one. If you're doing long-form video, you'll want both.
How it works
The mechanism is simple and worth understanding because it explains the input names. From your chosen extension point, the node walks backwards and keeps context_frames of real frames as reference. Those go into the control video unchanged. After them come new_frames of gray (0.5) placeholders, and the mask is 1 across that whole new zone - that's what tells VACE "here's the frontier, invent the next new_frames frames."
Everything before the context window comes out as start_images, which you keep. After sampling, your extended video is start_images + the context + the newly generated frames. The 4n+1 rule applies to the generation count: new_frames must follow 1, 5, 9, 13, β¦ (the Wan model generates 4n+1 frames and will silently round down otherwise, so the node enforces it).
The inputs and outputs that matter
video- your source clip as an IMAGE batch. Dimensions must be divisible by 16.extend_from_idx(default -1) - the frame to extend from. Negative counts from the end, so -1 means "the last frame." You can also use an explicit index to branch the video mid-clip - say, split a scene and generate a different continuation.context_frames(default 8) - how many real frames precede the extension point and anchor the generation. Multiples of 4.new_frames(default 25) - how many frames to generate. Must be 4n+1; the node errors with the nearest valid values if you get it wrong.
Outputs: control_video and control_mask go to WanVaceToVideo's control_video / control_masks, width/height/length describe the control video, and start_images is the preserved lead-in. The context_frames and new_frames outputs are passthroughs for downstream wiring.
Install
ComfyUI Manager β search "Wan VACE Prep" β install β restart, or:
cd /path/to/comfyui/custom_nodes
git clone https://github.com/stuttlepress/ComfyUI-Wan-VACE-Prep
Zero pip dependencies, no model downloads for the node itself. You need the Wan VACE checkpoint downstream to actually generate.
Common issues
- "new_frames must follow 4n+1 pattern" - the error message hands you the nearest valid values. It's a hint, not a bug.
- "context_frames requires at least X frames before extend_from_idx" - you can't have more context than frames before your extension point. Extend from frame 10 with
context_framesof 16 and it refuses. Either start further in or shrink the context. extend_from_idxout of bounds - the error tells you the valid range, including the negative-index form. Easy to hit if you feed in a different-length clip than you think you did.- Identity drift on long chains - this is Wan, not a magic node: each extension degrades a little. The community builds 20-30 second takes by chaining with overlap, not by one giant extension. Keep context generous and check the join.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| video | IMAGE | β | |
| extend_from_idx | INT | -1-1000000β1000000 | Frame index to extend from. Negative values count from the end of the video. e.g., -1 is last frame |
| context_frames | INT | 84β120 | Number of reference frames before extend_from_idx for VACE conditioning (multiple of 4). |
| new_frames | INT | 251β241 | Number of new frames to generate (4n+1). |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| control_video | IMAGE | β |
| control_mask | MASK | β |
| width | INT | β |
| height | INT | β |
| length | INT | β |
| start_images | IMAGE | β |
| context_frames | INT | β |
| new_frames | INT | β |