---
title: BiRefNet-fp16
canonical_url: "https://www.modelscope.cn/models/mlx-community/BiRefNet-fp16"
md_url: "https://www.modelscope.cn/models/mlx-community/BiRefNet-fp16.md"
repository: mlx-community/BiRefNet-fp16
last_updated: 2026-06-23
license: mit
pipeline_tag: image-segmentation
tasks:
  - image-segmentation
base_model:
  - ZhengPeng7/BiRefNet
base_model_relation: finetune
parameters: 220.2M
tensor_type:
  - F16
library_name:
  - mlx
  - safetensors
  - pytorch
frameworks:
  - pytorch
downloads: 32
stars: 0
tags:
  - mlx
  - image-segmentation
  - matting
  - background-removal
  - birefnet
---

# BiRefNet-fp16

> BiRefNet-fp16 - mlx-community 在 ModelScope 开源的模型。mlx-community/BiRefNet-fp16 is an fp16 MLX conversion of ZhengPeng7/BiRefNet (MIT) — a Swin-L + ASPP-Deformable foreground segmentation / matting model at 1024×1024, producing a single-channel soft-alpha matte…

mlx-community/BiRefNet-fp16 是 ModelScope 魔搭社区上的 220.2M 参数image-segmentation模型，采用 mit 许可，基于 ZhengPeng7/BiRefNet 构建。

- **Repository**: mlx-community/BiRefNet-fp16
- **License**: mit
- **Tasks**: image-segmentation
- **Parameters**: 220.2M
- **Base model**: ZhengPeng7/BiRefNet
- **Tags**: mlx, image-segmentation, matting, background-removal, birefnet
- **Downloads**: 32
- **Stars**: 0
- **Last updated**: 2026-06-23

Source: https://www.modelscope.cn/models/mlx-community/BiRefNet-fp16

---

# BiRefNet-fp16 (MLX)

[`mlx-community/BiRefNet-fp16`](https://huggingface.co/mlx-community/BiRefNet-fp16) is an **fp16 MLX** conversion
of [`ZhengPeng7/BiRefNet`](https://huggingface.co/ZhengPeng7/BiRefNet) (MIT) — a Swin-L + ASPP-Deformable
foreground segmentation / matting model at **1024×1024**, producing a single-channel soft-alpha matte
(white = foreground). The fast, general-purpose tier.

**Parity:** IoU **0.9905** vs the PyTorch reference (zero unused keys). fp16 runtime validated for production
matting quality.

## Use (Swift / MLX)

Loaded by [`mlx-birefnet-swift`](https://github.com/xocialize/mlx-birefnet-swift) — the vendored `BiRefNet`
core plus a conformant MLXEngine `matting` ModelPackage:

```swift
import BiRefNet
let pipeline = try BiRefNetPipeline.fromPretrained("model.safetensors", dtype: .float16)  // inputSize 1024
let matte = try pipeline(cgImage).maskCGImage()   // source-resolution soft-alpha
```

Converted from the official PyTorch checkpoint via the package's `birefnet-convert` (PyTorch NCHW → MLX NHWC;
754 → 687 tensors). Single-file `model.safetensors`. See also the higher-res tier
[`mlx-community/BiRefNet_HR-matting-fp16`](https://huggingface.co/mlx-community/BiRefNet_HR-matting-fp16).
