ComfyUI Node

AE Unmult RGBA

Kill the black background on glow effects, keep the alpha

By lingziwyh·Created 5 months ago·Updated 3 days ago· 7
AE Unmult RGBA
  • image
  • rgba
modemax_rgb
black_point0.000
white_point1.000
alpha_gamma1.00
alpha_gain1.00
despill_blackfalse
preserve_input_alphatrue

Black-background effects are everywhere in the gift-animation and livestream world: fire, sparks, fireworks, glows, light streaks, magic swirls - all rendered as bright pixels on pure black. That's a fine delivery format, but you can't composite it over anything else until the black becomes transparency. AE Unmult RGBA is the node that makes the conversion: it looks at how bright each pixel is against black, turns that into an alpha channel, and outputs a proper RGBA layer you can stack anywhere.

It's a direct nod to the classic After Effects "UnMult" trick, and it's the front door of this pack's transparent-pipeline workflow: black effect → UnMult → stack with AE Alpha Over RGBA → final RGBA.

How it works

The math is short and worth knowing, because every control maps onto it. First it guesses an alpha matte from brightness. Then it unpremultiplies - divides the RGB by that alpha - so a pixel that was 50% bright on black becomes a 100%-bright pixel at 50% alpha. The glow stays additive and translucent instead of being crushed into dim opaque pixels. That's the core of the whole UnMult idea.

The mode dropdown picks how brightness is measured. max_rgb (the default) uses the strongest color channel - it's the one you want for colored glows, because luma-weighted modes can desaturate the edges of a red-orange flame. The other three are standard luminance weights: luma_rec709 (HD perceptual), luma_rec601 (classic SD), and average_rgb (plain channel mean). For most glow/particle work, max_rgb is the right call and the other modes are there for matching specific footage.

The inputs that matter

  • image - your black-background IMAGE, RGB or RGBA.
  • black_point / white_point - a Levels-style remap on the alpha. Raising black_point (from 0 toward ~0.02) kills faint gray noise so it doesn't become semi-transparent haze; lowering white_point makes pixels reach full opacity sooner.
  • alpha_gamma / alpha_gain - shape the alpha curve. Gamma around 0.8–1.0 is the typical starting range; gain multiplies the matte (1.0 default).
  • despill_black - extra cleanup that removes dark contamination left on semi-transparent pixels. Off by default, because the classic UnMult look should preserve glow softness.
  • preserve_input_alpha - if your input is already RGBA, the generated alpha is multiplied by the existing one. Defaults on.

Output is rgba: [B, H, W, 4], ready for AE Alpha Over RGBA or any compositor.

Where it goes wrong

UnMult assumes black means transparent. Feed it a glow on a mid-gray background and you'll get a gray halo that no slider on this node fully fixes - that's what keying/despill tools are for. And because it divides by alpha, tiny-alpha pixels can spike toward white; black_point and alpha_gamma are your levers for taming that. Also note that ComfyUI's default preview draws on black, so a clean-looking preview can still have a fine alpha edge - check the alpha channel directly before shipping it down the line.

Install

It ships in lingziwyh/ComfyUI-GiftHelperSuite, which is pure torch with no requirements.txt and no model downloads. ComfyUI Manager: search ComfyUI-GiftHelperSuite, or:

cd ComfyUI/custom_nodes
git clone https://github.com/lingziwyh/ComfyUI-GiftHelperSuite

then restart ComfyUI. One genuinely important note from the README: this node supersedes the old standalone ComfyUI_Unmult_AE package - if you have that installed, remove it, or ComfyUI will hit duplicate node registration and may refuse to load the pack.

Categoryimage/alpha

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
modeCOMBOmax_rgb4 options: max_rgb, luma_rec709, luma_rec601, average_rgb
black_pointFLOAT0.0000–1
white_pointFLOAT1.0000.001–1
alpha_gammaFLOAT1.000.05–5
alpha_gainFLOAT1.000–4
despill_blackBOOLEANfalse
preserve_input_alphaBOOLEANtrue

Outputs (1)

NameTypeDescription
rgbaIMAGE