---
title: "Masked Composite"
description: "Hide a region of a video behind a mask, EXACTLY. Wire the clip into `video` and a black-and-white mask video into `mask` (white = the region, e.g. a Segment Mask output), then pick a `mode`: `blur` (a Gaussian blur of the clip itself, strength = sigma in pixels), `solid` (a flat `color`), or `video` (a second clip wired into `fill` shows through the mask, e.g. a depth map for character-isolated depth). The face-hide recipe for Seedance reference swaps is Segment Mask (prompt \"face\") into this node, so identity can only come from your stills. Unlike Video Blend this never shifts the colours of the rest of the frame: the composite runs in the clip's own 4:2:0 planes and pixels outside the mask pass through untouched; only the final x264 encode (CRF 18 default) sees them. `grow` moves the mask's edge BEFORE the feather, in output pixels: positive grows the white region, negative shrinks it (-40 to 40, blank = 0; measured as a square, so a diagonal edge moves up to 1.4x as far). On a person swap, grow a few pixels past the feather so the original subject's outermost pixels are covered instead of mixed back in as a thin dark outline. `feather` softens the edge over about that many pixels each side; `invert` hides everything EXCEPT the region (grow acts on the region before the invert). Output is the base clip's size, frame rate and length, with its audio stream-copied. The mask is scaled to the clip (refused if its shape differs by more than 2%), and refused if it is shorter than the clip, since holding its last frame would uncover the region; a shorter fill holds its last frame, a longer mask or fill is cut. Clips over 30 seconds are refused. Calls a Lambda whose cost is operational and absorbed: this node quotes and charges 0 credits."
updated: 2026-10-04
---

# Masked Composite

**Node type:** `utility:video_masked_composite`  
**Category:** `Editing`

## Description

Hide a region of a video behind a mask, EXACTLY. Wire the clip into `video` and a black-and-white mask video into `mask` (white = the region, e.g. a Segment Mask output), then pick a `mode`: `blur` (a Gaussian blur of the clip itself, strength = sigma in pixels), `solid` (a flat `color`), or `video` (a second clip wired into `fill` shows through the mask, e.g. a depth map for character-isolated depth). The face-hide recipe for Seedance reference swaps is Segment Mask (prompt "face") into this node, so identity can only come from your stills. Unlike Video Blend this never shifts the colours of the rest of the frame: the composite runs in the clip's own 4:2:0 planes and pixels outside the mask pass through untouched; only the final x264 encode (CRF 18 default) sees them. `grow` moves the mask's edge BEFORE the feather, in output pixels: positive grows the white region, negative shrinks it (-40 to 40, blank = 0; measured as a square, so a diagonal edge moves up to 1.4x as far). On a person swap, grow a few pixels past the feather so the original subject's outermost pixels are covered instead of mixed back in as a thin dark outline. `feather` softens the edge over about that many pixels each side; `invert` hides everything EXCEPT the region (grow acts on the region before the invert). Output is the base clip's size, frame rate and length, with its audio stream-copied. The mask is scaled to the clip (refused if its shape differs by more than 2%), and refused if it is shorter than the clip, since holding its last frame would uncover the region; a shorter fill holds its last frame, a longer mask or fill is cut. Clips over 30 seconds are refused. Calls a Lambda whose cost is operational and absorbed: this node quotes and charges 0 credits.

## Canvas ports

These appear as port handles on the left side of the node.

| ID      | Label                        | Details              |
| ------- | ---------------------------- | -------------------- |
| `video` | **Video**                    | `VIDEO` _(required)_ |
| `mask`  | **Mask (white = region)**    | `VIDEO` _(required)_ |
| `fill`  | **Fill Video (mode: video)** | `VIDEO`              |

## Sidebar config

These render as form fields in the right-side config panel when the node is selected.

