Nodes/ComfyUI-Image-Filters/Shuffle Channels
ComfyUI Node

Shuffle Channels

Rewire R, G, B, and A to whatever you actually need

By spacepxl·Created 3 years ago·Updated 8 months ago· 293
Shuffle Channels
  • image
  • IMAGE
redred
greengreen
blueblue
alphanone

The README description is four words and it's the whole node: "Move channels around at will." For each of the four output channels - red, green, blue, alpha - you pick which source feeds it: any of the original image's four channels, a solid white fill, a solid black fill, or (for alpha specifically) no channel at all. It's a simple idea, but it covers a surprising number of practical, slightly annoying problems that don't have an obvious dedicated node otherwise.

What it's actually good for

The most common use is visualization: if you've got a single-channel piece of data sitting in, say, the red channel of an image (a depth pass, a mask baked into a channel, a normal map's Z component), routing that same channel into green and blue as well turns it into a proper grayscale image you can actually look at, instead of a mostly-black, barely-visible red tint. It's also the fix for channel-order mismatches - some pipelines expect BGR instead of RGB, or export alpha in an unexpected slot - and it's a clean way to zero out a channel entirely (route it to "black") without reaching for a separate math node. It pairs naturally with this pack's Convert Normals node too: switching between normal-map conventions (DirectX vs OpenGL) often comes down to inverting or zeroing a specific channel, which is exactly what this node is built to do quickly.

Inputs and outputs

  • image (IMAGE) - the source.
  • red / green / blue - each one an independent dropdown: red, green, blue, alpha, white, or black. Defaults keep everything in its normal place (red→red, green→green, blue→blue).
  • alpha - same dropdown, plus a none option (the default), which drops the alpha channel from the output entirely rather than filling it with anything.

Output is a single IMAGE with its channels rearranged exactly as specified.

Installing it

ComfyUI Manager: search "ComfyUI-Image-Filters," install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/spacepxl/ComfyUI-Image-Filters

pip install -r requirements.txt (or install.bat on Windows), restart ComfyUI. No models - this is a pure channel remap.

The pack's OpenCV dependency is the recurring install gotcha: if a different node pack already installed a conflicting cv2 build, you can get import errors across this whole repo on startup. import_error_install.bat fixes it by reinstalling the single variant this pack needs, opencv-contrib-python.

Common issues

The most common confusion is forgetting this node fully replaces each channel rather than blending - set green to pull from red, and the original green data is gone from that channel entirely, not mixed in. If you want a genuine blend of two channels rather than a swap, this isn't the tool for it. Second, watch the alpha default: it's none, meaning your output loses transparency information unless you explicitly pick something for it - if downstream nodes expect an alpha channel and it's suddenly missing, check this node first. And if you're using it to visualize a single-channel value as grayscale, remember to route that same source into all three of red, green, and blue - routing it into just one still leaves you looking at a tinted image rather than true grayscale.

CategoryImage-Filters/image

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
redCOMBOred6 options: red, green, blue, alpha, white, black
greenCOMBOgreen6 options: red, green, blue, alpha, white, black
blueCOMBOblue6 options: red, green, blue, alpha, white, black
alphaCOMBOnone7 options: red, green, blue, alpha, white, black, +1

Outputs (1)

NameTypeDescription
IMAGEIMAGE