Nodes/VACE Tools/VACE Merge Back
ComfyUI Node

VACE Merge Back

Putting your extension back into the original clip without a visible seam

By ethanfel·Created 7 months ago·Updated 6 months ago· 9
VACE Merge Back
  • source_clip
  • vace_output
  • vace_pipe
  • source_clip_2
  • merged_clip
blend_methodoptical_flow
of_presetbalanced

If VACE Source Prep is the front half of the long-clip story, VACE Merge Back is the back half. You trimmed a long clip down to a window that fits in your VACE encode, ran the sampler, and now you have a short VACE output sitting in a sea of original footage. Merge Back is what stitches them together: it takes the original untrimmed clip, the VACE sampler's output, and the vace_pipe from Source Prep, and reconstructs the full-length video with the new frames blended in at the seams.

The clever part is the blending. A hard splice between AI-generated frames and real source frames is exactly where you'd see a jump, a color shift, or a ghosting mess on anything moving. Merge Back smooths that across the whole context zone - the frames each side of the seam that VACE actually saw as context - so the transition reads as continuous motion rather than a cut.

How it works

The vace_pipe input is doing the heavy lifting. It carries the mode, the trim bounds (trim_start/trim_end), and the context-frame counts that Source Prep computed, so Merge Back knows where the window sat inside the original video without you re-entering anything. From there the behavior splits cleanly in two:

  • Pass-through modes (Edge Extend, Frame Interpolation, Keyframe, Video Inpaint, Upscale) return vace_output as-is. For these the VACE output is the final result - the extension was generated around the full clip, so there's nothing to splice back.
  • Splice modes (End, Pre, Middle, Join, Bidirectional, Replace) rebuild the video as original[:trim_start] + vace_output + original[trim_end:] and blend across the context zones at each seam. For a two-clip Join Extend, the tail comes from the optional source_clip_2 instead.

The blend itself is where you get choices. blend_method defaults to optical_flow: it computes Farneback dense optical flow between the seam frames and warps both sides along the motion field before blending, which is what reduces ghosting on moving subjects. The alternatives are alpha (a plain linear crossfade - faster, but softens motion) and none (a hard cut, fastest, for when you don't care or the seams aren't visible). of_preset - fast, balanced, quality, max - trades optical-flow accuracy against speed.

Inputs and outputs

Inputs: source_clip (the full original, before any trimming), vace_output (the sampler's frames), vace_pipe (from VACE Source Prep), blend_method, of_preset, and optional source_clip_2 for two-clip joins. Output: a single merged_clip IMAGE - the full reconstructed video, ready to encode or save.

Gotchas

The one that catches people: vace_pipe is required, and it has to come from the same Source Prep run that trimmed your clip. Reuse a stale pipe after changing the trim and the seams land in the wrong place. Also, optical-flow blending needs OpenCV (cv2) - the node gracefully falls back to alpha blending if cv2 isn't installed, so you won't see an error, you'll just quietly lose the good blending. If your seams ghost on moving subjects, check whether cv2 is actually there.

How to install it

Another node in ethanfel's ComfyUI-VACE-Tools pack (he's the dev behind ComfyUI-LoRA-Optimizer and ComfyUI-Krea2TexTEncoder):

cd ComfyUI/custom_nodes/
git clone https://github.com/ethanfel/Comfyui-VACE-Tools.git

Restart ComfyUI, or search "VACE Tools" in ComfyUI Manager. The pack itself declares zero dependencies; the only optional one is opencv-python for optical-flow blending, and everything degrades gracefully without it. The Wan base and VACE extension checkpoints are still separate downloads in your WanVideoWrapper setup - this node just manipulates the frames around them.

CategoryVACE Tools

Inputs (6)

NameTypeDefaultDescription
source_clipIMAGE
vace_outputIMAGE
vace_pipeVACE_PIPE
blend_methodCOMBOoptical_flow3 options: optical_flow, alpha, none
of_presetCOMBObalanced4 options: fast, balanced, quality, max
source_clip_2optIMAGE

Outputs (1)

NameTypeDescription
merged_clipIMAGEFull reconstructed video with VACE output spliced back into the original clip.