Combine Video And Mask (One-Step)
Video plus mask, straight to transparent PNGs in one node
- images
- output_path
- saved_count
- process_info
This is the node this pack is actually about. The README buries it under a "🎬 NEW!" banner, but Combine Video And Mask (One-Step) is the reason ComfyUI-AutoFlow exists. You feed it a normal video plus a mask video - say, your subject cut out per-frame - and it hands you a transparent PNG sequence ready for compositing. No intermediate saves, no juggling three nodes.
It's the "one-step" version of the pack's own three-node pipeline (Video To Images → Add Alpha Channel → Save Images With Alpha). What makes it worth your time is that it does all of it internally and only writes to disk once, at the end.
How it works
Behind the scenes it chains the pack's own functions: OpenCV reads both videos frame by frame, each mask frame becomes the alpha channel for the matching original frame (white = opaque, black = transparent), and the results are written out as RGBA PNGs into ComfyUI's output folder. Your mask video is doing the heavy lifting here - the node doesn't segment anything for you. You need a mask source first, which is where the background-removal packs (BiRefNet and friends) usually come in.
Inputs that matter
- use_path_mode - the pack's signature toggle.
false(default) means you pick from videos already in ComfyUI'sinputfolder;truelets you type a full path and process files from anywhere on disk. The frontend even adds a "choose video to upload" button on the node that copies a local file intoinput/for you, plus a looping in-node preview. - original_video_upload / mask_video_upload or original_video_path / mask_video_path - whichever pair your mode uses.
- invert_mask - flips the alpha. Handy if your mask video is inverted (white background instead of white subject).
- multiply_rgb - premultiplied alpha. It darkens edge pixels by their alpha, which kills the ugly bright/dark fringe you get when straight-alpha edges composite badly. Enable it if you see halos; leave it off if you need the raw color at the edges.
- start_frame / frame_count - trim before processing.
frame_countof-1means "to the end." - filename_prefix - default
transparent, saved underComfyUI/output/transparent/.
Outputs: images (the RGBA batch, if you want to preview or reuse it in-graph), output_path, saved_count, and process_info (a one-line summary you can shove into a text display).
Install
Same story as every node in this pack:
cd ComfyUI/custom_nodes
git clone https://github.com/ZXL-Xinram/ComfyUI-AutoFlow
then restart ComfyUI, or use ComfyUI Manager and search "ComfyUI-AutoFlow." No model downloads, no requirements.txt. The video nodes need OpenCV (cv2), which ships with ComfyUI's own dependencies, so it's almost always already there.
Where people get burned
- "Cannot open video file" in path mode. The supported list is mp4/avi/mov/mkv/webm/flv/wmv/mpg/mpeg/m4v, and OpenCV is picky about codecs. If a file refuses to open, re-encode it (HandBrake or
ffmpeg -i in.mp4 -c:v libx264 -pix_fmt yuv420p out.mp4). - Mismatched videos. The node doesn't resample. If your mask video is shorter or a different frame rate than the original, you'll hit the "batch sizes don't match" error. Both videos should be the same length and fps - make them that way first.
- Saving outside output is refused by design. Don't try to point
filename_prefixat a path that escapesComfyUI/output; it raises on purpose.
One honest caveat: this pack shipped its first release in late 2025 and has essentially zero community track record yet. The node works, but you're an early adopter - keep backups of your originals.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| use_path_mode | BOOLEAN | false | — |
| original_video_upload | COMBO | 1 options: | |
| mask_video_upload | COMBO | 1 options: | |
| original_video_path | STRING | — | |
| mask_video_path | STRING | — | |
| filename_prefix | STRING | transparent | — |
| invert_mask | BOOLEAN | false | — |
| multiply_rgb | BOOLEAN | false | — |
| start_frame | INT | 00–999999 | — |
| frame_count | INT | -1-1–999999 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| output_path | STRING | — |
| saved_count | INT | — |
| process_info | STRING | — |