Instructions to use Yw22/BlobCtrl with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Yw22/BlobCtrl 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("Yw22/BlobCtrl", 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
File size: 1,991 Bytes
da3c002 4858101 da3c002 4858101 da3c002 d47c64e da3c002 4858101 da3c002 4858101 da3c002 4858101 da3c002 4858101 da3c002 4858101 da3c002 4858101 da3c002 4858101 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | ---
license: other
language:
- en
pipeline_tag: image-to-image
library_name: diffusers
base_model:
- stable-diffusion-v1-5/stable-diffusion-v1-5
---
# BlobCtrl
<a href='http://arxiv.org/abs/2503.13434'><img src="https://img.shields.io/static/v1?label=Arxiv Preprint&message=BlobCtrl&color=red&logo=arxiv"></a>
<a href='https://liyaowei-stu.github.io/project/BlobCtrl/'><img src='https://img.shields.io/badge/Project-Page-green'></a>
<a href='https://huggingface.co/spaces/Yw22/BlobCtrl'><img src='https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Demo-blue'></a>
<a href='https://github.com/TencentARC/BlobCtrl'><img src='https://img.shields.io/badge/Github-Repo-blue'></a>
### Overview
BlobCtrl enables precise, user-friendly element-level visual manipulation.
Main Features: 🦉Element-level Add/Remove/Move/Replace/Enlarge/Shrink.
[<img src="https://github.com/user-attachments/assets/59abefee-9bbd-41c8-a41d-ba18f6bbe2e8" width="600">](https://liyaowei-stu.github.io/project/BlobCtrl)
### Video
[Watch the introduction video](https://liyaowei-stu.github.io/project/BlobCtrl) in our project page or [YouTube](https://youtu.be/rdR4QRR-mbE).
### Code
Please check our [GitHub repository](https://github.com/TencentARC/BlobCtrl) for code.
### Model
Download the model checkpoint using `huggingface_hub` (Version 0.1 as example):
```python
import os
from huggingface_hub import snapshot_download
# download blobctrl models
BlobCtrl_path = "examples/blobctrl/models"
if not (os.path.exists(f"{BlobCtrl_path}/blobnet") and os.path.exists(f"{BlobCtrl_path}/unet_lora")):
BlobCtrl_path = snapshot_download(
repo_id="Yw22/BlobCtrl",
local_dir=BlobCtrl_path,
token=os.getenv("HF_TOKEN"),
)
print(f"BlobCtrl checkpoints downloaded to {BlobCtrl_path}") )
```
The downloaded BlobCtrl checkpoint file (blobnet&unet_lora) can be found at `BlobCtrl_path`.
### Demo
You can [try the demo here](https://huggingface.co/spaces/Yw22/BlobCtrl). |