Mask Composite
Place a foreground video over a background through a mask video, or pixelate or blur the masked area to hide faces. It runs on every edition without a key.
The Mask Composite node places a foreground video over a background video through a mask video. Where the mask is white, you see the foreground. Where the mask is black, you see the background, and grey blends the two. Mask Composite runs no AI model, so the same inputs always give the same result. With Fill set to Pixelate or Blur, the node needs no foreground: it pixelates or blurs the background itself inside the mask, for example to hide faces, number plates or screens.
Its natural partner is Video Mask. Mask a subject in its own footage with Video Mask, then use that footage as the foreground and any other video as the background. The subject then appears in the new scene.
Mask Composite needs no provider key, so it runs on every edition, including a Community Edition install without any keys.
When to use it
- Move a subject into a new scene, for example a dancer onto a beach.
- Replace the background behind a product or a presenter.
- Keep everything except the subject, with Invert mask, and put a new subject in its place.
- Combine two clips through a black-and-white matte made in another tool.
- Hide faces, number plates or screens in a clip: set Fill to Pixelate or Blur, and use a Video Mask of them as the mask.
Quick start
Add the node
Press Tab on the canvas and choose Video › Cut & Assemble › Mask Composite.
Connect the three videos
Wire the footage with the subject into Foreground, the new scene into Background, and the mask video into Mask, for example the Mask output of a Video Mask node.
Adjust the edge
Open the settings panel. Keep Feather at 2 pixels for a soft edge, and set Grow / shrink below 0 if a thin line of the old background shows around the subject.
Run it
Click Run on the node. The composited video appears on the node.
To blur a subject in place, wire the same video into Background and into a Video Mask, and set Fill to Blur. No foreground is needed.
Inputs
| Input | Accepts | What it does |
|---|---|---|
| Foreground | Video nodes, such as Upload Video and Generate Video | The footage whose white-masked region is kept. The result has its size, frame rate and length. Required when Fill is Video (the foreground). Not used with Pixelate or Blur: the input shows muted, and a video wired into it is ignored. |
| Background | Video nodes | The video shown where the mask is black. Required. |
| Mask | Video nodes, such as Video Mask | The mask video. White shows the foreground, black shows the background. Required. |
The background is fitted to the foreground's frame, as Background fit sets, and loops when it is shorter than the foreground. The mask is stretched to the foreground's frame and holds its last frame when it is shorter. Near-black counts as fully background and near-white as fully foreground, so compression noise never leaves a faint ghost.
With Pixelate or Blur, the result follows the background instead: its size, frame rate and length. The background is not fitted and does not loop.
A video link must point at an ordinary video file, not a streaming playlist (HLS or DASH). Such a link is refused before anything is charged. See Media links.
Outputs
| Output | What it carries |
|---|---|
| Video | The composited video, an MP4 with the foreground's size, frame rate and length. It has sound when the Audio setting keeps a track. With Pixelate or Blur, it has the background's size, frame rate, length and sound. |
The result is never watermarked.
Settings
| Setting | What it does |
|---|---|
| Fill | What fills the masked area. Video (the foreground) is the default. Pixelate shows the background in square blocks, and Blur shows the background blurred. Pixelate and Blur take no foreground. |
| Block size (% of width) | Pixelate only. The size of each block as a share of the video's width, from 0.2 to 10 %, so it looks the same at any resolution. The default is 1.25 %: 16-pixel blocks on a 1280-pixel-wide video and 24-pixel blocks on 1920. Each block is the average colour of the pixels it covers. |
| Blur strength (% of width) | Blur only. How strongly the masked area is blurred, as a share of the video's width, from 0.1 to 5 %. The default is 2 %. |
| Invert mask | Swaps the sides: white shows the background and black shows the foreground. Use it to keep everything except the subject. Off by default. |
| Feather | Softens the mask's edge, from 0 to 20 pixels. The default is 2. At 0 the edge is hard. A few pixels hide the steps along the edge of a tracked mask. |
| Grow / shrink | Widens (a positive value) or narrows (a negative value) the white area, from −10 to 10 pixels, before the edge is softened. The default is 0. A negative value trims a thin line of the old background around the subject. |
| Opacity | How strongly the fill covers the background inside the mask, from 0 to 100 %. The default is 100 %, which replaces the background there. A lower value blends the fill and the background. Outside the mask, you always see the background. |
| Background fit | How the background fills the foreground's frame. Cover (crop to fill), the default, fills the frame and crops what does not fit. Contain (letterbox) shows the whole background with black bars. Stretch stretches the background to the frame. Hidden with Pixelate or Blur. |
| Audio | Which sound the result has. Foreground audio is the default. The other choices are Background audio, Mix both, at equal level, and No audio. When the chosen track does not exist, the result is silent. Mix both with only one track uses that track. Hidden with Pixelate or Blur: the result then always has the background's sound. |
Limits
- Length: a foreground up to 300 seconds long. With Pixelate or Blur, a background up to 300 seconds long.
A foreground that Nodaro cannot read, or one longer than 300 seconds, is refused before anything is charged.
Which file the node reads
Some video models deliver an HDR, 10-bit or HEVC file. Nodaro keeps that file as the result's original, beside a copy your browser can play. See Output files. When such a result is connected, Mask Composite works from the original, not from the copy, and outputs an 8-bit H.264 MP4.
- HDR becomes SDR. An HDR picture (HLG or PQ) is converted to SDR first, with the same conversion as the playable copy, so the result looks like the clip you played. An HDR video you upload is converted the same way. The job's output then says so, with the warning code
hdr_tone_mapped. - The playable copy is the fallback. If the original cannot be used, the node works from the playable copy. This happens when the original is gone, is over the node's download limit, or cannot be converted in time. All conversions in one run get up to 15 minutes together.
- The price is the same either way.
Credits
Mask Composite costs 11 credits for every started 5 seconds of the result. The result is as long as the foreground, or as the background with Pixelate or Blur. A run counts at least one 5-second step: a 3-second result counts one step, a 10-second result counts two, and a 61-second result counts 13. Up to 0.05 seconds past a whole second is ignored first, so a 10.01-second result counts two steps, not three.
- Before a run, the Run button, the node's price and a workflow estimate (in the editor, and on the server through
POST /v1/credits/estimate-workflowand MCP) all read the same length of the leading video. The leading video is the foreground, or the background with Pixelate or Blur. When the length is not known, they quote the price of a 300-second result, the longest the node takes. - A video you upload or add from the Library is quoted at the length recorded for it. A length that may describe another file is not read: the full length of a Video link, and the length kept from a file whose link was replaced since, are quoted at the 300-second price. A Library video added before its length was recorded is quoted at that price too. Add it again to quote its length.
- A video another node makes in this run is quoted at the length that node will produce. A generation counts at its set length, or at its model's longest clip on Auto. A step whose length follows its input, such as Lip Sync, counts at that input's length. An Extend Video counts at its source plus the seconds it adds. Trim Video, Loop Video and Combine Videos count by their own rules.
- A length or a model that another node sets, such as a Text, Duration or Provider node, is read as the run reads it. A value that another node produces during the run, such as an LLM's answer, is not known yet, so the generation is quoted at the longest clip it can render.
- Each clip made on the way adds 0.15 seconds, because a made clip runs a little past its planned length. The 0.05 seconds the price ignores past a whole second are ignored on the quote and the charge alike. For example, a Face Swap of a 9.92-second upload is quoted at 10.07 seconds, 3 units. A step that re-renders its input, such as Face Swap, Video Retake or Video Upscale, adds the same. A step that only passes its input on, such as a Resize, a Fade or a Trim, adds none. A Dubbing, a Voice Extractor or a PixVerse V6 extension adds a quarter second instead, because their files run further past their planned length. So the quote is never below the charge.
- A node that does not run in this run, such as a skipped node or Manual Edit, is quoted at the length recorded with the result it already holds.
- Unknown is the cap. A VEO or Runway extension, a Combine Videos with a clip of unknown length, and a step whose length no rule bounds are quoted at the 300-second price.
- While the length is not known, the node shows a range, from the price of one 5-second step up to the price of a 300-second result.
- Measured before the charge. The API and a workflow run measure the leading video before anything is reserved. A video they cannot read is refused with
invalid_video_duration, and one over 300 seconds withvideo_duration_exceeds_limit. You pay for the length the run measures. - Measured again at the render. A video up to about half a second longer than the length the run was charged for is the same file. A longer one, such as a link that now serves a longer video, is refused before anything is drawn, and the charge is refunded. The message reads
The foreground video is 30 seconds, longer than the 10 seconds this run was priced for — run it again(The background video is …with Pixelate or Blur).
Tips
- Trim the foreground first. The result is as long as the foreground, so cut it to the moment you need with Trim Video.
- Use a background at least as long as the foreground. A shorter background loops, which can show a visible jump.
- Trim halos with a negative grow. Set Grow / shrink to a small negative value when a thin line of the old background shows around the subject.
- Keep a little feather. A few pixels of Feather hide the steps along the edge of a tracked mask.
- Hide detail with a bigger block. With Pixelate, a larger Block size (% of width) hides more detail.
- Any matte works. A black-and-white or greyscale video from another tool, such as a rendered shape animation, works as the mask.
Troubleshooting
The subject has a thin outline of the old background. Set Grow / shrink to a small negative value, and keep some Feather.
The background shows where the subject should be. The mask has the opposite polarity. Turn on Invert mask.
The result has no sound. The track chosen under Audio does not exist in that video. Choose the other video's audio, or Mix both.
The background has black bars or is cropped. Change Background fit. Cover (crop to fill) crops, Contain (letterbox) adds bars, and Stretch fills the frame without either.
From the API
POST /v1/mask-composite takes foregroundUrl, backgroundUrl and maskUrl. The optional settings are invertMask, feather (0 to 20), grow (−10 to 10), opacity (0 to 1, default 1) and fill (video, pixelate or blur, default video). They also include pixelSizePct (0.2 to 10, default 1.25), blurStrengthPct (0.1 to 5, default 2), backgroundFit (cover, contain or stretch) and audioSource (foreground, background, mix or none). It returns a job. foregroundUrl is required with the video fill. With pixelate or blur, a foreground that is sent is ignored, and audioSource is ignored. The finished job's output carries videoUrl, thumbnailUrl, width, height and durationSec. A foreground longer than 300 seconds is refused with a 400 error before anything is charged.
- SDK:
maskComposite({ foregroundUrl, backgroundUrl, maskUrl, invertMask, feather, grow, opacity, fill, pixelSizePct, blurStrengthPct, backgroundFit, audioSource }). See Media and uploads. - MCP: the
mask_compositetool takes each of the three videos as<name>_urlor<name>_asset_id(foreground,background,mask), so avideo_maskjob id can be themask_asset_id. The settings areinvert_mask,feather,grow,opacity,fill,pixel_size_pct,blur_strength_pct,background_fitandaudio_source. See the MCP tools. - CLI:
nodaro media mask-composite <foregroundUrl> <backgroundUrl> <maskUrl> [--invert] [--feather <px>] [--grow <px>] [--background-fit cover|contain|stretch] [--audio foreground|background|mix|none]. To pixelate or blur:nodaro media mask-composite <backgroundUrl> <maskUrl> --fill pixelate|blur [--pixel-size-pct <pct>] [--blur-strength-pct <pct>]. See Media and voice commands.
See Run a single node and Jobs.
Frequently asked questions
What does the Mask Composite node do?
Mask Composite combines three videos into one. Where the mask is white, you see the foreground video. Where the mask is black, you see the background video, and grey blends the two.
Can Mask Composite blur or pixelate faces in a video?
Yes. Set Fill to Pixelate or Blur. The masked area then shows the background video itself, pixelated or blurred, and no foreground is needed. Use a Video Mask of the faces as the mask.
Where do I get the mask video?
The usual source is a Video Mask node, which tracks a subject that you describe through the foreground video. Any black-and-white or greyscale video works as the mask, for example a matte made in another tool.
What if the background is shorter or a different size?
The result follows the foreground's size, frame rate and length. The background is fitted to the foreground's frame and loops when it is shorter. The mask is stretched to the frame and holds its last frame when it is shorter.
How much does Mask Composite cost?
Mask Composite costs 11 credits for every started 5 seconds of the result. The result is as long as the foreground, or as the background with Pixelate or Blur, up to 300 seconds.
Does Mask Composite need an API key on a self-hosted install?
No. Mask Composite runs no AI model and needs no provider key, so it runs on every edition, including Community Edition without any keys.
Related
Video Mask
Composite
Relight & Switch
Trim Video
Upload Video
Last updated on
Composite
Layer up to four videos into one composition with per-layer position, blend mode, opacity and timing. It costs no credits; Render Video turns it into an MP4.
Compose Video
Describe the video you want, and an AI model arranges your connected images, clips and audio into a timed, multi-track composition that Render Video renders.