Skip to content

Remove Background (BiRefNet)

by Comfy OrgWorkflowMake visuals

Removes the background from a photo and gives you a transparent cut-out and a mask

View on GitHub

The problem it solves

You need ten product photos on a clean background for a listing tonight, and an online remover wants a subscription.

For Online sellersDesignersSocial-media creators

Before
You trace around the subject by hand in a photo editor, or upload every picture to a paid online tool.
After
You load a photo and get the subject on a transparent background plus a mask, made on your own computer.
Stars
★ 1.4k
License
MIT
Cost
Free
Level
Intermediate
Platform
comfyui

Examples

From the project's own repository · 2 images, swipe or use the arrows.

Example output: a woman with a crown of white lilies cut out from her background
The template's sample input: the same portrait of a woman with white lilies on a sage-green background
Image: Comfy Org (MIT). Original file

Overview

This is an official ComfyUI workflow template for removing image backgrounds with BiRefNet, an open model. You load one picture and it returns the subject on a transparent background plus a mask of the subject. It handles fine edges such as hair and fur, and the model file is under half a gigabyte. It suits online sellers, designers and anyone who needs clean cut-outs on their own computer.

It is a small, MIT-licensed model that runs locally, so cut-outs cost nothing per image and your pictures stay on your computer.

Try these first

Start with the first one: it is a small task you can check easily.

  1. Load a product photo you own, remove the background and zoom in on the edges to check the cut-out.First try · about 0.5 GB download

  2. Remove the background from this portrait and keep the loose strands of hair.

  3. Save the mask as well, so I can use it to place the subject on a new background.

Example prompts written by Agent Flows Hub.

How it works

From the creator's documentation.

StepWhat happensData goes to
1 · Model fileComfyUI lists the BiRefNet model file to download, about 424 MBYour computer
2 · PictureYou load one image with any backgroundYour computer
3 · Cut-outBiRefNet separates the subject, including fine edges such as hair and furYour computer
4 · ResultsAn image with a transparent background and a mask of the subjectYour computer

Good to know

Cut the subject out of a photo with the official BiRefNet ComfyUI template. It loads the background-removal model, processes one image and outputs a transparent-background image and a mask.

Limits

  • Very cluttered backgrounds, or subjects that blend into the background, can give less accurate masks. The template processes one image at a time and needs a recent ComfyUI version.

Notes by (original project name: utility_birefnet_remove_background (ComfyUI template)), written from the creator's documentation, not from running it ourselves. BiRefNet: Remove Image Background in ComfyUI · Remove Background: BiRefNet, pinned ComfyUI template

Stuck setting it up?

Tell us what happened. We take a look first; if it needs paid work, you get an estimate before anything starts.

Get help

Other workflows

See all 25 workflows

GitHub