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
|
Download README.md from 1038lab/MultiMatte: direct link, hf CLI and curl.
- Browser
- Download file 1.72 kB
-
https://huggingface.co/1038lab/MultiMatte/resolve/main/README.md
- Command line
-
hf download hf://1038lab/MultiMatte/README.md
-
curl -L -o README.md https://huggingface.co/1038lab/MultiMatte/resolve/main/README.md
1.72 kB
| library_name: nobg | |
| license: apache-2.0 | |
| tags: | |
| - model_hub_mixin | |
| - nobg | |
| - nobg-sam3 | |
| - promptable | |
| - background-removal | |
| - alpha-matting | |
| <h1 align="center">MultiMatte</h1> | |
| <p align="center"><b>Promptable SAM 3 Alpha Matting β Packaged for ComfyUI-RMBG.</b></p> | |
| <p align="center"> | |
| <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> | |
| <a href="https://huggingface.co/feyninc/multimatte"><img src="https://img.shields.io/badge/Upstream-feyninc%2Fmultimatte-yellow?style=flat-square"></a> | |
| <a href="https://github.com/feyninc/nobg"><img src="https://img.shields.io/badge/GitHub-nobg-black?style=flat-square&logo=github"></a> | |
| </p> | |
| 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). | |
| 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. | |
| ## ComfyUI Usage | |
| The `MultiMatte (RMBG)` node in [**ComfyUI-RMBG**](https://github.com/1038lab/ComfyUI-RMBG) automatically downloads these files into: | |
| ```text | |
| ComfyUI/models/RMBG/MultiMatte/ | |
| βββ config.json | |
| βββ model.safetensors | |
| βββ processor_config.json | |
| βββ tokenizer.json | |
| βββ tokenizer_config.json | |
| ``` | |
| ## License & Attribution | |
| - **License**: Apache-2.0 | |
| - **Upstream Model**: [feyninc/multimatte](https://huggingface.co/feyninc/multimatte) (Hafedh Hichri & Feyn Research) | |
| - **Base Model**: [facebook/sam3](https://huggingface.co/facebook/sam3) | |