BrushEdit
Collection
Inpainting-based image insturction editing β’ 3 items β’ Updated β’ 1
Run TencentARC/BrushEdit on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Use HF Jobs to fine-tune https://huggingface.co/TencentARC/BrushEdit. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to run batch inference with https://huggingface.co/TencentARC/BrushEdit on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
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]BrushEdit is an advanced, unified AI agent for image inpainting and editing.
Main Elements: π οΈ Fully automated / π€ Interactive editing.
Watch the introduction video in our project page or YouTube.
Please check our GitHub repository for code.
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.
You can try the demo here.