Run this model with HF Jobs
Run mlx-community/BiRefNet-fp16 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/mlx-community/BiRefNet-fp16. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/mlx-community/BiRefNet-fp16 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use mlx-community/BiRefNet-fp16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/BiRefNet-fp16 with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download mlx-community/BiRefNet-fp16 --local-dir BiRefNet-fp16
- BiRefNet
How to use mlx-community/BiRefNet-fp16 with BiRefNet:
# Option 1: use with transformers from transformers import AutoModelForImageSegmentation birefnet = AutoModelForImageSegmentation.from_pretrained("mlx-community/BiRefNet-fp16", trust_remote_code=True)# Option 2: use with BiRefNet # Install from https://github.com/ZhengPeng7/BiRefNet from models.birefnet import BiRefNet model = BiRefNet.from_pretrained("mlx-community/BiRefNet-fp16") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
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.
Quantized
Model tree for mlx-community/BiRefNet-fp16
Base model
ZhengPeng7/BiRefNet