Advanced Alpha Processor with Black Removal
White to Transparent Without the AI — the Luma-Key Node That Just Works
- image
- Output
- Black_Removed
You do not need a segmentation model for everything. If your image sits on a clean white (or black) background - a logo, a screenshot, generated art on a flat ground - reaching for BiRefNet is like calling in an excavator to move a potted plant. This node is the trowel: a tiny, dependency-free luma key that turns brightness into an alpha channel in pure numpy. No model download, no VRAM, no API, no key. The "Advanced" in the name is doing heavy lifting, but the idea is as old as Photoshop's "white to transparent" trick.
It comes from a Japanese indie dev (852wa), ships one node, and the README is in Japanese. There's basically no community noise around it yet, so this article is me reading the source so you don't have to.
How it works
Feed it an image and it runs a five-step pipeline per frame: gamma-correct the RGB, flatten to grayscale (Rec. 709 luma weights), build an alpha channel from the original pixels' luma, then - because invert_alpha defaults to enable - flip it so bright pixels become transparent and dark pixels become opaque. Finally it premultiplies the RGB by alpha and applies the inverse gamma so your colors don't go mushy. Two outputs come out:
- Output - the straight inverted-alpha key.
- Black_Removed - the same thing, plus any pixel where all three channels are below
remove_black_thresholdhas its alpha forced to zero. That's the knob aimed at black-background art; the README says to run it withmidrange_cutoff.
The inputs that matter
Only image is required; everything else has a sensible default. The ones a beginner actually touches:
invert_alpha- leave it on unless you want black to become transparent instead of white.remove_black_threshold(0.15) - how aggressive the black cut on the second output is. Raise it to eat more shadow, lower it to keep dark detail.gamma_correction(2.2) - bump it up to push brights brighter and darks darker before the key; lower it to compress midtones.
The rest you can ignore for a while. midrange_cut + cut_threshold turn the soft alpha into a hard binary on/off mask if you want a brutal, clean edge. force_grayscale defaults to enable because the author says it's more accurate that way.
Where it fits
This is the cheap deterministic end of the background-removal spectrum. The KB's take: BiRefNet (in ComfyUI core since May 2026) is your default for hair, fur, and messy backgrounds; LayerDiffusion bakes alpha in at generation time. This node is for the flat, single-color cases where a semantic model is overkill - and where you want identical, repeatable results on a whole batch. One honest warning: luma keying leaves a grey fringe on soft or textured edges. Don't reach for it on hair, and don't use it to "clean up" a LoRA training set - removing backgrounds from training data is a known footgun.
Install
ComfyUI Manager → search ComfyUI-AdvancedAlphaProcessor, or the manual way:
cd ComfyUI/custom_nodes
git clone https://github.com/852wa/ComfyUI-AAP
Then restart ComfyUI. There are no model downloads and no heavy dependencies - requirements.txt is just numpy and torch, both of which ComfyUI already ships. This is about as clean an install as the ecosystem offers.
Gotchas
The big one: this node outputs RGBA tensors, but not every node in a graph preserves alpha - some silently drop the channel. Save through SaveImage (PNG keeps alpha; JPEG destroys it) and preview with PreviewImage. If your "transparent" output comes back as a black block, you've hit a node that ate the alpha, not a node bug. For batch work, the README points you at feeding in Load Images (multiple) - the node already loops over the whole batch internally. And if dark speckles survive in the first output, just grab the second.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| invert_alpha | COMBO | enable | 2 options: enable, disable |
| midrange_cut | COMBO | disable | 2 options: disable, enable |
| cut_threshold | FLOAT | 0.500–1 | — |
| gamma_correction | FLOAT | 2.21–3 | — |
| remove_black_threshold | FLOAT | 0.150–1 | — |
| force_grayscale | COMBO | enable | 2 options: enable, disable |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| Output | IMAGE | — |
| Black_Removed | IMAGE | — |