LayerUtility: ImageChannelMerge
ImageChannelMerge — rebuild an image from separate color channels
- channel_1
- channel_2
- channel_3
- channel_4
- image
The other half of channel splitting. If you've pulled an image apart into its individual R/G/B (or Y/Cb/Cr, or L/A/B, or H/S/V) channels - to process, swap, or replace one of them independently - this is what glues them back into a normal image afterward. It's the kind of Photoshop-era move (edit the blue channel to fix a color cast, swap a luminance channel between two photos) that's easy to take for granted until you need it in ComfyUI and realize most workflows never touch individual channels at all.
How it works
You feed it three (or four) single-channel images and a mode, and it interleaves them back into one multi-channel image according to that mode's color space. The mode has to match whatever space you split in - if you pulled channels apart as LAB, you merge them back as LAB, not RGBA, or the result will look wrong (usually a garish, wrongly-tinted mess, since the channels mean different things in each space).
The whole point of going through this split-edit-merge dance instead of editing the RGB image directly is that some fixes are genuinely easier in a different space - nudging exposure or contrast is cleaner on LAB's L channel because it changes brightness without disturbing color at all, something that's much harder to do reliably by fiddling with R, G, and B together.
The inputs and outputs that matter
channel_1,channel_2,channel_3(required, all IMAGE) - your three channel images, in the order that matches your chosen mode (e.g. R, G, B for RGBA mode).channel_4(optional) - only relevant for RGBA mode, where it supplies the alpha channel; leave it disconnected for the other modes, which don't use a fourth channel.mode- which color space you're reassembling: RGBA, YCbCr, LAB, or HSV. This has to match the split you did upstream.
Output: a single merged image.
How to install it
Search ComfyUI Layer Style in ComfyUI Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle
pip install -r ComfyUI_LayerStyle/requirements.txt
Restart; find it under 😺dzNodes → LayerUtility.
Common issues
The single most common mistake: mismatching mode with the mode you used at split time, or feeding channels in the wrong order. Both produce the same symptom - a technicolor, obviously-wrong image - and both are fixed the same way, by double-checking the split and merge nodes agree on both mode and channel order. The second gotcha is channel images that don't actually match in size; ImageChannelSplit will always hand you channels that are already the same dimensions, but if you've processed one channel independently in between (resized it, cropped it) and the others haven't kept pace, the merge will either error or produce a distorted result. Keep all three (or four) channels at identical dimensions going into this node, always. And if you only wanted to touch one channel, resist the urge to also "clean up" the others while you're in there - the whole appeal of this split/merge approach is that the untouched channels come back through exactly as they went in.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| channel_1 | IMAGE | — | |
| channel_2 | IMAGE | — | |
| channel_3 | IMAGE | — | |
| mode | COMBO | 4 options: RGBA, YCbCr, LAB, HSV | |
| channel_4opt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |