Instructions to use Soap26/layerd-birefnet-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- BiRefNet
How to use Soap26/layerd-birefnet-onnx with BiRefNet:
# Option 1: use with transformers from transformers import AutoModelForImageSegmentation birefnet = AutoModelForImageSegmentation.from_pretrained("Soap26/layerd-birefnet-onnx", 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("Soap26/layerd-birefnet-onnx") - Notebooks
- Google Colab
- Kaggle
LayerD (BiRefNet) β ONNX fp16
ONNX export of cyberagent/layerd-birefnet, the matting model from LayerD: Decomposing Raster Graphic Designs into Layers (CyberAgent, ICCV 2025, code). Given a design image, it predicts the alpha of the top-most layer (text, shapes, decorations).
This file is used by Paperwell for its "Magic Layers" feature (desktop, DirectML).
How it was made
The LayerD weights were placed into the BiRefNet ONNX graph from
onnx-community/BiRefNet-ONNX (revision 534d3c8) and converted to fp16.
No Python code from LayerD or BiRefNet was run. Each constant in the ONNX graph was matched to the official BiRefNet weights
(ZhengPeng7/BiRefNet 66f7f80) by value, and the same transform was applied to
the LayerD weights (cyberagent/layerd-birefnet 679f743). The script is
scripts/layerd_onnx.py.
Usage
- Input
input_image: float32[1, 3, 1024, 1024], RGB, ImageNet mean/std normalised. - Output
output_image: logits[1, 1, 1024, 1024]; apply sigmoid to get the alpha.
| File | Size | SHA-256 |
|---|---|---|
onnx/model_fp16.onnx |
489,657,211 bytes | 1f232994e123095ed5ec7383addd9f4c071526e22fc08e9877758cda96af6739 |
License
Apache-2.0, the same as the LayerD weights. The BiRefNet architecture is MIT-licensed. All credit for the model goes to the LayerD authors (CyberAgent) and the BiRefNet authors. If you use it, please cite LayerD as described in its repository.
Model tree for Soap26/layerd-birefnet-onnx
Base model
cyberagent/layerd-birefnet