Instructions to use 1038lab/MultiMatte with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- nobg
How to use 1038lab/MultiMatte with nobg:
pip install nobg
# Option 1: use via the predict method from nobg import AutoModel, AutoProcessor model = AutoModel.from_pretrained("1038lab/MultiMatte").eval() processor = AutoProcessor.from_pretrained("1038lab/MultiMatte") cutout = model.predict(processor, "image.jpg", "prompt")# Option 2: use the model and processor directly import torch from loadimg import load_img from nobg import AutoModel, AutoProcessor model = AutoModel.from_pretrained("1038lab/MultiMatte").eval() processor = AutoProcessor.from_pretrained("1038lab/MultiMatte") image = load_img("image.jpg").convert("RGB") inputs = processor(image, return_tensors="pt") with torch.no_grad(): outputs = model(pixel_values=inputs["pixel_values"]) alpha = processor.post_process_alpha_matting(outputs, target_sizes=[(image.height, image.width)])[0] processor.cutout(image, alpha).save("output.png") - Notebooks
- Google Colab
- Kaggle
Upload 2 files
Browse files- README.md +44 -0
- tokenizer.json +0 -0
README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: nobg
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
tags:
|
| 5 |
+
- model_hub_mixin
|
| 6 |
+
- nobg
|
| 7 |
+
- nobg-sam3
|
| 8 |
+
- promptable
|
| 9 |
+
- background-removal
|
| 10 |
+
- alpha-matting
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
<h1 align="center">MultiMatte</h1>
|
| 14 |
+
|
| 15 |
+
<p align="center"><b>Promptable SAM 3 Alpha Matting β Packaged for ComfyUI-RMBG.</b></p>
|
| 16 |
+
|
| 17 |
+
<p align="center">
|
| 18 |
+
<a href="https://github.com/1038lab/ComfyUI-RMBG"><img src="https://img.shields.io/badge/ComfyUI--RMBG-1038lab-blue?style=flat-square&logo=github"></a>
|
| 19 |
+
<a href="https://huggingface.co/feyninc/multimatte"><img src="https://img.shields.io/badge/Upstream-feyninc%2Fmultimatte-yellow?style=flat-square"></a>
|
| 20 |
+
<a href="https://github.com/feyninc/nobg"><img src="https://img.shields.io/badge/GitHub-nobg-black?style=flat-square&logo=github"></a>
|
| 21 |
+
</p>
|
| 22 |
+
|
| 23 |
+
This repository hosts the weights of [**MultiMatte**](https://huggingface.co/feyninc/multimatte) (Apache-2.0) for seamless integration with [**ComfyUI-RMBG**](https://github.com/1038lab/ComfyUI-RMBG).
|
| 24 |
+
|
| 25 |
+
MultiMatte is a promptable alpha matting model built on [SAM 3](https://huggingface.co/facebook/sam3) that outputs continuous opacity mattes for hair, glass, and fine edges from optional text prompts.
|
| 26 |
+
|
| 27 |
+
## ComfyUI Usage
|
| 28 |
+
|
| 29 |
+
The `MultiMatte (RMBG)` node in [**ComfyUI-RMBG**](https://github.com/1038lab/ComfyUI-RMBG) automatically downloads these files into:
|
| 30 |
+
|
| 31 |
+
```text
|
| 32 |
+
ComfyUI/models/RMBG/MultiMatte/
|
| 33 |
+
βββ config.json
|
| 34 |
+
βββ model.safetensors
|
| 35 |
+
βββ processor_config.json
|
| 36 |
+
βββ tokenizer.json
|
| 37 |
+
βββ tokenizer_config.json
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
## License & Attribution
|
| 41 |
+
|
| 42 |
+
- **License**: Apache-2.0
|
| 43 |
+
- **Upstream Model**: [feyninc/multimatte](https://huggingface.co/feyninc/multimatte) (Hafedh Hichri & Feyn Research)
|
| 44 |
+
- **Base Model**: [facebook/sam3](https://huggingface.co/facebook/sam3)
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|