AlphaChanelRestore
Repair a damaged alpha without touching the pixels
- images
- IMAGE
AlphaChanelRestore takes an RGBA image and resets its alpha channel to fully opaque - every pixel's alpha becomes 1.0 - while leaving the RGB data completely alone. If you've ever had a cutout come out with mangled, half-transparent, or "burned" edges that render as ugly dark fringes against a background, this is the blunt instrument that fixes it: keep the pixels, throw away the broken transparency.
The mechanism is deliberately conservative. The node clones the tensor, checks it actually has four channels, and writes ones into the alpha plane. If the input is already plain RGB, it returns it unchanged - so you can drop this node into a pipeline without worrying about it erroring on the wrong channel count. Nothing else moves: colors, resolution, batch, all preserved.
Where does it fit? Realistically, after something upstream has done something weird to alpha. Some upscalers, resizers, and even certain loaders produce semi-transparent or edge-artifacted alpha that makes a subject look ghosted or rim-lit with the background's color. Restore is the "just make it opaque again" escape hatch. It's also the opposite of AlphaChanelRemove (which deletes alpha) and complements AlphaChanelAdd (which creates a fresh opaque alpha) - the family's whole job is keeping your channel state predictable. Same one-L "Chanel" spelling as every node in this family.
One honest caveat: it's a blunt tool. If the transparency is real - a true partial-alpha edge you want to keep - Restore will flatten it. And if the problem is actually that the RGB pixels themselves are contaminated (a background-colored fringe baked into the color channels), resetting alpha won't fix that; you'd want to re-cut the subject or clean the color instead. Restore fixes alpha problems only.
Installing it
It ships with the Allor plugin:
cd ComfyUI/custom_nodes
git clone https://github.com/Nourepide/ComfyUI-Allor
cd ComfyUI-Allor
pip install -r requirements.txt
Restart ComfyUI, or search "Allor" in ComfyUI Manager. Pack-level notes: requirements.txt installs rembg and onnx for the segmentation nodes even though this node is pure tensor math, and Allor's repo was rebased to strip images from git history - a change that can make auto-updates fail, with dedicated troubleshooting pages in the docs at nourepide.github.io/ComfyUI-Allor-Doc.
Real talk
AlphaChanelRestore is the "have you tried turning the alpha off and on again" of the alpha family, and sometimes that's exactly the right move. It won't fix a bad cutout - the pixels are the pixels - but it will cleanly erase the transparency weirdness that makes a good cutout look broken. The trap is reaching for it when the real problem is in the RGB; diagnose first, flatten second.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |