How to use Masked Composite
- Add a video as the source.
- You can also add more videos if you want to guide the result. This is optional.
- Adjust the settings, or keep the defaults.
- Choose Open in a workflow. Sign in, check the credit estimate on the board, then run it.
- Connect the result to the next step on the board, such as an editor or another model.
Inputs explained
- Video (required)
- Set the video used by this model. Type: video.
- Mask (white = region) (required)
- Set the mask (white = region) used by this model. Type: video.
- Fill Video (mode: video) (optional)
- Set the fill video (mode: video) used by this model. Type: video.
- Fill (optional)
- Set the fill used by this model. Type: text. Options: blur, solid, video, cutout. Default: "blur".
- Fill the mask itself (optional)
- Set the fill the mask itself used by this model. Type: boolean. Default: false.
- Blur strength (sigma px, 1-200; blank = 24) (optional)
- Set the blur strength (sigma px, 1-200; blank = 24) used by this model. Type: number.
- Solid colour (hex; blank = #808080) (optional)
- Set the solid colour (hex; blank = #808080) used by this model. Type: text.
- Cutout format (mode: cutout) (optional)
- Set the cutout format (mode: cutout) used by this model. Type: text. Options: webm_vp9, prores. Default: "webm_vp9".
- Despeck (drop mask pieces under this % of the frame, 0-1; new nodes start at 0.002; blank or 0 = keep all) (optional)
- Set the despeck (drop mask pieces under this % of the frame, 0-1; new nodes start at 0.002; blank or 0 = keep all) used by this model. Type: number.
- Largest region only (keep one subject per frame) (optional)
- Set the largest region only (keep one subject per frame) used by this model. Type: boolean. Default: false.
- Grow mask (px, -40 to 40, negative shrinks; blank = 0) (optional)
- Set the grow mask (px, -40 to 40, negative shrinks; blank = 0) used by this model. Type: number.
- Feather (px, 0-50; blank = 0) (optional)
- Set the feather (px, 0-50; blank = 0) used by this model. Type: number.
- Invert (hide everything except the region) (optional)
- Set the invert (hide everything except the region) used by this model. Type: boolean. Default: false.
- Overlap report (list frames where the video touches the mask) (optional)
- Set the overlap report (list frames where the video touches the mask) used by this model. Type: boolean. Default: false.
- Quality (CRF, 12 best … 30 smallest; blank = 18) (optional)
- Set the quality (crf, 12 best … 30 smallest; blank = 18) used by this model. Type: number.
Tips before you run
Start with the default settings and change one input at a time. Keep the result you like on your board so the next step can use it.
If you add a reference file, use a link the workflow can read. Check the inputs and credit estimate on the board before starting a run.
Masked Composite pricing
Masked Composite is free to run on Wireflow.
See Wireflow plans and credits
Masked Composite API
Run Masked Composite from your own code with the Wireflow API. Open it in a workflow, then call the run endpoint with that workflow's ID and poll for the result. Agents can run it through MCP.
# Model: Masked Composite. Open a workflow first.
# Replace YOUR_WORKFLOW_ID with the ID in its /flow/ URL.
curl 'https://www.wireflow.ai/api/v1/workflows/YOUR_WORKFLOW_ID/run' \
-H 'Authorization: Bearer YOUR_WIREFLOW_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"nodeIds":["model"]}'
# Response (202):
# {"data":{"executionId":"...","status":"running",
# "poll":"/api/v1/workflows/executions/.../poll"}}
# GET the returned poll path with the same Authorization header.Read the run API docs or connect your agent.
Read the Masked Composite docs
Working with this model
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.
- cutout: the opposite of a hide. The clip is kept where the mask is white and everything else is transparent, so the result is a layer, not a frame.
Recipe: cut an object out as a Video Editor layer (rotoscoping)
Any object SAM 3 can track becomes its own transparent video file, the object alone over a transparent background with its own pixels unchanged inside the mask:
- Import (your clip) into Segment Mask with the object as the prompt
(
red car,dog,the man in the hat). - Wire the same Import into Masked Composite's Video, and Segment Mask's output into Mask. Fill: cutout.
- Wire Masked Composite's output into the Video Editor. It lands on a
layer_Nport as a video.
What the wire does NOT do yet: the Video Editor adds a newly wired video as
its own full-frame SCENE after the ones already there, so the cutout plays
after the clip, not on top of it. To stack it, put it on a track over the clip
yourself: in the editor, or with edit_video_timeline as a kind: "video"
track clip whose src is {{layer_N}}, timed to the clip's scene, and
move or scale it with that clip's x, y and scale (or keyframes).
Under it goes the original clip, or a clean plate (the same clip through Masked
Composite with Fill blur or solid hides the object there).
Browsers decode the WebM's alpha, and the board preview plays it over a
checkerboard. Neither the editor's player nor a rendered MP4 has been checked
with a cutout on a track yet: look at it with preview_video_frames before
you rely on its alpha.
The dials work as they do for a hide, read for a keep:
- Invert keeps everything EXCEPT the object (a hole where it was).
- Grow mask takes in a few more pixels of the object's edge (negative trims it), before the feather.
- Feather becomes a soft alpha edge instead of a hard cut.
- Despeck and Largest region only drop stray mask pieces, so a speck the prompt caught in the background does not ride along as a floating dot.
Cutout format picks the file:
- WebM / VP9 (default): VP9 with an alpha channel. Browsers and the board
preview decode the alpha. ffmpeg's default vp9 decoder
does not and shows the clip as if it were flat: read it with
ffmpeg -c:v libvpx-vp9 -i cutout.webm(andffprobe -c:v libvpx-vp9reportsyuva420p). - ProRes 4444: a .mov with a real 4:4:4 alpha, for After Effects, Premiere, Resolve or Final Cut. Chrome cannot play ProRes, so the board shows no video for it; use WebM for anything that stays in Wireflow. ProRes files are big (about 1 byte per pixel per frame on real footage, 2.6 on grain), and the run is refused before the encode when 2.6 would pass 600 MB: about 8 s of 720x1280 at 30 fps, under 4 s of 1080x1920. Trim it or use WebM.
A cutout has no audio: its sound stays on the clip it came from, which is usually the track under it. The run checks the encoded file before it calls it done: outside the mask the alpha must be 0, inside it 255 with the clip's own pixels, on three sampled frames. Free, like every Masked Composite run.
Recipe: fill or grow the mask itself
To deliberately use the same mask file in Video and Mask, turn on Fill the mask itself, choose solid, and set an explicit Solid colour. Solid mode and a colour alone do not opt in. The processed mask is filled over black, so no original pixels leak through its edges. Grow mask (including negative shrink), Feather, Despeck, Largest region only, and Invert all apply. This setting requires the same file in both inputs; turn it off when compositing over a separate clip.
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:
- Import (your reference clip) into Segment Mask with the prompt
face. - 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).
- 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.
Recipe: paste real hands back over a hidden head
A hand that passes the hidden head comes back from Seedance as a grey patch. Put the real hands back before the take:
- Segment Mask with the prompt
hand(detection threshold 0.3) on the clip. - Masked Composite: the hand mask into Video, the head mask into Mask,
Fill solid, colour
#000000, Grow mask 6. That is the hand mask minus the head. Turn on Overlap report. - Masked Composite: the head-hidden clip into Video, step 2's output into Mask, the clip into Fill Video, Fill video, grow 4, feather 3.
The Overlap report on step 2 lists the frame ranges where a hand touches
the head (within the grow plus 2 pixels), for example
touching in 1 range: 8.42-8.79 s. Those are the seconds to crop-zoom on
when you grade the take. It runs one extra pass over the two masks and costs
nothing.
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.
Despeck: specks the grow would turn into squares
A Segment Mask output often carries isolated specks, single pixels a long way from the subject. Grown 40 px, each one becomes a solid square about 80 px across, and the next model paints over it. So before the grow, the mask's separate pieces smaller than Despeck (a percent of the frame) are dropped:
- a new node starts at 0.002% of the frame: about 18 px on a 720x1280 mask, 41 px on 1080x1920. Measured on real Segment Mask outputs, every speck was 1 to 5 px. Real pieces were almost all over 50 px; the few smaller ones were finger fragments a few pixels from their hand, which a grow covers anyway;
- blank or 0 keeps every speck. A node added before Despeck existed has it blank, so it runs exactly as it always did; type 0.002 to turn it on;
- raise it only for a mask with bigger junk, and check the card: a real subject smaller than the threshold is dropped too.
A piece is everything connected to it above the mask's black, soft edge included. So anything attached to the subject stays exactly as it was, a 1 px hair strand or a finger included, and a mask with no specks comes through unchanged, pixel for pixel. Faint compression noise in the black counts as specks too and goes with them.
Largest region only keeps just the biggest piece in each frame. Use it on a single-subject swap when the prompt also caught something else (a "head" prompt that found a chef figurine on the counter). It decides frame by frame, so if the subject is ever smaller than the other thing, that frame keeps the wrong one.
The card says what was dropped ("dropped 394 bright specks and 5942 faint flecks, largest 17 px, in 268 of 268 frames"), and how many frames held only pieces that small and now hide nothing.
Only the part of the mask the composite uses (the clip's length) is cleaned. The cleanup takes a share of the run's time and scratch disk; when a long or heavy mask would not fit in what is left, it is skipped, the mask is used as wired, and the card says "SKIPPED" with the reason, rather than failing a run that would have worked without it.
Why the rest of the frame does not change
With Fill the mask itself on, the base is black. The preservation guarantee below applies when compositing over a separate clip.
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 fill wherever the region had to change. Pixels where the clip already showed the fill (a second composite with the same take, say) are not counted either way. 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 is free: it quotes and charges 0 credits.
Masked Composite FAQ
What is Masked Composite?
Masked Composite is a Wireflow workflow tool. Hide a region of a video behind a mask, EXACTLY, or cut it out as a transparent layer.
Is Masked Composite free?
Yes. Masked Composite is free to run on Wireflow.
Can I use Masked Composite commercially?
Yes. What you make with Masked Composite on Wireflow is yours to use for personal and commercial work, subject to the model maker's own terms. Our terms of service have the details.
Does Masked Composite have an API?
Yes. Save a workflow with Masked Composite, then call the Wireflow run API with its workflow ID. The API tab above has examples you can copy, and agents can run it through MCP.
How do I use Masked Composite?
Set the inputs above and choose Open in a workflow. Sign in to save your board, then check its credit estimate before you run.
