Nodes/ComfyUI-BrainDead/BD Channel Merge
ComfyUI Node

BD Channel Merge

Blend/composite a source image into one or more specific RGBA channels of a base image, using Photoshop-style blend modes. Key feature: enable use_source_alpha to use the source image's own alpha as a soft mask — transparent areas of the source leave the base channel unchanged, so you can paste a character (with alpha background) onto a single channel without the background affecting it. Chain multiple BD_ChannelMerge nodes to build up a texture pack progressively, modifying one channel at a time as the image flows through the workflow.

By BizaNator·Created 7 months ago·Updated 16 days ago· 14
BD Channel Merge
  • base
  • source
  • mask
  • image
target_channelsR
source_fromluma_bt709
blend_modereplace
strength1.00
use_source_alphatrue
invert_alpha_maskfalse
luma_standardbt709
Category🧠BrainDead/Segmentation

Inputs (10)

NameTypeDefaultDescription
baseIMAGEExisting image to modify. Can be RGB or RGBA — the channels you don't target pass through unchanged.
sourceIMAGEImage to merge from. Resized to match base dimensions automatically.
target_channelsCOMBORWhich 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_fromCOMBOluma_bt709For 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_modeCOMBOreplaceHow 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.
strengthFLOAT1.000–1Overall blend opacity. 0 = base unchanged; 1 = full blend applied. Combined multiplicatively with use_source_alpha mask and external mask.
use_source_alphaBOOLEANtrueUse 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_maskoptBOOLEANfalseInvert the source alpha mask before using it. Blend applies where source IS transparent instead of opaque.
maskoptMASKAdditional external blend mask. Combined with source alpha and strength. White = full blend, black = base unchanged.
luma_standardoptCOMBObt709Luma 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)

NameTypeDescription
imageIMAGEModified base image. Same resolution as base. Will be RGBA if base was RGBA or if target_channels includes A; otherwise matches base channel count.