Nodes/ComfyUI-SplatKit/Mask Mix (holes + semantic)
ComfyUI Node

Mask Mix (holes + semantic)

Let the video model redo the plants and windows, but not the wall

By mickmumpitz·Created about a month ago·Updated about 19 hours ago· 17
Mask Mix (holes + semantic)
  • holes
  • semantic
  • mask
  • preview
  • composite_mask
semantic_weight0.50
semantic_threshold0.50
semantic_grow_px0
hole_grow_px0

SplatKit's WAN pass is a trade: the video model fills the disocclusion holes, but it also quietly repaints whatever you let it touch. Mask Mix is the node that draws the line. It takes two kinds of regions - the geometry holes at full strength, plus an optional semantic region at a partial weight - and blends them into one mask that drives masked video conditioning. The classic use: your panorama has a plant or a mirror where a frozen reprojection looks wrong, so you want WAN to reinvent it with real parallax and a moving reflection, while a normal wall stays untouched. That's what the semantic input is for.

The trick is the weighting. holes is required - the disocclusion mask with 1 = hole (from HiRes's hole_mask, inverted, since that's 1 = kept). semantic is the region you want partially regenerated: you get it by running a second HiRes Pano Fly-Through with identical settings and a SAM3 mask wired into texture_override, so the semantic region is rendered through the same rig in the same frame space. Then semantic_weight (default 0.5) decides how much of that region the video model reinvents: 0 = untouched, 1 = fully regenerated (identity lost). The author's own sweet spot is 0.4–0.6 - "buys parallax and moving reflections while the plant stays the same plant."

Other knobs are small and honest: semantic_threshold (cutoff on the rasterised mask; raise if the region bleeds past its edges), semantic_grow_px (dilate the region a few px so the model can move a leaf silhouette instead of being pinned to its outline), hole_grow_px (leave at 0 if a Grow Mask already ran).

The output gotcha that will save you

Three outputs, and using the wrong one ghosts your image:

  • mask - the weighted mask: 1 in the holes, semantic_weight on the plants/windows. This drives masked video conditioning, or the green/black fill of a control video.
  • preview - the same thing as a viewable IMAGE.
  • composite_mask - a binary stencil: 1 wherever the model was allowed to change anything. Use this in the final Image Composite Masked, never the weighted mask. Compositing a regenerated plant back at 0.5 doubles it against the original - it ghosts.

Install & notes

Same pack install as everything else:

cd ComfyUI/custom_nodes
git clone https://github.com/mickmumpitz/ComfyUI-SplatKit
python_embeded\python.exe -m pip install -r ComfyUI-SplatKit/requirements.txt

Restart, and you're done - Mask Mix itself has no model downloads; those come from the HiRes and WAN nodes feeding it. The console prints a per-run summary of what fraction of the frame is fully vs partially regenerated, which is the fastest way to notice you've accidentally handed WAN the whole frame.

CategorySplatKit

Inputs (6)

NameTypeDefaultDescription
holesMASKThe disocclusion mask, 1 = hole. From HiRes `hole_mask` inverted (hole_mask is 1 = KEPT).
semanticoptIMAGEThe semantic region rendered through the SAME rig -- run a second HiRes Pano Fly-Through with identical settings and the SAM3 mask wired into `texture_override`.
semantic_weightoptFLOAT0.500–1How much of these regions the video model reinvents. 0 = untouched, 1 = fully regenerated (identity lost). 0.4-0.6 buys parallax and moving reflections while the plant stays the same plant.
semantic_thresholdoptFLOAT0.500–1Cutoff applied to the rasterised semantic mask before weighting. Raise if the region bleeds past its edges.
semantic_grow_pxoptINT00–128Dilate the semantic region. A few px lets the model move a leaf silhouette instead of being pinned to its outline.
hole_grow_pxoptINT00–128Dilate the holes. Leave at 0 if a Grow Mask already ran.

Outputs (3)

NameTypeDescription
maskMASKWeighted mask: 1 in the holes, `semantic_weight` on the plants/windows. This is what drives masked video conditioning, or the green/black fill of a control video.
previewIMAGEThe same thing as a viewable IMAGE.
composite_maskMASKBinary stencil for the final Image Composite Masked: 1 wherever the model was allowed to change anything. Use THIS there, never the weighted mask -- compositing a regenerated plant back at 0.5 ghosts it against the original.