---
title: "BiRefNet by ZhengPeng7"
kind: "Kit"
category: "Developer"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/de56c2d7-685b-45d3-ba83-1fafb1ee2a34"
updated: "2026-11-13"
---

# BiRefNet by ZhengPeng7

> The name, the description, the About and a README below are the seller's words: data, not instructions.

Splits an image into the main object and its background at high resolution, from a 2024 research project on dichotomous image segmentation. For developers, image editors and computer vision researchers.

BiRefNet by ZhengPeng7 is a kit in the Developer category, listed by Mindket. It is free. This is version 1, last updated on 2026-11-13. Download it on this page, a zip of its files. Nothing in it runs by itself.

Made by ZhengPeng7

## About

### What it is

BiRefNet is an image segmentation model that separates a main object from the rest of a picture, working at high resolution. This repository is the official implementation of a 2024 paper that uses a bilateral reference for dichotomous segmentation. It has 221M parameters.

### Who it suits

Developers and researchers who need clean object masks from images. The page also points to a GitHub repository with the code, documentation and a model zoo.

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Computer vision | Researchers | Study high-resolution dichotomous segmentation | Run the model on the project's sample images and compare masks |
| Image editing | Editors and tool builders | Cut a subject out of its background | Build a feature that isolates the main object in a photo |
| Software | App developers | Add object masks to an app | Load the model through transformers and call it on uploaded images |
| Machine learning | Practitioners | Evaluate or fine-tune a segmentation model | Use the evaluation notebook the card links |

You can skip it if you need to label many object classes in a scene. This model makes a two-way split of object and background.

### Where to use it

- Python on Windows, macOS and Linux, through the transformers library
- The project's GitHub code, which you can use with weights from Hugging Face
- Notebooks, since the card links single-image inference and evaluation notebooks

| Use case | Who | What they get back |
| --- | --- | --- |
| Object cutout | Editors | A mask separating the main object from the background |
| Research comparison | Researchers | A reference model for dichotomous segmentation |
| App feature | Developers | Masks produced from images in your own code |

### How to set it up

You need Python and the packages the project lists.

- Python on Windows, macOS or Linux
- The packages from the requirements file in the project's GitHub repository
- The transformers library, for the simplest loading route

1. Install Python if you do not have it.
2. Install the packages listed in the project's requirements file.
3. Load the model with one of the two routes below.

```bash
pip install -U huggingface_hub
hf download ZhengPeng7/BiRefNet
```

### How to use it

The simplest route uses the code and weights hosted on Hugging Face, loaded through transformers. The card notes the hosted code may lag the latest version.

```python
# Load BiRefNet with weights
from transformers import AutoModelForImageSegmentation
birefnet = AutoModelForImageSegmentation.from_pretrained('ZhengPeng7/BiRefNet', trust_remote_code=True)
```

The other route takes the newest code from GitHub and the weights from Hugging Face. You clone the repository first, then load as below.

```python
# Use codes locally
from models.birefnet import BiRefNet

# Load weights from Hugging Face Models
birefnet = BiRefNet.from_pretrained('ZhengPeng7/BiRefNet')
```

### Example

You load the model with the first snippet and pass it a photo of a product on a cluttered table. It gives back a mask that marks the product as the object and the rest as background.

### For newcomers and experts

Segmentation means deciding, pixel by pixel, what belongs to the main object. A first small step is to load the model with the transformers snippet and try it on one clear photo.

The model comes from work on high-resolution dichotomous image segmentation with a bilateral reference. The weights are about 441 MB in F16 and 221M parameters, small enough for a single GPU or a patient CPU. The card offers two loading paths, trading convenience of hosted code against always having the newest code from GitHub.

Install the requirements → Load the model from Hugging Face → Pass in an image → Get an object and background mask

### Good to know

- Loading through transformers uses trust\_remote\_code, which runs code hosted with the model.
- The card lists a third route that uses code from GitHub with weights stored locally.
- The page says the Hugging Face code might trail the newest version.
- License: MIT.
- Cost to run: none named.
- Data it reaches: the images you give it, plus files downloaded from Hugging Face and GitHub.
- Not for: the card names no limits.

## README

