Nodes/BrainDead Nodes/BD Unpack Channels
ComfyUI Node

BD Unpack Channels

Split an RGBA pack into its four channels (and see which one you screwed up)

By BizaNator·Created 8 months ago·Updated 3 days ago· 15
BD Unpack Channels
  • image
  • red_image
  • green_image
  • blue_image
  • alpha_image
  • red_mask
  • green_mask
  • blue_mask
  • alpha_mask
  • debug_preview
alpha_default1.00

Channel packing is the game-asset trick where you cram four grayscale maps into one RGBA texture - roughness in R, metallic in G, AO in B, whatever your engine wants - so a single draw call carries everything. The BrainDead pack's BD Pack Channels does the cramming. This node is the undo button: BD Unpack Channels splits one RGBA image back into four individual channels, and it's the debugger you'll want when a packed texture comes out of a render looking wrong.

The honest use case: you've been passing a packed RGBA image around (the pack's own skin-shader pipeline does exactly this), and now you need to know which channel actually holds what. Feeding it into a normal IMAGE input won't show you - every channel looks like grayscale on its own. This node pulls them apart and, just as usefully, gives you a debug_preview that shows all four side by side in a 2x2 grid, each tinted (R as red, G as green, B as blue, A as white), matching the Pack Channels preview layout so you can eyeball the round trip.

The one input, and the outputs that matter

Input is dead simple: image (RGB or RGBA) plus an optional alpha_default - the value used for the alpha output if you feed it an RGB image with no alpha channel (default 1.0, i.e. fully opaque).

Each channel comes out twice, which is the bit beginners trip on:

  • red_image, green_image, blue_image, alpha_image - greyscale 3-channel IMAGE outputs (the single channel replicated across RGB), for anything expecting an IMAGE socket.
  • red_mask, green_mask, blue_mask, alpha_mask - the same data as single-channel MASK outputs, for anything expecting a MASK.
  • debug_preview - the 2x2 diagnostic grid.

Pick the flavor your downstream node wants. They're the same pixels.

Installation

Part of ComfyUI-BrainDead - ComfyUI Manager (search "BrainDead") or:

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

Pure torch/numpy, no models, no downloads. It's one of the lightest nodes in the pack.

Common issues

  • The alpha output isn't what I expected - if you fed it an RGB (3-channel) image, there is no alpha to unpack, so it uses alpha_default. Wire an actual RGBA image if you want real alpha, or adjust the default.
  • "Which channel has my data?" - run it through the debug_preview and look. That's the whole point of the grid; don't guess based on names.
  • Grayscale output looks darker than the original - that's normal. A channel extracted on its own and replicated to RGB is the luminance of that single channel, not the combined color. You're looking at one ingredient, not the recipe.
Category🧠BrainDead/Segmentation

Inputs (2)

NameTypeDefaultDescription
imageIMAGESource image — RGB or RGBA. If RGB, alpha output is the value from alpha_default.
alpha_defaultoptFLOAT1.000–1Value used for the alpha output when the input image is RGB (only 3 channels). Default 1.0 = fully opaque.

Outputs (9)

NameTypeDescription
red_imageIMAGER channel as greyscale 3-channel image (R replicated to RGB).
green_imageIMAGEG channel as greyscale 3-channel image.
blue_imageIMAGEB channel as greyscale 3-channel image.
alpha_imageIMAGEA channel as greyscale 3-channel image.
red_maskMASKR channel as single-channel MASK.
green_maskMASKG channel as single-channel MASK.
blue_maskMASKB channel as single-channel MASK.
alpha_maskMASKA channel as single-channel MASK.
debug_previewIMAGE2x2 grid: R top-left tinted red, G top-right green, B bottom-left blue, A bottom-right white.