BiRefNet-fp16 (MLX)

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 (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 โ€” the vendored BiRefNet core plus a conformant MLXEngine matting ModelPackage:

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.

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-fp16

Finetuned
(4)
this model

Collection including mlx-community/BiRefNet-fp16