Nodes/Comfyui-VACE-Tools/VACE Source Prep
ComfyUI Node

VACE Source Prep

VACE Source Prep — trims long source clips for VACE Mask Generator. Use this node BEFORE VACE Mask Generator when your source clip is longer than target_frames. It selects the relevant frames based on mode, input_left, and input_right, then outputs adjusted parameters to wire directly into the mask generator. input_left / input_right (0 = use all available): End Extend: input_left = trailing context frames to keep Pre Extend: input_right = leading reference frames to keep Middle Extend: input_left/input_right = frames each side of split Edge Extend: input_left/input_right = start/end edge size (overrides edge_frames) Join Extend: input_left/input_right = edge context from each half (or each clip if source_clip_2 connected) Bidirectional: input_left = trailing context frames to keep Frame Interpolation: pass-through (no trimming) Replace/Inpaint: input_left/input_right = context frames around replace region Video Inpaint: pass-through (no trimming) Keyframe: pass-through (no trimming) Upscale: pass-through; source_clip_2 = reference image(s) spliced at keyframe_positions

By ethanfel·Created 6 months ago·Updated 5 months ago· 9
VACE Source Prep
  • source_clip
  • source_clip_2
  • inpaint_mask
  • trimmed_clip
  • mode
  • split_index
  • edge_frames
  • inpaint_mask
  • keyframe_positions
  • vace_pipe
modeEnd Extend
split_index0
input_left0
input_right0
edge_frames8
keyframe_positions
CategoryVACE Tools

Inputs (9)

NameTypeDefaultDescription
source_clipIMAGE
modeCOMBOEnd Extend11 options: End Extend, Pre Extend, Middle Extend, Edge Extend, Join Extend, Bidirectional Extend, +5
split_indexINT0-10000–10000
input_leftINT00–10000
input_rightINT00–10000
edge_framesINT81–10000
source_clip_2optIMAGEJoin Extend: second source clip to heal/join. Upscale: your reference image(s) at upscaled size — spliced into the clip at keyframe_positions before VACE processing.
inpaint_maskoptMASK
keyframe_positionsoptSTRING

Outputs (7)

NameTypeDescription
trimmed_clipIMAGETrimmed source frames — wire to VACE Mask Generator's trimmed_clip input.
modeEnd Extend,Pre Extend,Middle Extend,Edge Extend,Join Extend,Bidirectional Extend,Frame Interpolation,Replace/Inpaint,Video Inpaint,Keyframe,UpscaleSelected mode — wire to VACE Mask Generator's mode.
split_indexINTAdjusted split_index for the trimmed clip — wire to VACE Mask Generator.
edge_framesINTAdjusted edge_frames — wire to VACE Mask Generator.
inpaint_maskMASKInpaint mask trimmed to match output — wire to VACE Mask Generator.
keyframe_positionsSTRINGKeyframe positions pass-through — wire to VACE Mask Generator.
vace_pipeVACE_PIPEPipe carrying mode, trim bounds, and context counts — wire to VACE Merge Back.