▢➜⬛ Remove image Transparency (alpha)
Flatten an RGBA image before it breaks something
- image
- IMAGE
Run an image through a background-removal node like rembg and you get back an RGBA image - three color channels plus an alpha channel marking what's transparent. Great for compositing, terrible for anything downstream that doesn't expect an alpha channel at all. A lot of ComfyUI nodes (and most video encoders) just don't handle transparency gracefully, so you end up with weird artifacts or outright errors. This node exists to flatten that alpha channel back into a normal RGB image before it causes a problem, by filling in whatever was transparent with a solid color.
How it works
It's deliberately simple: take the image, look at the alpha channel, and paint every transparent pixel with the color you picked. Three choices - black, white, or greenscreen. That last one is the interesting option: instead of a plain fill, it swaps the transparent areas for chroma-key green, which sets you up to run the image through a different pipeline later that keys the green back out (the pack has a separate node, Green Screen to Transparency, that does exactly that in reverse). Basically it lets you round-trip through a greenscreen intermediate if some tool in your chain insists on flat RGB in the middle.
There's also a recover_background toggle, off by default. Rather than just slapping on a flat color, enabling it appears to try reconstructing what was likely behind the cut-out subject instead of painting a uniform block - useful if a hard flat fill looks obviously fake around soft edges like hair.
The inputs and outputs that matter
image(IMAGE) - your RGBA image, typically straight out of a background-removal node.background_color(enum:black/white/greenscreen, defaultblack) - what to fill the transparent areas with. This is the one setting you'll actually touch.recover_background(BOOLEAN, default off) - try to reconstruct the background instead of a flat fill.- Output:
IMAGE- a normal, alpha-free RGB image.
How to install it
Via ComfyUI Manager: search Bjornulf_custom_nodes, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/justUmen/Bjornulf_custom_nodes
cd Bjornulf_custom_nodes && pip install -r requirements.txt
then restart ComfyUI. This particular node is plain image manipulation - no model downloads, nothing heavy - but you're installing the whole 170-node pack either way, and the shared requirements.txt covers everything from Ollama chat to FFmpeg video handling, so don't be surprised the install pulls in more than this one node needs.
Common issues & troubleshooting
You skip this and the next node errors out on alpha. This is the most common reason people reach for it in the first place - some downstream node (a video encoder, an upscaler, whatever) throws an error or produces garbage specifically because the image still has 4 channels. If a node works fine on some images and fails only on ones that went through background removal, check for a leftover alpha channel first.
The fill color looks obviously fake. A flat black or white fill around fine detail like hair or fur will look pasted-in if you're compositing onto something else later. That's exactly the case recover_background is meant to soften - try it before reaching for a manual paint fix.
Remember this pack's own warning label. The README calls the whole thing "very active development, work in progress," and functionality like this shifts across versions. If behavior changes after an update, check the changelog rather than assuming your workflow is misconfigured.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| recover_background | BOOLEAN | false | — |
| background_color | COMBO | black | 3 options: black, white, greenscreen |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |