MaskedRegionVideoExport
Burn a Mask Into a Video With Real Alpha
- images
- masks
- video_path
Most "video from frames" exporters in ComfyUI just write a flat video. MaskedRegionVideoExport writes one where your mask becomes alpha - so the region outside it is genuinely transparent, not just black or cropped. If you've ever needed a cut-out foreground as an actual video file with a transparent background, this is the node you were missing.
You feed it images (an IMAGE batch of frames) and masks (a MASK batch, one per frame - it hard-fails if the counts don't match). Every frame becomes an RGBA frame where the mask is the alpha channel. Two format choices, and they're the whole story:
webm- VP9 (libvpx-vp9) withyuva420p, so you get true transparency that plays in a browser. The default, and usually the right call for anything that'll live on the web.prores_mov- ProRes 4444 with 10-bityuva444p10lealpha, the professional-interchange pick for compositing in Resolve/Premiere. Heavier, bigger, but lossless enough for a real edit pipeline.
The rest of the inputs: fps (default 16, up to 120), filename_prefix (default masked_video - files are written to your output directory with an auto-incrementing _000 suffix so you never clobber an earlier export), and flip_mask, which inverts the alpha when your mask is "keep everything except this region."
The gotcha that gets everyone
This node shells out to the ffmpeg binary - it builds an ffmpeg command and pipes raw RGBA frames into it. That means ffmpeg must be on your PATH, and it is not in the pack's requirements.txt. If you're on the ComfyUI Windows portable build you're fine (ffmpeg ships with it). On Linux or a bare Python venv, ffmpeg not being installed shows up as a cryptic "ffmpeg failed" RuntimeError - install it first:
# Ubuntu/Debian
sudo apt install ffmpeg
# or your package manager's equivalent
Installing it
It's part of the Eden.art nodesuite (edenartlab/eden_comfy_pipelines). ComfyUI Manager → search "Eden" → install, or:
cd ComfyUI/custom_nodes/
git clone https://github.com/edenartlab/eden_comfy_pipelines.git
cd eden_comfy_pipelines
pip install -r requirements.txt
Restart, find it under Video. The pack's shared dependencies are heavy (clip-interrogator, transformers, scikit-image, opencv-python), most of which this node never touches - they're the price of installing the whole suite.
Common issues
Beyond the ffmpeg dependency: mask values are taken at face value - if your masks are subtle gradients instead of hard 0/1, you'll get semi-transparent regions, which is sometimes exactly what you want and sometimes a surprise. And the node returns a video_path STRING (it's an output node), so wire that into a text display or downstream node if you want to know where the file landed. Watch the frame count: long sequences through VP9 encoding can be slow, and a fps above the data you actually have just writes a video that plays faster, it doesn't interpolate.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| masks | MASK | — | |
| fps | INT | 161–120 | — |
| filename_prefix | STRING | masked_video | — |
| flip_mask | BOOLEAN | false | — |
| format | COMBO | 2 options: webm, prores_mov |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| video_path | STRING | — |