Nodes/Nuke Nodes for ComfyUI/Nuke Channel Shuffle
ComfyUI Node

Nuke Channel Shuffle

Rearrange RGBA channels without a trip to Photoshop

By sumitchatterjee13·Created about a year ago·Updated 22 days ago· 60
Nuke Channel Shuffle
  • image
  • IMAGE
red_fromred
green_fromgreen
blue_fromblue
alpha_fromalpha

Sometimes you don't need to fix the image, you need to reinterpret it. A depth map sitting in the red channel, a normal map you want to see as color, an alpha you want to swap into the green channel so some other node can use it - that's channel shuffling, and NukeChannelShuffle is the ComfyUI node for it. It takes your image and rebuilds its RGBA output from whatever source channels you choose. Simple, fast, and weirdly indispensable once you know it exists.

The name is Nuke's, and the behavior matches: pick what each output channel should be filled from, and out comes the reshuffled image.

How it works

Each output channel - red, green, blue, alpha - gets a source chosen from a dropdown: red, green, blue, alpha, or the two special values zero and one. A zero source fills that output channel with 0; one fills it with 1. That last pair is where the magic hides: you can bake a constant black or white channel in, which is exactly how you build an alpha from nothing (set alpha to one on an image with no alpha) or zero out a channel you don't want.

The inputs that matter

  • red_from - what fills the output red channel.
  • green_from - what fills the output green channel.
  • blue_from - what fills the output blue channel.
  • alpha_from - what fills the output alpha channel.

Each accepts red, green, blue, alpha, zero, or one. Defaults are the identity mapping (red→red, green→green, blue→blue, alpha→alpha), so the node is a no-op until you change something - which makes it safe to drop into a workflow and experiment.

Output is a single IMAGE with the shuffled channels.

When you'd reach for it

  • Promote a depth map to a usable channel - if your depth data arrived in the red channel, shuffle red into all three of red/green/blue to get a proper grayscale depth image.
  • Build or clear alpha - set alpha_from to one to force full opacity, or to zero to clear it.
  • Debug a channel - shuffle one channel into all three to see it as grayscale (NukeViewer does this for viewing; this does it to the actual data).

Installing it

It's part of the Nuke Nodes pack:

cd ComfyUI/custom_nodes
git clone https://github.com/sumitchatterjee13/nuke-nodes-comfyui.git nuke-nodes
cd nuke-nodes
pip install -r requirements.txt

Or search "Nuke Nodes" in ComfyUI Manager and restart. It's under the Nuke category, a pure PyTorch channel-copy operation - no special dependencies at all.

Common issues

  • The image turns black - you've probably set a channel to zero (or everything to alpha, which is near-black in most RGB-only images). Remember zero and one are constants, not "keep whatever's there."
  • "I moved one channel and now everything looks inverted" - shuffling can produce negative or unexpected values if the source channel had no data; check you picked the channel that actually holds the data.
  • Alpha went away - check alpha_from; if it points at a channel that's empty, output alpha is 0 and downstream merges will treat it as fully transparent.

It's a small node, but it's the difference between "can't use this data" and "can use this data" in a surprising number of workflows.

CategoryNuke/Viewer

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
red_fromCOMBOred6 options: red, green, blue, alpha, zero, one
green_fromCOMBOgreen6 options: red, green, blue, alpha, zero, one
blue_fromCOMBOblue6 options: red, green, blue, alpha, zero, one
alpha_fromCOMBOalpha6 options: red, green, blue, alpha, zero, one

Outputs (1)

NameTypeDescription
IMAGEIMAGE