BiRefNet_HR-matting-fp16 (MLX)

mlx-community/BiRefNet_HR-matting-fp16 is an fp16 MLX conversion of 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:

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.

Downloads last month

-

Downloads are not tracked for this model. How to track
Safetensors
Model size
0.2B params
Tensor type
F16
·
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for mlx-community/BiRefNet_HR-matting-fp16

Finetuned
(1)
this model

Collection including mlx-community/BiRefNet_HR-matting-fp16