VACE Clip Doctor
Fix a VACE clip's bad frames in specific ranges — grey the image, flip the mask
- images
- masks
- images
- masks
VACE (Video-Aware Context Extension) works off an image sequence and a matching mask sequence, and both have to agree frame-for-frame. VACE Clip Doctor is the one node that edits both sides at once, on exactly the frames you pick. It's the big sibling of Mask Range Doctor: same comma/dash range syntax, but it can paint frames grey in the images and white or black in the masks in a single pass.
The use case is right in the pack's framing: "fix frames, edit video in specific frame ranges." You'll reach for it after a splice or keyframe insert leaves a few frames that shouldn't be there, or when you want to mark a stretch of video for VACE to regenerate instead of keeping. For VACE, grey frames are the neutral "fill me in" placeholder and white masks mean "generate here" - so painting a range grey+white is how you tell the model to rebuild that part of the clip.
How it works
Same parser family as Mask Range Doctor, but three strings instead of two:
grey_range: 2,5,10-15 → those image frames become solid grey (127/255)
white_range: 3,5,10-15 → those mask frames become 1.0
black_range: 1,20-25 → those mask frames become 0.0
Commas pick individual frames, dashes are inclusive ranges, everything is 0-indexed, and an empty string means "skip this." It clones both input tensors, validates every frame index against the sequence length, and errors hard if a frame lands in both white and black (a mask can't be both "keep" and "regenerate"). Unlike Mask Range Doctor, it also checks that your image count and mask count match up front - a mismatch raises immediately instead of producing shifted garbage downstream.
Inputs and outputs that matter
images(required, IMAGE) - the video frames you're editing.masks(required, MASK) - must have the same frame count asimages.grey_range(STRING) - frames to flatten to grey in the image sequence.white_range/black_range(STRING) - frames to set to 1.0 / 0.0 in the mask sequence.
Outputs are images and masks, both same-length as the inputs, wired straight into your VACE encode node (video in, mask in). A common move: keep one frame as-is, grey the frames you want rebuilt, and let the model bridge the gap.
Installing it
VACE Clip Doctor ships in the rgamevfx/ComfyUI-RGnodes pack, which is four nodes total. Through ComfyUI Manager, search "ComfyUI-RGnodes." Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/rgamevfx/ComfyUI-RGnodes.git
Restart after cloning. There's no requirements.txt and no model download - this pack is pure torch tensor manipulation, so it installs clean alongside heavier VACE packs like Kijai's WanVideoWrapper or WanVaceAdvanced. The one real prerequisite is a working VACE pipeline to feed; the node itself is featherweight.
Troubleshooting
- "Image and mask frame counts must match" - this fires when your video and its mask sequence disagree on length. Usually caused upstream: re-check whatever loaded or generated the masks (a splice, a frame-cap mismatch, a VACE encoder that trimmed one side).
- Overlap error between white and black - a frame can't be in both; that's a genuine contradiction in VACE-land.
- Out-of-range errors - 0-indexed again. A 60-frame clip is frames 0–59.
- Frames greyed but masks untouched - you left
white_rangeempty, so VACE won't know to regenerate the grey frames. Grey image + white mask is the pair; don't do one without the other unless you know why.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| masks | MASK | — | |
| grey_rangeopt | STRING | — | |
| white_rangeopt | STRING | — | |
| black_rangeopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| masks | MASK | — |