Save Images With Alpha
Save RGBA frames without the alpha silently dying
- images
- output_path
- saved_count
Here's a trap that catches everyone who makes transparent images in ComfyUI: the stock Save Image writes JPEG-style RGB, and your carefully built alpha channel evaporates the moment it hits disk. You get a PNG that looks fine in the browser and is fully opaque in every editor. Save Images With Alpha is the node that actually writes the transparency - it saves your 4-channel RGBA batch as true PNG image sequences, which is the only common format that preserves alpha properly.
It's the output stage of this pack's video pipeline, but it works on any RGBA batch you hand it - cutouts from BiRefNet, LayerDiffusion-style transparent assets, frames from Combine Video And Mask.
How it works
Each image in the batch is written as a PNG under ComfyUI/output/, using the standard ComfyUI counter scheme so nothing gets overwritten: files come out like alpha_image_00001_00000_.png. It detects the channel count - 4-channel images save as RGBA; a 3-channel input gets an opaque (fully visible) alpha added rather than failing. It supports subfolders via filename_prefix (e.g. transparent/alpha_image → output/transparent/), and it deliberately refuses to write anywhere outside the output directory - a safety check worth having.
Inputs
- images - the IMAGE batch, ideally 4-channel RGBA.
- filename_prefix - default
transparent/alpha_image. The part before the last slash becomes a subfolder.
Outputs
- output_path - the full folder where files were written.
- saved_count - how many PNGs got written.
Install
Standard pack install - ComfyUI Manager (search "ComfyUI-AutoFlow") or:
cd ComfyUI/custom_nodes
git clone https://github.com/ZXL-Xinram/ComfyUI-AutoFlow
Restart after. Needs Pillow (bundled with ComfyUI) and numpy. No models.
Where people get burned
- Feeding it RGB and expecting alpha. If your upstream node already dropped the alpha (many do - see Add Alpha Channel's notes), this node can't invent it. It'll save opaque PNGs and you'll wonder what went wrong. Check your image's channel count before blaming the saver.
- Subfolder confusion.
filename_prefixwith a slash creates folders relative tooutput/. Keep it simple or you'll hunt for files in nested folders. - It's not a JPEG saver. Everything comes out as PNG here, which is the point - but it means bigger files. For opaque assets you don't need the heavy PNGs; use the stock saver for those.
This node is the reason the pack's transparent-image workflow actually lands. If you've ever saved an "RGBA" image and opened it to find a black background where the transparency should be, you already know why it exists.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| filename_prefix | STRING | transparent/alpha_image | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| output_path | STRING | — |
| saved_count | INT | — |