Split Image with Alpha
Pull the alpha out of an RGBA image before the graph flattens it to death
- image
- IMAGE
- MASK
SplitImageWithAlpha is the reverse of JoinImageWithAlpha, and it's the node you reach for when a transparent image arrives in your workflow and you need to keep the transparency alive. It takes one RGBA image and cracks it open into two outputs: the RGB color data and the alpha channel, the latter handed to you as a MASK.
Here's the situation that makes it worth knowing. Load a transparent PNG, and ComfyUI gives you a single IMAGE with four channels - but most nodes in the graph only read the first three, so the moment that image passes through almost anything, the alpha is gone. If you're building a LayerDiffusion pipeline or compositing product cutouts, you've probably watched transparency die somewhere mid-graph and had no idea where. The fix is to split early: feed the RGBA into this node at the start, route the RGB and the MASK as separate wires, and let JoinImageWithAlpha reassemble them at the end. Masks survive everywhere; the fourth image channel survives almost nowhere.
How it works. It slices off the first three channels as your RGB image, then converts the fourth into a MASK using ComfyUI's convention - alpha of 1 (fully opaque) becomes a mask value of 0, alpha of 0 (fully transparent) becomes 1. That means the MASK output plugs straight into any mask input downstream, which is the whole point: you can blur it, feather it, dilate it, or feed it to ImageCompositeMasked without ever converting anything. And if you hand it an image with no alpha channel at all - which is most images, since VAE decode and normal loading produce RGB - it doesn't error out. It returns a fully opaque mask (all zeros), so your graph keeps running; you just get nothing interesting out of it.
The inputs and outputs. One input, image. Two outputs: IMAGE (RGB) and MASK. There are no settings to fiddle with - it's about as simple as ComfyUI nodes get. The only judgment call is where in the graph you put it, and the answer is usually "right after the thing that produces the transparent PNG."
Where people get burned. The classic mistake is expecting it to create transparency out of nowhere. If your image is a plain RGB render, there's no alpha to split, and you'll get a fully opaque mask - the node can't infer what should be transparent. You need a source that actually carries alpha: a saved transparent PNG, a LayerDiffusion output, or a cutout from a background-removal node that keeps the channel. The other trap is polarity if you compare it to the RGBA you started from: the mask output is inverted relative to the raw alpha (transparent shows as 1, not 0), which is correct for ComfyUI but catches people who just looked at the fourth channel.
It ships with ComfyUI core and loads no model files - pure tensor surgery, added in August 2024 alongside JoinImageWithAlpha. Not a node you'll use every day, but the day your transparency vanishes mid-workflow, it's the difference between starting over and a two-node fix.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |