Nodes/ComfyUI-My-Nodes/分离颜色
ComfyUI Node

分离颜色

Peel a photo into its red, green, and blue to see where the detail actually lives

By Tagbliton·Created 2 years ago·Updated about a year ago· 11
分离颜色
  • image
  • R
  • G
  • B

Somewhere along the way every ComfyUI user hits an image that "looks wrong" and can't tell why. Maybe the highlights are clipping, maybe there's a weird color cast, maybe you're trying to build a mask off one specific color. That's when you reach for this tiny node - it takes a single IMAGE and hands you back three grayscale-looking images, one per RGB channel, so you can actually see what's in each.

The mechanism is simple, and it's worth knowing exactly what you get because the outputs trip up beginners. The node slices the input's red, green, and blue channels (the source does image[:, :, :, 0:1], 1:2], 2:3]) and then repeats each single channel back up to three channels. So the outputs are not single-channel masks - each of R, G, B is a full 3-channel IMAGE that merely looks grayscale. You can plug any of them into anything expecting an IMAGE, but if you actually want a mask, run one through a convert-to-mask node first.

The input list is exactly one thing: image (IMAGE). The outputs are R, G, B (all IMAGE). Nothing else to configure, no settings to get wrong.

Where it earns its keep: checking whether a channel is blown out (a fully white channel means clipped highlights you can't recover), seeing how much detail a red-dominant subject really has, or isolating the blue channel of a sky-heavy shot as a brightness reference. It pairs naturally with the pack's 合并颜色 (Combine Color) sibling if you want to recombine after tweaking a channel, though they're independent nodes.

Install is the pack's shared story. Either ComfyUI Manager → search "ComfyUI-My-Nodes" → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Tagbliton/ComfyUI-My-Nodes

then restart ComfyUI. The pack's requirements.txt pulls in dashscope, openai, requests, soundfile, numpy, and a hard pin of urllib3==1.26.20 - but this node (and the rest of the Tools shelf) needs none of them; it only uses ComfyUI core and numpy. If you only want the utilities, the API dependencies are dead weight you can ignore.

One real gotcha: the source raises a ValueError if the input doesn't have exactly three channels. RGBA will fail, so if you're feeding something with an alpha channel, strip it first. In practice ComfyUI's LoadImage gives you RGB, so you'll usually only hit this with an unusual upstream. And worth a heads-up: the whole pack is Chinese-first - this node appears in the menu as "分离颜色" - but there's nothing here you need to read, the inputs and outputs are self-explanatory.

Category我的节点/Tools

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (3)

NameTypeDescription
RIMAGE
GIMAGE
BIMAGE