| ID        | Label                                                      | Details                                    |
| --------- | ---------------------------------------------------------- | ------------------------------------------ |
| `mode`    | **Fill**                                                   | `TEXT` · options: `blur`, `solid`, `video` |
| `blur`    | **Blur strength (sigma px, 1-200; blank = 24)**            | `NUMBER`                                   |
| `color`   | **Solid colour (hex; blank = #808080)**                    | `TEXT`                                     |
| `grow`    | **Grow mask (px, -40 to 40, negative shrinks; blank = 0)** | `NUMBER`                                   |
| `feather` | **Feather (px, 0-50; blank = 0)**                          | `NUMBER`                                   |
| `invert`  | **Invert (hide everything except the region)**             | `BOOLEAN`                                  |
| `crf`     | **Quality (CRF, 12 best … 30 smallest; blank = 18)**       | `NUMBER`                                   |

## Outputs

| ID      | Label                | Type    |
| ------- | -------------------- | ------- |
| `video` | **Composited Video** | `VIDEO` |

## What it is for

Hide one region of a clip and leave the rest of the frame exactly as it was.
Wire the clip into **Video** and a black-and-white mask video into **Mask**.
White is the region. Then pick what goes there:

- **blur**: a Gaussian blur of the clip itself. **Blur strength** is the sigma
  in pixels (default 24); raise it on 4K footage.
- **solid**: one flat **Solid colour** (default `#808080`).
- **video**: a second clip wired into **Fill Video** shows through the mask.

## Recipe: hide the source face before a Seedance swap

Seedance 2.5 in reference mode copies whatever face it can see in the reference
video, even when your stills show someone else. Take the face away and identity
can only come from the stills:

1. Import (your reference clip) into **Segment Mask** with the prompt `face`.
2. Wire the same Import into Masked Composite's **Video**, and Segment Mask's
   output into **Mask**. Fill: **blur** (the shot still reads as a person) or
   **solid** (nothing left to copy at all).
3. Wire Masked Composite's output into Seedance's reference video port, next to
   your character stills.

No Segment Mask on your canvas yet? Any black-and-white mask video made from the
same clip works in its place.

A few pixels of **Feather** hide the edge if the result is also something people
watch. For a model input it does not matter.

## Recipe: character-isolated depth

Depth inside the person, real footage everywhere else: Segment Mask (prompt
`person`) into **Mask**, Depth Map (Video) of the same clip into **Fill Video**,
Fill: **video**. Seedance then gets the real room and camera but only a depth
silhouette of the performer.

## Grow: the dark outline on a person swap

A segmentation mask hugs its subject's edge, and **Feather** softens that edge
both ways. So on a person swap the original subject's outermost pixels end up
half inside the blend and show as a thin dark outline around the new performer,
and anything the mask missed (a dangling strap) stays in the shot.

**Grow mask** moves the mask's edge before the feather, in pixels of the output:

- positive grows the white region. Set it a few pixels past the feather
  (feather 8, grow 12) and the old outline is covered, not blended;
- negative shrinks it, for a mask that spills past its subject;
- blank or 0 uses the mask as wired.

It is measured as a square, so a diagonal edge moves up to 1.4 times as far as
a straight one. Thin parts grow like the rest, and a shape touching the frame
edge still touches it after a shrink. The mask is cut at 50% grey first, so a
grown mask has a hard edge until **Feather** softens it. With **Invert** on,
grow still acts on the white region, so a positive grow hides less.

A shrink wider than the mask would erase it and hide nothing (on a face-hide,
the face goes straight to the next model). The run checks for that and fails
with "grow -N erases the mask" when a shrink leaves none, or under 5%, of the
mask; use a smaller shrink. With **Invert** on, a grow that covers the whole
frame fails the same way.

That check looks at only three frames (a quarter, half and three quarters into
the clip) and counts the whole mask, not each subject. So a shrink can still
uncover a subject that is small only between those frames (after a cut to a
wide shot), or a small subject next to a big one (a strap beside a body), and
the run passes. On a face-hide, keep the shrink well under the face's width and
look at the result.

## Why the rest of the frame does not change

Video Blend works on the YUV planes, so a mask blended with `lighten` also
shifts every pixel's colour toward grey (measured: about a 24% saturation drop
over the whole frame). This node never converts the clip. It lays the fill over
the clip in the clip's own 4:2:0 planes, with the mask as the fill's alpha, so a
pixel outside the mask comes out of the composite with the same value it went in
with. The one thing that touches it is the final x264 encode (CRF 18, the same
generation every encode node here costs). Measured on a test clip: mean
difference 0.40 code values outside the mask, against 0.31 for re-encoding the
clip with no composite at all, and no colour shift (saturation ratio 1.000).

Before calling a run done, the node checks its own output: the length must match
the clip's within a frame, and three sampled frames must show the region
actually changed. A run that fails either check is an error, never a clip passed
on as masked.

The mask is cleaned up before it is used: anything at or below 12% grey counts
as outside, anything at or above 88% as fully inside, so compression noise in a
black mask never bleeds into the frame. **Invert** hides everything except the
region.

## Sizes, frame rates and lengths

The output always has the clip's size, frames and length, and its audio is
copied untouched.

- A phone clip recorded in portrait (stored sideways with a rotation flag) is
  used upright, and so is its mask; the output is upright with no rotation flag.
- The mask is scaled to the clip. A mask with a different shape as displayed
  (more than 2% off) is refused, because it was made from a different video and
  would not line up.
- A mask shorter than the clip is refused rather than holding its last frame,
  which would uncover the region for the rest of the clip. A longer one is cut.
- The fill video is scaled to cover the clip and centre-cropped. A shorter fill
  holds its last frame; a longer one is cut.
- Each frame of the clip uses the mask frame at the same moment, so a mask at a
  different frame rate still lines up, and so does a clip whose file does not
  start at zero (.ts recordings, trimmed exports).

## Limits

Clips over **30 seconds** are refused (cut first with Video Trim), as are HDR
clips and inputs over 500 MB. Every adaptation the node made (scaling, a held
frame) is listed on the card after the run.

This node calls a Lambda whose cost is operational and absorbed: it quotes and
charges **0 credits**.

---

_Auto-generated from the Wireflow node registry._

---

Documentation index: fetch https://www.wireflow.ai/llms.txt for the full list of Wireflow docs.
