Matte · 人像抠图
Cut your subject out of arbitrary video, background and all
- video
- video
Portrait matting is the harder sibling of the greenscreen node: no clean keyable background to help, just "find the person and remove everything else." This node does exactly that - identifies the human subject, strips the background, and returns a transparent-background video. It's the move for talking heads, vlogs, and any shot where you want the subject lifted out of a busy scene and dropped onto something else.
The inputs (there's almost nothing to set)
output_format-WEBM(default) orMOV, the two transparent containers. As with the greenscreen node, pick by what's downstream: WEBM for web and general ComfyUI use, MOV for editing software. That's the whole decision - there are no threshold knobs, no edge-sensitivity sliders. The model decides where the person ends.- Plus
videoand the usualpoll_interval_seconds(default 10) /max_poll_attempts(default 720).
The single output is video, a native VIDEO with alpha, into a Save Video node.
How it works
Identical cloud plumbing to the rest of the pack - the clip becomes a temp file, mediakit-cli submits an async portrait-matting task to your MediaKit account, the node polls, downloads the transparent result, and returns it as a native VIDEO. Segmentation happens server-side; your machine does nothing but upload and wait, and each run bills your account.
Install and the cloud setup
ComfyUI Manager, search "MediaKit Toolkit" / mediakit-toolkit, full restart - or:
cd ComfyUI/custom_nodes
git clone https://github.com/fudanll-sys/comfyui-mediakit-toolkit.git
No Python dependencies, no model downloads - the segmentation weights live on Volcengine. You need a Volcengine account with AI MediaKit activated, an API key, and the CLI installed and authed in the environment that starts ComfyUI:
npx @volcengine/mediakit-cli install -y
mediakit-cli init --mode cloud-first --api-key "YOUR_MEDIAKIT_API_KEY" --credential-store config --yes
Choosing between the two matte nodes
This is the fork people get wrong. If your footage is genuinely shot against green or a solid color, use Matte · 绿幕抠图 - a keyable background is an easy job for the segmentation model, and you want the edge quality it buys. If the background is arbitrary - an office, a street, a room - this is the node, because greenscreen mode has nothing to key on. The realistic failure mode here is hair: on busy backgrounds with flyaway strands or semi-transparent edges, expect occasional edge wobble across frames, and the cloud model will be better or worse than the local free options (BiRefNet and friends are excellent for images) precisely because it's keeping alpha consistent across a sequence. Test a short clip before committing a long one - it's the cheapest insurance against a surprise bill on a render you can't use.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| video | VIDEO | — | |
| output_format | COMBO | WEBM | 透明视频输出格式。 |
| poll_interval_seconds | INT | 102–60 | — |
| max_poll_attempts | INT | 7201–5000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| video | VIDEO | — |