Instructions to use LongfeiHuang/SDMatte with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use LongfeiHuang/SDMatte with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("LongfeiHuang/SDMatte", torch_dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Add comprehensive model card for SDMatte
#1
by nielsr HF Staff - opened
This PR adds a comprehensive model card for the SDMatte model, significantly improving its documentation and discoverability on the Hugging Face Hub.
It includes the following key updates:
- Relevant Metadata: Adds
pipeline_tag: image-to-imageandlibrary_name: diffusersto the YAML metadata. This allows the model to be easily found by users filtering by pipeline type and indicates its compatibility with the popular π€ Diffusers library. - Paper Details: Integrates the paper title, a link to the Hugging Face paper page (SDMatte: Grafting Diffusion Models for Interactive Matting), and the full abstract, providing essential context about the model.
- Code Link: Adds a direct link to the official GitHub repository for SDMatte (
https://github.com/chen-sd/SDMatte), as mentioned in the paper's abstract. - Basic Usage Example: Provides a conceptual Python usage example with the
diffuserslibrary to guide users on how to load and potentially interact with the model, while directing them to the official repository for detailed instructions. - Cleanup: Removes the extraneous file information from the model card, ensuring only relevant content is displayed.
This PR will make the SDMatte model more accessible and user-friendly for researchers and practitioners on the Hub.
LongfeiHuang changed pull request status to merged