Instructions to use TencentARC/BrushEdit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use TencentARC/BrushEdit 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("TencentARC/BrushEdit", 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
|
Download README.md from TencentARC/BrushEdit: direct link, hf CLI and curl.
- Browser
- Download file 1.81 kB
-
https://huggingface.co/TencentARC/BrushEdit/resolve/main/README.md
- Command line
-
hf download hf://TencentARC/BrushEdit/README.md
-
curl -L -o README.md https://huggingface.co/TencentARC/BrushEdit/resolve/main/README.md
1.81 kB
metadata
license: other
language:
- en
pipeline_tag: image-to-image
library_name: diffusers
BrushEdit
Overview
BrushEdit is an advanced, unified AI agent for image inpainting and editing.
Main Elements: 🛠️ Fully automated / 🤠 Interactive editing.
Video
Watch the introduction video in our project page or YouTube.
Code
Please check our GitHub repository for code.
Model
Download the model checkpoint using huggingface_hub (Version 0.1 as example):
import os
from huggingface_hub import snapshot_download
# download hf models
BrushEdit_path = "models/"
if not os.path.exists(BrushEdit_path):
BrushEdit_path = snapshot_download(
repo_id="TencentARC/BrushEdit",
local_dir=BrushEdit_path,
token=os.getenv("HF_TOKEN"),
)
The downloaded checkpoint file can be found at BrushEdit_path.
Demo
You can try the demo here.