Nodes/ComfyUI-MakkiTools/MergeImageChannels(mki-图像通道合并)
ComfyUI Node

MergeImageChannels(mki-图像通道合并)

The other half of the channel round-trip

By MakkiShizu·Created about a year ago·Updated 7 months ago· 9
MergeImageChannels(mki-图像通道合并)
  • red_channel
  • green_channel
  • blue_channel
  • alpha_channel
  • IMAGE

If ImageChannelSeparate_makki pulls a channel out, MergeImageChannels_makki (display name "MergeImageChannels(mki-图像通道合并)") is the return trip: you feed it separate red, green, blue, and (optionally) alpha channel images and it combines them into a single image.

Where that earns its keep: the classic channel-editing workflow. You separate an image into channels, run different processing on each (sharpen the red, adjust the blue, whatever your effect calls for), then merge the results back into one image. Without a merge node you're stuck editing whole-image color, which is blunter than you usually want.

How it works

Each channel input is optional - you can merge just red+blue, or green alone. The node:

  • Takes the first connected channel as the reference for size, device, and dtype.
  • Rebuilds every slot: a connected channel lands in its own position; a missing channel becomes zeros. So a red-only merge gives you a black-and-red image, not an error.
  • Handles alpha as optional: if you provide an alpha channel, the output is RGBA (4 channels); otherwise it's RGB (3). That's the difference between a transparent-capable result and a flat one.

The implementation even tolerates feeding it a 3-channel image where it expects one channel - it just uses that image's first channel. Useful, and slightly forgiving.

Inputs and output

  • red_channel / green_channel / blue_channel (all optional IMAGE).
  • alpha_channel (optional IMAGE) - include it and the output carries alpha.
  • Output: IMAGE.

When to reach for it

  • Round-tripping channel edits - separate, tweak one channel, merge back.
  • Building an image from scratch - if you generated channel data elsewhere (masks, procedural grayscales), this assembles them into a color image.
  • Fixing a channel - replace a blown-out or broken channel from a cleaner source while leaving the others intact.

It's the direct complement to ImageChannelSeparate, and the two are clearly designed to be used as a pair.

Installing

It's in ComfyUI-MakkiTools:

cd ComfyUI/custom_nodes
git clone https://github.com/MakkiShizu/ComfyUI-MakkiTools
cd ComfyUI-MakkiTools
pip install -r requirements.txt

Restart ComfyUI. No heavy dependencies. The only real footgun is dimensions: if your channel images aren't the same size, the merge uses the first one as reference and doesn't resize the others - mismatched channels will misalign. Resize before merging if they don't match, and the round-trip will behave.

CategoryMakkiTools

Inputs (4)

NameTypeDefaultDescription
red_channeloptIMAGERed channel image 红色通道图像
green_channeloptIMAGEGreen channel image 绿色通道图像
blue_channeloptIMAGEBlue channel image 蓝色通道图像
alpha_channeloptIMAGEAlpha channel image Alpha通道图像

Outputs (1)

NameTypeDescription
IMAGEIMAGE