BD Unpack Channels
Split an RGBA pack into its four channels (and see which one you screwed up)
- image
- red_image
- green_image
- blue_image
- alpha_image
- red_mask
- green_mask
- blue_mask
- alpha_mask
- debug_preview
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_previewand 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.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Source image — RGB or RGBA. If RGB, alpha output is the value from alpha_default. | |
| alpha_defaultopt | FLOAT | 1.000–1 | Value used for the alpha output when the input image is RGB (only 3 channels). Default 1.0 = fully opaque. |
Outputs (9)
| Name | Type | Description |
|---|---|---|
| red_image | IMAGE | R channel as greyscale 3-channel image (R replicated to RGB). |
| green_image | IMAGE | G channel as greyscale 3-channel image. |
| blue_image | IMAGE | B channel as greyscale 3-channel image. |
| alpha_image | IMAGE | A channel as greyscale 3-channel image. |
| red_mask | MASK | R channel as single-channel MASK. |
| green_mask | MASK | G channel as single-channel MASK. |
| blue_mask | MASK | B channel as single-channel MASK. |
| alpha_mask | MASK | A channel as single-channel MASK. |
| debug_preview | IMAGE | 2x2 grid: R top-left tinted red, G top-right green, B bottom-left blue, A bottom-right white. |