Nodes/TrentNodes/Wan Vace Gray Gap Joiner
ComfyUI Node

Wan Vace Gray Gap Joiner

The Node That Lets VACE Bridge Two Clips With a Gray Gap

By TrentHunter82·Created 9 months ago·Updated 4 days ago· 36
Wan Vace Gray Gap Joiner
  • images_a
  • images_b
  • images
  • masks
gap_frames8
filler_colorgray

VACE - Alibaba's video-aware context extension for Wan - is how people stitch longer scenes, and its core trick is temporal inpainting: you give the model a sequence where some frames are real, some are gray filler, plus a mask that says generate here. The Wan Vace Gray Gap Joiner is a purpose-built tool for exactly that: it takes two image batches, drops a run of gray frames between them, and emits the matching mask so VACE knows which frames to invent.

Where this shines is joining a clip A to a clip B - two shots of the same character, two segments of a longer scene - and letting the model produce a believable transition across the gap. That's the "longer scenes joined with vace" pattern that's become standard for going past Wan's native context length.

How it works

images_a defines the output resolution. images_b gets resized to match (bilinear), and any channel mismatch is harmonized - an RGBA batch and an RGB batch just work. Then it concatenates images_a + filler + images_b and builds the mask batch alongside: 0 for every real frame (VACE preserves these), 1 for every filler frame (VACE generates these). The filler defaults to gray at 0.5, which is the value Wan VACE expects for "generate me"; there's also a pure-green option if you want chroma-key-style fillers instead.

Inputs that matter

  • images_a and images_b - the two clips, order matters, A goes first.
  • gap_frames - how many filler frames between them, 0–256, default 8. This is the knob that controls how much room the model has to morph.
  • filler_color - gray (0.5, the VACE default) or green.

Outputs

  • images - the joined batch.
  • masks - 1 where the model should generate, 0 where it should preserve. These go into the VACE encoder's mask input alongside the frames.

Troubleshooting

The big one: don't read the mask convention backwards. 1 = generate, 0 = preserve - if you feed it flipped, VACE will happily regenerate your real frames and you'll wonder why the source clips came out mangled. Second, gap length matters: a gap of 1–2 frames gives the model almost no room and you'll get a hard cut rather than a transition, while very long gaps drift. The pack's own sibling node flags that VACE typically wants 8+ frames between keyframes for good interpolation, and that guidance applies here too. Third, the output count is simply len(A) + gap + len(B) - if that sum doesn't land on a Wan-friendly number, run the result through the Wan2.1 Frame Adjuster before it hits the sampler.

Installing

Part of TrentNodes, under Trent/Keyframes. ComfyUI Manager → "Trent Nodes" → Install, or clone it:

cd ComfyUI/custom_nodes
git clone https://github.com/TrentHunter82/TrentNodes
cd TrentNodes
pip install -r requirements.txt

Restart after. If Manager flags the pack (a day-one repo rename left a registry duplicate it still distrusts), the manual clone is the reliable path.

CategoryTrent/Keyframes

Inputs (4)

NameTypeDefaultDescription
images_aIMAGEFirst image batch (defines output resolution)
images_bIMAGESecond image batch (resized to match images_a if needed)
gap_framesINT80–256Number of gray filler frames inserted between the two batches
filler_coloroptCOMBOgrayColor for filler frames: gray (0.5, Wan VACE default) or pure green (chroma-key style)

Outputs (2)

NameTypeDescription
imagesIMAGEimages_a + gap filler frames + images_b as one batch
masksMASKMatching masks: 0 for real frames (preserve), 1 for filler frames (generate)