Bria Remove Foreground
The inverse of cutout, and weirder than it sounds
- images
- output_images
Most background-removal nodes kill the background and keep the subject. RemoveForegroundNode (shown as Bria Remove Foreground) does the opposite: it keeps the background and deletes the subject. If you've ever needed the empty room behind a person, the backdrop without the model, or the shelf minus the product - that's this node. It's the background-removal family's quiet second trick, and it saves you from the "clone over the subject with an inpaint prompt" dance.
How it works
Feed it images plus your api_key, and it POSTs each frame to Bria's /v2/image/edit/erase_foreground endpoint. The API figures out what the foreground subject is and reconstructs the scene behind it - which is why this is genuinely harder than plain RMBG. Removal isn't just masking; the model has to infer what the occluded background looks like and regenerate it. That's generative inpainting under the hood, and it's why results can range from seamless to "weird blurry smear" depending on how much of the background the subject was covering.
Like RmbgNode, it iterates over the whole batch, one API call per image.
Inputs and outputs
- images - input batch, any number of frames.
- api_key - the BRIA token; the
BRIA_API_TOKENdefault placeholder must be replaced. - preserve_alpha (default true) - keep transparency so the cleaned background stays compositable.
- visual_input_content_moderation / visual_output_content_moderation (both default false) - Bria's safety checkpoints, off unless you need them.
One output: output_images, a list of tensors. Error handling differs from RmbgNode in a way worth knowing: if a frame fails, the node substitutes the original image as the fallback rather than an empty tensor. So a failed frame silently passes through unremoved - you'll see the subject still there and think the model just underperformed. Check each output.
Installing it
Part of the BRIA AI API nodes pack (Bria-AI/ComfyUI-BRIA-API). ComfyUI Manager → search BRIA API → install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/Bria-AI/ComfyUI-BRIA-API
Restart ComfyUI; it's under API Nodes. No models to download, no GPU requirement - it's a cloud call that needs a BRIA API token from platform.bria.ai, and each frame processed is billed to that account.
Practical notes
This is the node to pair with RmbgNode when you want both halves of a scene: cut the subject out with one, get the clean backdrop with the other, and recombine however you like. Keep expectations in check on how much scene the model can invent - a subject covering 60% of the frame gives the background-reconstruction a lot of guesswork, and the result shows it. If the recovered background has obvious seams, run it through an upscale or inpainting pass locally rather than burning another API call trying to get it perfect in one shot.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| api_key | STRING | BRIA_API_TOKEN | — |
| visual_input_content_moderationopt | BOOLEAN | false | — |
| visual_output_content_moderationopt | BOOLEAN | false | — |
| preserve_alphaopt | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output_images | IMAGE | — |