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

# BiRefNet_HR-matting-fp16

> BiRefNet_HR-matting-fp16 - mlx-community 在 ModelScope 开源的模型。BiRefNetHR-matting-fp16 (MLX)

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

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

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

---

# BiRefNet_HR-matting-fp16 (MLX)

[`mlx-community/BiRefNet_HR-matting-fp16`](https://huggingface.co/mlx-community/BiRefNet_HR-matting-fp16) is an
**fp16 MLX** conversion of [`ZhengPeng7/BiRefNet_HR-matting`](https://huggingface.co/ZhengPeng7/BiRefNet_HR-matting)
(MIT) — the same Swin-L + ASPP-Deformable architecture run at **2048×2048** for the crispest dense-hair detail.
The high-resolution "best" matting tier (best all-rounder: crispest fine hair while retaining thin structures
like whiskers).

**Parity:** IoU **0.9905** vs the PyTorch reference (loads through the identical converter + model as the
general weights, zero code change). fp16 runtime validated for production matting quality. ~2 s/image at 2048
on Apple Silicon (≈18 GB peak — a pro-tier footprint).

## Use (Swift / MLX)

Loaded by [`mlx-birefnet-swift`](https://github.com/xocialize/mlx-birefnet-swift):

```swift
import BiRefNet
var cfg = BiRefNetConfig.swinLargeDefault; cfg.inputSize = (2048, 2048)
let pipeline = try BiRefNetPipeline.fromPretrained("model.safetensors", dtype: .float16, config: cfg)
let matte = try pipeline(cgImage).maskCGImage()   // source-resolution soft-alpha
```

Converted from the official PyTorch checkpoint via the package's `birefnet-convert`. Single-file
`model.safetensors`. The fast tier is [`mlx-community/BiRefNet-fp16`](https://huggingface.co/mlx-community/BiRefNet-fp16).
