Instructions to use peter-sushko/RealEdit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use peter-sushko/RealEdit 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("peter-sushko/RealEdit", 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
Update README.md
Browse files
README.md
CHANGED
|
@@ -8,13 +8,13 @@ tags:
|
|
| 8 |
Project page: https://peter-sushko.github.io/RealEdit/
|
| 9 |
Data: https://huggingface.co/datasets/peter-sushko/RealEdit
|
| 10 |
|
| 11 |
-
<img src="https://peter-sushko.github.io/RealEdit/static/images/teaser.svg"/>
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
-
|
| 16 |
|
| 17 |
-
Option 1:
|
| 18 |
|
| 19 |
Install diffusers, transformers library:
|
| 20 |
|
|
@@ -53,10 +53,10 @@ image = download_image(url)
|
|
| 53 |
prompt = "turn him into cyborg"
|
| 54 |
images = pipe(prompt, image=image, num_inference_steps=10, image_guidance_scale=1).images
|
| 55 |
images[0]
|
| 56 |
-
```
|
| 57 |
|
| 58 |
|
| 59 |
-
Option 2: via InstructPix2Pix pipeline:
|
| 60 |
|
| 61 |
Clone the repository and set up the directory structure:
|
| 62 |
|
|
|
|
| 8 |
Project page: https://peter-sushko.github.io/RealEdit/
|
| 9 |
Data: https://huggingface.co/datasets/peter-sushko/RealEdit
|
| 10 |
|
| 11 |
+
<img src="https://peter-sushko.github.io/RealEdit/static/images/teaser.svg"/>
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
+
**There are 2 ways to run inference: either via Diffusers or original InstructPix2Pix pipeline.**
|
| 16 |
|
| 17 |
+
**Option 1: With 🧨Diffusers:**
|
| 18 |
|
| 19 |
Install diffusers, transformers library:
|
| 20 |
|
|
|
|
| 53 |
prompt = "turn him into cyborg"
|
| 54 |
images = pipe(prompt, image=image, num_inference_steps=10, image_guidance_scale=1).images
|
| 55 |
images[0]
|
| 56 |
+
```
|
| 57 |
|
| 58 |
|
| 59 |
+
**Option 2: via InstructPix2Pix pipeline:**
|
| 60 |
|
| 61 |
Clone the repository and set up the directory structure:
|
| 62 |
|