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
|
@@ -14,7 +14,7 @@ Data: https://huggingface.co/datasets/peter-sushko/RealEdit
|
|
| 14 |
|
| 15 |
**There are 2 ways to run inference: either via Diffusers or original InstructPix2Pix pipeline.**
|
| 16 |
|
| 17 |
-
|
| 18 |
|
| 19 |
Install diffusers, transformers library:
|
| 20 |
|
|
@@ -56,7 +56,7 @@ images[0]
|
|
| 56 |
```
|
| 57 |
|
| 58 |
|
| 59 |
-
|
| 60 |
|
| 61 |
Clone the repository and set up the directory structure:
|
| 62 |
|
|
@@ -75,7 +75,7 @@ cd checkpoints
|
|
| 75 |
|
| 76 |
Return to the repo root and follow the [InstructPix2Pix installation guide](https://github.com/timothybrooks/instruct-pix2pix) to set up the environment.
|
| 77 |
|
| 78 |
-
|
| 79 |
|
| 80 |
```bash
|
| 81 |
python edit_cli.py \
|
|
@@ -85,7 +85,7 @@ python edit_cli.py \
|
|
| 85 |
--ckpt checkpoints/realedit_model.ckpt
|
| 86 |
```
|
| 87 |
|
| 88 |
-
|
| 89 |
|
| 90 |
```bash
|
| 91 |
python edit_app.py --ckpt checkpoints/realedit_model.ckpt
|
|
|
|
| 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 |
|
|
|
|
| 56 |
```
|
| 57 |
|
| 58 |
|
| 59 |
+
## Option 2: via InstructPix2Pix pipeline:
|
| 60 |
|
| 61 |
Clone the repository and set up the directory structure:
|
| 62 |
|
|
|
|
| 75 |
|
| 76 |
Return to the repo root and follow the [InstructPix2Pix installation guide](https://github.com/timothybrooks/instruct-pix2pix) to set up the environment.
|
| 77 |
|
| 78 |
+
Edit a single image
|
| 79 |
|
| 80 |
```bash
|
| 81 |
python edit_cli.py \
|
|
|
|
| 85 |
--ckpt checkpoints/realedit_model.ckpt
|
| 86 |
```
|
| 87 |
|
| 88 |
+
Launch the Gradio interface
|
| 89 |
|
| 90 |
```bash
|
| 91 |
python edit_app.py --ckpt checkpoints/realedit_model.ckpt
|