BD Channel Merge
Paint a character into the red channel — Photoshop blend modes for texture packing
- base
- source
- mask
- image
Game-engine texture packing is a game of Tetris with channels: albedo here, roughness there, a mask stuffed into the alpha. The pack's own "Game-Engine Packing" workflow isolates parts, balances luma, crops them to a shared pivot, then packs them into R/G/B channels of one texture. BD ChannelMerge is the tool that does that packing. It blends a source image into one or more specific RGBA channels of a base image, with a proper set of Photoshop-style blend modes - so you can paste a character into the red channel, or multiply a roughness map into the green channel, one channel at a time.
The standout feature is use_source_alpha (on by default): the source image's own alpha acts as a soft blend mask. Transparent source pixels leave the base channel untouched, opaque pixels apply the blend at full strength. Which means you can paste a character cut out on a transparent background into a single channel without its background pixels contaminating the channel. That's the difference between "packing a texture" and "painting a rectangular smudge into the R channel." The node description's example is exactly this: composite a character with alpha onto one channel, background be damned.
The inputs that matter
- base - the image being modified. RGB or RGBA; channels you don't target pass through unchanged.
- source - the image to merge from, auto-resized to match base.
- target_channels - where to write: single (R, G, B, A) or multi (RG, RB, GB, RGB, RGBA). Multi maps source channels 1:1; single collapses the source to a scalar first.
- source_from - how to collapse the source for single-channel targets:
luma_bt709(default, matches the skin shader), a specificchannel_R/G/B/A,average, ormax_rgb. Ignored for multi-channel targets. - blend_mode - replace, add, multiply, screen, overlay, darken, lighten, subtract, difference, soft_light. Default is
replace;multiplyis your friend for shading one channel by another. - strength - overall opacity, 0–1. Combined multiplicatively with the source alpha and any external mask.
- mask (optional) - an additional blend mask layered on top of everything.
Outputs: image - the modified base, same resolution, RGBA if the base was RGBA or if A is a target channel.
How you'll chain it
Because each pass modifies one channel and hands the result back, you can build a texture pack progressively: base → merge character into R → merge another into G → merge a mask into A → out. It's the pack's "Channel Operations" workflow in node form, and the node description explicitly encourages chaining several in a row to build up a texture one channel at a time. It's a deterministic pixel op, not a model - instant, repeatable, and exactly the right tool instead of burning a diffusion pass on work a channel map does perfectly.
Installing it
Part of BizaNator/ComfyUI-BrainDead (BrainDeadGuild). ComfyUI Manager → search "BrainDead" → install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/BizaNator/ComfyUI-BrainDead
cd ComfyUI-BrainDead
pip install -r requirements.txt
Restart; it's under 🧠BrainDead/Segmentation.
Gotchas
Three things to keep straight. First, if your source has no alpha channel, use_source_alpha does nothing - you get a hard-edged blend, so check your source has real transparency when the "no background contamination" behavior matters. Second, for single-channel targets, the source is collapsed before blending - pick source_from deliberately, because "what does red mean here" is exactly the decision that changes the result. Third, remember the output inherits channel count from the base and targets - target A and you're now RGBA even if you started RGB, which downstream nodes may or may not expect. And if a blend looks like it did nothing, check strength and whether invert_alpha_mask flipped your mask's polarity on you.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| base | IMAGE | Existing image to modify. Can be RGB or RGBA — the channels you don't target pass through unchanged. | |
| source | IMAGE | Image to merge from. Resized to match base dimensions automatically. | |
| target_channels | COMBO | R | Which channel(s) of base to write to. Single: R, G, B, A — source is collapsed to a scalar (see source_from). Multi: RG, RB, GB, RGB, RGBA — source RGB channels map 1:1 to targets. |
| source_from | COMBO | luma_bt709 | For single-channel targets: how to collapse source to a scalar. luma_bt709 = perceptual greyscale (matches skin shader). channel_R/G/B/A = pick one channel directly. average = (R+G+B)/3. max_rgb = brightest channel. Ignored for multi-channel targets (RGB/RGBA) — source channels map directly. |
| blend_mode | COMBO | replace | How blended source value combines with existing base channel value. replace = overwrite. add = brighten. multiply = darken proportionally. screen = brighten (black=no change). overlay = contrast split at 0.5. darken/lighten = min/max. subtract = darken clipped. difference = absolute gap. soft_light = gentle contrast. |
| strength | FLOAT | 1.000–1 | Overall blend opacity. 0 = base unchanged; 1 = full blend applied. Combined multiplicatively with use_source_alpha mask and external mask. |
| use_source_alpha | BOOLEAN | true | Use source image's alpha channel as a soft blend mask. Transparent source pixels (alpha=0) leave base unchanged; opaque pixels (alpha=1) apply the blend at full strength. This lets you composite a character against a transparent background without the BG affecting the target channel. No effect if source has no alpha (RGB only source). |
| invert_alpha_maskopt | BOOLEAN | false | Invert the source alpha mask before using it. Blend applies where source IS transparent instead of opaque. |
| maskopt | MASK | Additional external blend mask. Combined with source alpha and strength. White = full blend, black = base unchanged. | |
| luma_standardopt | COMBO | bt709 | Luma weighting used when source_from=luma_bt709 (or any luma path). RGB → luminance weighting: bt709 (default): 0.2126 R + 0.7152 G + 0.0722 B — modern sRGB/Rec.709 standard. Use for Unity/Unreal, AI pipelines, modern display work. bt601: 0.299 R + 0.587 G + 0.114 B — legacy NTSC weights, matches Photoshop 'Desaturate' and older tools. average: (R+G+B)/3 — simple, not perceptual. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Modified base image. Same resolution as base. Will be RGBA if base was RGBA or if target_channels includes A; otherwise matches base channel count. |