Wan Video VACE Frame Replace (QQ)
The frame-replacement grammar that sets up VACE inpainting
- images
- masks
- replacement_images
- replacement_masks
- video
- mask
- middle_frames
Wan's VACE framework inpaints by telling it which frames are "missing" - you blank the frames you want regenerated (usually with gray) or feed it replacement images, and VACE fills them in. Doing that by hand across 81 frames is miserable. WanVideoVACEFrameReplace is the pack's answer: one STRING input with a tiny grammar that says which frames get replaced, how, and with what. You type something like 2-5-3 or 22-26 into indexes, and it rebuilds the batch plus a mask showing exactly what it marked. The node's own long description is the grammar spec, and the README's frame_replace example shows it in action.
The syntax (this is the whole skill)
- Single numbers -
5replaces frame 5 with the gray fill (gray_level, 0–1, default 0.5). - Single numbers with
+-5+replaces frame 5 with the next replacement_images entry (your reference frame). - Ranges -
22-26replaces that whole run with gray. - Ranges with
*-*1-5or1-5*replace the start/end frame with the next replacement image and drop the rest of the range. - a-b-c patterns -
2-5-3means frame 5 is the middle; frames around it get replacement images. This is the pattern for "re-anchor the middle of a clip." +/++suffixes -+a-b-c,a-b-c+,++a-b-c+duplicate the middle image to before/after with gradual blending; more+signs = more duplicates fading outward.- Custom opacity - append a float:
a-b-c+ 0.6sets mask opacity for the duplicates (closest = strongest, farthest = weakest).
The remaining inputs are support: max_frames (-1 = auto) caps the batch, mask_opacity applies a global opacity to generated masks, and the optional masks, replacement_images, replacement_masks inputs let you hand VACE starting masks, actual frames to use as replacements, and custom mask patterns (auto-scaled to the image dimensions). All image/mask replacements share one counter, so the Nth replacement image is used by the Nth replacement request.
The outputs
video (the processed IMAGE batch with replaced frames), mask (black = kept, varied patterns/opacity = replaced - feed this to VACE so it knows what to regen), and middle_frames (a STRING listing which frames ended up as "middle" anchors, useful for round-tripping into another pass).
When it earns its keep
Anytime you're doing VACE inpainting or re-anchoring: fixing a mid-clip glitch by replacing just those frames, injecting a reference image mid-timeline, or building the "which frames are missing" spec that VACE needs. It's the difference between typing a one-line spec and wrestling with per-frame masks. Given the ctr on this page (high for the pack), people who find it clearly use it hard.
Installing it
Part of siraxe/ComfyUI-WanVideoWrapper_QQ via ComfyUI Manager (search WanVideoWrapper_QQ/SA-Nodes-QQ), or:
cd ComfyUI/custom_nodes
git clone https://github.com/siraxe/ComfyUI-WanVideoWrapper_QQ.git
Restart ComfyUI. You'll want Kijai's ComfyUI-WanVideoWrapper (VACE runs in that world) and the VACE model files.
Gotchas
- The grammar is unforgiving. One stray space (e.g.
2-5-3) turns into the opacity parser, and a typo silently replaces nothing. Test on a short clip first. - Indexing is 1-based-ish and the
-1logic in ranges catches people; verify againstmiddle_framesoutput rather than guessing. - Pack note: repo renamed to ComfyUI-SA-Nodes-QQ in v1.3.4; delete any stale
wanwrapper_qqfolder incustom_nodesif old workflows reference it.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| indexes | STRING | 2-5-3 | — |
| gray_level | FLOAT | 0.500–1 | — |
| max_frames | INT | -1-1–1000 | — |
| mask_opacity | FLOAT | 0.000–1 | — |
| masksopt | MASK | — | |
| replacement_imagesopt | IMAGE | — | |
| replacement_masksopt | MASK | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| video | IMAGE | — |
| mask | MASK | — |
| middle_frames | STRING | — |