BiRefNet: RAM, speed and settings on a Mac
BiRefNet removes the background from a photo. PocketWebTools for Mac ships three versions of it, all running on the GPU through Core ML. Below is what we measured on a 16 GB M1 Pro, and what it took to get the model running on Apple's framework at all.
Which Mac runs it
- Mac memory
- 8 GB and up
All three versions.
- BiRefNet lite
- 82 MB download, 0.5 GB of memory
0.45 s a photo once warm.
- BiRefNet
- 407 MB download, 1.3 GB of memory
1.06 s a photo once warm. The app's default.
- BiRefNet matting
- 407 MB download
About 1 s a photo. Soft edges for hair, fur, glass and smoke.
BiRefNet speed on an M1 Pro
Measured in the app's own engine on a 16 GB M1 Pro.
- BiRefNet, one photo
- 1.06 s
Warm, on the GPU.
- BiRefNet lite, one photo
- 0.45 s
Warm, on the GPU.
- Edge refinement afterwards
- 2.2 to 2.4 s for a four-tile photo
ViTMatte redraws the edge at the photo's full resolution, about 0.6 s per 800-pixel tile.
- Core ML against the reference
- 0.974 overlap
Mask overlap (IoU) with the original model run on the CPU. The lite version scored 0.997.
Settings the app runs BiRefNet with
- Format
- Core ML package (.mlpackage)
Community conversions of the original MIT weights, pinned to one revision and checked against a SHA-256 after download.
- Precision
- 16‑bit compute, 32‑bit input and output
- Input size
- 1,024 by 1,024 pixels
The mask is made at this size and scaled back to the photo.
- Compute units
- GPU
Set to CPU only, the full model returned an empty mask.
- Why not ONNX Runtime
- It did not compile
ONNX Runtime's Core ML provider split BiRefNet into 35 to 88 pieces and then failed to build them, so the app calls Core ML directly.
What the app does with BiRefNet
Isolate
Removes the background from every photo you drop, or a whole folder. The result is cut from the original, so it keeps the photo's full size.
Full-resolution edges
With ViTMatte installed, the edge of the mask is redrawn over the original pixels, so a 24 megapixel photo keeps real hair and fur detail.
Formats
Opens what macOS opens, HEIC and camera RAW included. Saves PNG, WebP or TIFF with transparency, JPEG over a colour, or the mask alone.
Where it falls short
- The model sees a 1,024-pixel copy of the photo. On a large photo the raw mask is soft at the edges until ViTMatte refines it.
- It needs the GPU. On the CPU the full model produced nothing usable.
- Core ML compiles each model once after the download, before the first photo.
- It decides what the subject is on its own. To choose one object among several, the app has a click-to-pick mode on SAM 2.1.
Run BiRefNet in PocketWebTools for Mac
One app for chat, transcription, documents, voices, photos and video, with every model on your Mac. $99 once, free lifetime updates.
BiRefNet questions
- How fast is BiRefNet on an M1 Pro?
- 1.06 seconds a photo for the full model and 0.45 seconds for BiRefNet lite, warm, on the GPU through Core ML on a 16 GB M1 Pro.
- How much RAM does BiRefNet need?
- The full model held 1.3 GB for the whole process and the lite model 0.5 GB. Both are filed under 8 GB Macs in PocketWebTools for Mac.
- Does BiRefNet run on Core ML?
- Yes, as a Core ML package with 16‑bit compute on the GPU. Two things to know: ONNX Runtime's Core ML provider failed to compile it, and with compute units set to CPU only the full model returned an empty mask.
- BiRefNet or BiRefNet lite?
- Lite is 82 MB and more than twice as fast. The full model is 407 MB, has cleaner edges and a better sense of what the subject is, and is the app's default. The matting version is for hair, fur, glass and smoke.
- Does BiRefNet work at full resolution?
- The mask is made at 1,024 by 1,024 pixels. The app scales it to the photo and, with ViTMatte, redraws the edge over the original pixels tile by tile, which took 2.2 to 2.4 seconds on a four-tile photo.
- Can I use BiRefNet commercially?
- Yes. The weights are released under the MIT license, which allows commercial use. The app ships the license text and adds no restrictions of its own.