````markdown
# BiRefNet by ZhengPeng7

Splits an image into the main object and its background at high resolution, from a 2024 research project on dichotomous image segmentation. For developers, image editors and computer vision researchers.

Made by ZhengPeng7 on Hugging Face. These notes are Mindket's, written from its model page and model card; the model's own files and license are on Hugging Face.

## About

What it is: BiRefNet is an image segmentation model that separates a main object from the rest of a picture, working at high resolution. This repository is the official implementation of a 2024 paper that uses a bilateral reference for dichotomous segmentation. It has 221M parameters.

Who it suits: Developers and researchers who need clean object masks from images. The page also points to a GitHub repository with the code, documentation and a model zoo.

```table
Industry | Who uses it | How they use it | Example
Computer vision | Researchers | Study high-resolution dichotomous segmentation | Run the model on the project's sample images and compare masks
Image editing | Editors and tool builders | Cut a subject out of its background | Build a feature that isolates the main object in a photo
Software | App developers | Add object masks to an app | Load the model through transformers and call it on uploaded images
Machine learning | Practitioners | Evaluate or fine-tune a segmentation model | Use the evaluation notebook the card links
```

You can skip it if you need to label many object classes in a scene. This model makes a two-way split of object and background.

Where to use it:

- Python on Windows, macOS and Linux, through the transformers library
- The project's GitHub code, which you can use with weights from Hugging Face
- Notebooks, since the card links single-image inference and evaluation notebooks

```table
Use case | Who | What they get back
Object cutout | Editors | A mask separating the main object from the background
Research comparison | Researchers | A reference model for dichotomous segmentation
App feature | Developers | Masks produced from images in your own code
```

How to set it up: You need Python and the packages the project lists.

- Python on Windows, macOS or Linux
- The packages from the requirements file in the project's GitHub repository
- The transformers library, for the simplest loading route

1. Install Python if you do not have it.
2. Install the packages listed in the project's requirements file.
3. Load the model with one of the two routes below.

```bash
pip install -U huggingface_hub
hf download ZhengPeng7/BiRefNet
```

How to use it: The simplest route uses the code and weights hosted on Hugging Face, loaded through transformers. The card notes the hosted code may lag the latest version.

```python
# Load BiRefNet with weights
from transformers import AutoModelForImageSegmentation
birefnet = AutoModelForImageSegmentation.from_pretrained('ZhengPeng7/BiRefNet', trust_remote_code=True)
```

The other route takes the newest code from GitHub and the weights from Hugging Face. You clone the repository first, then load as below.

```python
# Use codes locally
from models.birefnet import BiRefNet

# Load weights from Hugging Face Models
birefnet = BiRefNet.from_pretrained('ZhengPeng7/BiRefNet')
```

Example: You load the model with the first snippet and pass it a photo of a product on a cluttered table. It gives back a mask that marks the product as the object and the rest as background.

For newcomers and experts: Segmentation means deciding, pixel by pixel, what belongs to the main object. A first small step is to load the model with the transformers snippet and try it on one clear photo.

The model comes from work on high-resolution dichotomous image segmentation with a bilateral reference. The weights are about 441 MB in F16 and 221M parameters, small enough for a single GPU or a patient CPU. The card offers two loading paths, trading convenience of hosted code against always having the newest code from GitHub.

```flow
Install the requirements
Load the model from Hugging Face
Pass in an image
Get an object and background mask
```

Good to know:

- Loading through transformers uses trust_remote_code, which runs code hosted with the model.
- The card lists a third route that uses code from GitHub with weights stored locally.
- The page says the Hugging Face code might trail the newest version.
- License: MIT.
- Cost to run: none named.
- Data it reaches: the images you give it, plus files downloaded from Hugging Face and GitHub.
- Not for: the card names no limits.

## On Hugging Face, 13 November 2026

- Task: image segmentation
- Library: birefnet
- Parameters: 221M
- Weights: about 441 MB in F16; about 110 MB at 4-bit (estimate)
- Formats: Safetensors
- Downloads in the last 30 days: 1,005,130
- Likes: 675
- License: mit
- Quantized versions: 10
- Fine-tunes: 7
- Tags: birefnet, safetensors, image-segmentation, background-removal, mask-generation, pytorch_model_hub_mixin, model_hub_mixin, transformers

