Nodes/arkennemasis - ChatGPT / Codex / fal AI nodes/arkennemasis Alpha Video Save (transparent WebM)
ComfyUI Node

arkennemasis Alpha Video Save (transparent WebM)

Your cut-out loses its transparency the second you hit Save — this node doesn't

By Hishamahmer·Created 3 months ago·Updated 9 days ago· 11
arkennemasis Alpha Video Save (transparent WebM)
  • images
  • mask
  • path
◄fps25.00►
◄folder—►
◄namecutout►

Alpha in ComfyUI is a weird halfway house. You generate or segment a subject, you keep the mask, the preview looks clean against the dark grey background... and then you save it as a video and the transparency is gone, because every video node in the graph writes H.264 MP4, which has no alpha channel at all. The subject is composited onto black and your editor gets a presenter with a black rectangle behind them.

ArkAlphaVideoSave is the way out. Frames plus a mask in, a VP9 WebM with a real alpha channel out (yuva420p), written to your output folder.

What it's actually for

This is the last step of a cut-out pipeline - a talking head, a product on a turntable, anything you want to drop over another background later. The KB's take on matting applies directly here: background-removal.md makes the point that a segmentation mask is binary by construction, while matting predicts fractional alpha, and that a cutout which looks great against grey falls apart against a coloured background. That distinction survives into this node, because it uses your mask as the actual alpha value rather than thresholding it. Soft, fractional edges stay soft. Crunchy hard edges stay crunchy.

Where the transparency matters: an editor timeline, a HyperFrames-style render, OBS, or a compositor that expects a web-friendly alpha format. VP9 in WebM is the format Chrome plays with alpha natively, and it's small - the node's own notes measure 3.3 MB for 15 seconds of 1080x1920.

How it works

It pipes raw RGBA frames straight into ffmpeg. No intermediate files, no torch-side encoder. The mask (1 = keep, 0 = transparent) is interpolated bilinearly to the frame size if it doesn't match, then concatenated as the fourth channel of each frame, and ffmpeg encodes with libvpx-vp9 at -crf 28, -deadline realtime, -cpu-used 6, -row-mt 1. Realtime deadline is a deliberate speed/quality trade: it encodes fast, and 28 is a reasonably lean CRF, so a busy clip can look slightly soft. For talking heads it's invisible.

One detail worth knowing: if you feed fewer mask frames than image frames, the last mask is repeated for the remaining frames. A single still mask plus a 100-frame batch gives you a static cutout - handy, and not the crash you might expect.

The inputs that matter

  • images - the IMAGE batch to write.
  • mask - 1 = keep, 0 = transparent. Resized to the frames if it differs.
  • fps - default 25, range 1–120. Set this to match the rate you actually rendered at, or your clip plays fast/slow.
  • folder - relative to ComfyUI's output directory. It's a STRING input; in practice you wire the pack's own Run Folder node into it so each run lands in run_001, run_002, and so on.
  • name - defaults to cutout, and becomes <name>.webm.

Output is a single path (STRING). Wire it into whatever assembles the finished video, or just read it out of the console - the node prints the frame count, resolution and file size when it's done.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/Hishamahmer/comfyui-arkennemasis

Restart ComfyUI, or use ComfyUI Manager and search arkennemasis. Dependencies are light: the pack's requirements.txt is essentially httpx, and that's for its Codex nodes, not this one. There are no model downloads.

You do need ffmpeg on your PATH. The node shells out to it, so a missing binary is the classic first-run failure - you'll get a RuntimeError with the tail of ffmpeg's own log attached, which is the node being helpful rather than mysterious.

Where people get burned

The mask has to be your mask, not a preview of it. If you save an image with alpha and expect the node to read transparency out of it, it won't - the alpha comes from the MASK socket, full stop.

Second, check your target editor early. VP9 alpha is well supported in browsers, ffmpeg and OBS; NLE support for alpha-in-WebM is patchier. Test with a three-second clip before you render the five-minute one.

Third, and this one is subtle: the node writes into the output directory but isn't an output node, so nothing shows in ComfyUI's image gallery. Your file is at ComfyUI/output/<folder>/<name>.webm. If you can't find it, you're probably looking in the wrong tree.

Categoryarkennemasis/Video

Inputs (5)

NameTypeDefaultDescription
imagesIMAGE—
maskMASK1 = keep, 0 = transparent. Resized to the frames if it differs.
fpsFLOAT25.001–120—
folderSTRINGRelative to ComfyUI's output directory.
nameSTRINGcutout—

Outputs (1)

NameTypeDescription
pathSTRING—