Save Transparent Video
Getting alpha out of ComfyUI without the pipeline fight
- images
- masks
- file_path
Saving video with transparency in ComfyUI has historically been a scavenger hunt: the native video save nodes mostly don't do alpha, and the ones that do each insist on their own pipeline. Save Transparent Video is the TrentNodes answer - you hand it an image batch, optionally a mask, and it writes a transparent video in one of three formats. No ffmpeg command-line acrobatics.
Where this shows up in practice: you've matted a subject (BiRefNet, a keyer, an alpha-composited green screen result), and you need to hand it to After Effects, DaVinci, or a browser without baking in a background you'll have to key out again. That's exactly the case this node exists for.
The three formats, and when each is right
webp(default) - animated WebP. Good compression, plays in browsers, fine for previews and web delivery.quality1-100 controls the lossy quality.mov_prores4444- ProRes 4444 MOV. Lossless, for DaVinci Resolve / After Effects. This is the one you want when the deliverable matters; it's the format video editors actually expect for alpha.png_sequence- individual RGBA PNGs. The universal lossless fallback, and the easiest to debug because every frame is a file you can open.
fps and filename_prefix (which supports ComfyUI variables like %date:yyyy-MM-dd%) round out the required inputs.
How alpha is decided
This is the part to read twice, because it's the source of most confusion. The alpha comes from, in priority order:
- A connected
masksinput (white = opaque, black = transparent) - overrides anything already in the images - The 4th channel of RGBA images if
C=4 - Fully opaque, if neither - which means a plain RGB batch saves as an opaque video, exactly as you'd expect
So if you're working with a mask somewhere in your graph, wire it straight into masks and stop worrying about what your upstream decoder did with it. The mask is the authoritative source when it's connected. Single-frame masks broadcast across the batch, and masks auto-resize to the frames - both things you'd otherwise be doing by hand.
The one output, and the honest gotchas
Output is a single file_path STRING, so you can feed the saved location into another node (a file-uploader, a captioner, whatever) instead of guessing where ComfyUI put it.
Gotchas worth knowing:
- ProRes 4444 is huge. That's the price of lossless, but budget your disk before you render a long clip.
- Animated WebP support varies by editor - fine in browsers, but don't assume your NLE reads it. That's what
mov_prores4444is for. - If your frames have an alpha channel and you connect a mask, the mask wins. If that looks wrong, check whether your mask is inverted (white = opaque is the convention here).
Install
Part of the TrentNodes pack (TrentHunter82/TrentNodes):
# ComfyUI Manager: search "Trent Nodes"
# or:
cd ComfyUI/custom_nodes
git clone https://github.com/TrentHunter82/TrentNodes.git
cd TrentNodes && pip install -r requirements.txt
The compositing is GPU-accelerated, and it depends only on the pack's core requirements (opencv, numpy, pillow) - no extra model downloads. It's the "last node in the chain" that finally lets you ship the matte instead of a screenshot of it.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Image batch [N, H, W, C]. If C=4 the 4th channel is used as alpha unless a MASK is connected. | |
| filename_prefix | STRING | ComfyUI_alpha | Output filename prefix. Supports ComfyUI variables like %date:yyyy-MM-dd%. |
| format | COMBO | webp | webp: animated WebP, good compression, browser-ready. mov_prores4444: lossless for compositing. png_sequence: individual RGBA PNGs. |
| fps | FLOAT | 24.001–120 | Frames per second. |
| quality | INT | 801–100 | Quality 1-100. For WebP controls lossy quality. Ignored for PNG and ProRes. |
| masksopt | MASK | Optional alpha mask [N, H, W]. Overrides any alpha already in the images. White = opaque, black = transparent. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| file_path | STRING | — |