Split Image Channels
Pull an image apart into R, G, B and alpha
- image
- red
- green
- blue
- mask
Sometimes the channel you care about isn't the picture, it's one slice of it. A packed control map might hide depth in the red channel and a normal in green. An RGBA image carries a mask in its alpha. SplitImageChannels tears an image into its component channels so you can grab exactly the one you need.
It's a small image-utility node from kijai's KJNodes, the pack most people already have kicking around. Niche, but when you need it you really need it.
How it works
You give it one image and it hands back four outputs. The three color channels each come out as a grayscale image, with the selected channel copied across all three RGB slots (so "red" is the red channel shown as a proper viewable gray image, not a red-tinted one). The alpha channel comes out as a MASK, which is the natural type for it and lets you pipe it straight into masking nodes.
That RGB-replication detail is the useful part. A raw single channel is awkward to preview and awkward to feed into nodes that expect a 3-channel image; by broadcasting the channel across RGB, each output is a normal image you can view, upscale, or process like any other.
The inputs and outputs that matter
image- the image to split. If it has an alpha channel, you get the mask output; if it's plain RGB, the alpha/mask output will simply be empty.
Four outputs:
red,green,blue- each is an IMAGE holding that single channel, replicated across all three color channels so it's directly usable.mask- the alpha channel as a MASK.
The classic uses: extracting the alpha of an RGBA render as a ready-to-use mask, or pulling one channel out of a packed multi-map (depth/normal/etc.) that some model or preprocessor stuffed into a single RGB image.
Installing it
You most likely already have KJNodes. If not, ComfyUI Manager → search KJNodes for ComfyUI → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-KJNodes
pip install -r ComfyUI-KJNodes/requirements.txt
Restart ComfyUI. No models, no extra dependencies.
Common issues
The mask output is empty. Your input image has no alpha channel, it's plain RGB. Only RGBA images carry an alpha for the mask output to pull from. Load the image in a way that preserves alpha (a PNG with transparency), or if you wanted a mask from image content rather than a stored alpha, that's a different tool entirely (thresholding, CLIPSeg, a matting model).
The channels all look the same. For a fairly monochrome or low-saturation image, the R, G, and B channels genuinely are close to identical. That's not a bug, there's just little color difference to separate.
I wanted a colored channel, not grayscale. By design each channel output is that single channel broadcast across RGB, which reads as grayscale. That's what makes it a usable standalone image. If you need it recolored, tint it downstream.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| red | IMAGE | — |
| green | IMAGE | — |
| blue | IMAGE | — |
| mask | MASK | — |