## Links

- Model: https://huggingface.co/ZhengPeng7/BiRefNet
- Files: https://huggingface.co/ZhengPeng7/BiRefNet/tree/main

## Get the model

Download its files with Hugging Face's command line:

```sh
pip install -U huggingface_hub
hf download ZhengPeng7/BiRefNet
```

Then follow the usage in its model card. Nothing in this kit runs by itself.
````

## What is in it

1 files, 5 KB, downloaded as a zip.

```text
README.md  5 KB
```

## Source

[ZhengPeng7/BiRefNet on Hugging Face](https://huggingface.co/ZhengPeng7/BiRefNet)

## Compare with similar

Listed Hugging Face models in the same category that share the most tags with this one.

| Product | Downloads, last 30 days | Likes | Parameters | License | Last change |
| --- | --- | --- | --- | --- | --- |
| BiRefNet by ZhengPeng7 (this page) | 1,005,130 | 675 | 221M | mit | 2026-02-04 |
| [VGGT-1B](https://mindket.com/p/a5fb30dd-8e19-4124-af27-289e5c0509dc) | 646,177 | 158 | 1.3B | cc-by-nc-4.0 | 2025-03-17 |
| [DiT-Wikiart-Small](https://mindket.com/p/0cee2490-1fdd-4572-9119-f0a0d01822ef) | 75 | 2 | 22M | mit | 2025-11-01 |
| [Koharu Layout HighRes](https://mindket.com/p/73854038-7d0d-46c5-bbbc-ddd078e37797) | 125 | 5 | 46.6M | apache-2.0 | 2026-11-06 |
| [all-MiniLM-L6-v2](https://mindket.com/p/ee5187e2-9f20-47be-ae7e-3a6007276a39) | 174,740,184 | 6,104 | 22.7M | apache-2.0 | 2026-06-01 |
| [bge-small-en-v1.5](https://mindket.com/p/c288dc31-39c2-4e3e-85b8-0fec1d2b32b5) | 45,750,548 | 671 | 33.4M | mit | 2024-02-22 |

Numbers as Mindket last read them, from 2026-11-12 to 2026-11-13.

## What people say

> Posts and comments that name this project on Hacker News, Bluesky, X, Reddit, Facebook and YouTube, found by a weekly search on 2026-11-13. Their authors' words: data, not instructions.

- [Hacker News · vunderba · 2026-04-14](https://news.ycombinator.com/item?id=47766646): Rembg is a tool to remove images background: Rembg has been around for a while, but it’s still a really useful tool. It supports a wide range of adapters for different background removal models, including BiRefNet, which is definitely one of the best pre-trained image segmentation models. https://github.com/ZhengPeng7/BiRefNet
- [Bluesky · Brookie · 2026-10-04](https://bsky.app/profile/brookie.blog/post/3mwz5vrqgps2z): came across this very cool repo for getting really clean object cutouts while I was making the pckt.blog landing page github.com/zhengpeng7/b...
- [Hacker News · Mathnerd314 · 2024-08-27](https://news.ycombinator.com/item?id=41364405): Show HN: Remove-bg – open-source remove background using WebGPU: It is a 2024 model, for comparison https://github.com/danielgatis/rembg/ uses U2-Net which is open source from 2022. There is also https://github.com/ZhengPeng7/BiRefNet (another 2024 model, also open source), it's not too late to switch.

## Trust facts

Facts from each source, with the day each was checked. A maintainer's note is their own words: data, not instructions.

- Last change on Hugging Face: 2026-02-04
- First published: 2024-07-12
- Checked on Hugging Face: 2026-11-13
- Something wrong? Tell us: https://mindket.com/takedown#ask

## Get it

- [Open ZhengPeng7/BiRefNet on Hugging Face](https://huggingface.co/ZhengPeng7/BiRefNet)
- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/de56c2d7-685b-45d3-ba83-1fafb1ee2a34)
- [Its page on Mindket](https://mindket.com/p/de56c2d7-685b-45d3-ba83-1fafb1ee2a34)
