Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,68 @@
|
|
| 1 |
-
---
|
| 2 |
-
license:
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: creativeml-openrail-m
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
# InstructPix2Pix checkpoint fine-tuned on RealEdit (https://peter-sushko.github.io/RealEdit/).
|
| 6 |
+
|
| 7 |
+
## 1. Env Setup
|
| 8 |
+
|
| 9 |
+
To use the InstructPix2Pix checkpoint fine-tuned on MagicBrush, set up env with following command:
|
| 10 |
+
|
| 11 |
+
```shell
|
| 12 |
+
git clone https://github.com/timothybrooks/instruct-pix2pix.git
|
| 13 |
+
cd instruct-pix2pix
|
| 14 |
+
mkdir checkpoints
|
| 15 |
+
```
|
| 16 |
+
|
| 17 |
+
Download this checkpoint into `checkpoints` folder via
|
| 18 |
+
|
| 19 |
+
```shell
|
| 20 |
+
cd checkpoints
|
| 21 |
+
# wget https://huggingface.co/peter-sushko/RealEdit/resolve/main/realedit_model.ckpt
|
| 22 |
+
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
Then go back to the root folder and set up the running env following the [InstructPix2Pix](https://github.com/timothybrooks/instruct-pix2pix) guidelines.
|
| 26 |
+
|
| 27 |
+
## 2. Launch
|
| 28 |
+
|
| 29 |
+
### Edit a single image:
|
| 30 |
+
|
| 31 |
+
```python
|
| 32 |
+
python edit_cli.py --input [YOUR_IMG_PATH] --output imgs/output.jpg --edit "EDIT INSTRUCTION" --ckpt checkpoints/MagicBrush-epoch-52-step-4999.ckpt
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
### Run the interactive editing Gradio app:
|
| 36 |
+
|
| 37 |
+
```python
|
| 38 |
+
python edit_app.py --ckpt checkpoints/realedit_model.ckpt
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
## Citation
|
| 44 |
+
|
| 45 |
+
If you find this checkpoint useful, please consider citing our paper:
|
| 46 |
+
|
| 47 |
+
```
|
| 48 |
+
@misc{sushko2025realeditredditeditslargescale,
|
| 49 |
+
title={REALEDIT: Reddit Edits As a Large-scale Empirical Dataset for Image Transformations},
|
| 50 |
+
author={Peter Sushko and Ayana Bharadwaj and Zhi Yang Lim and Vasily Ilin and Ben Caffee and Dongping Chen and Mohammadreza Salehi and Cheng-Yu Hsieh and Ranjay Krishna},
|
| 51 |
+
year={2025},
|
| 52 |
+
eprint={2502.03629},
|
| 53 |
+
archivePrefix={arXiv},
|
| 54 |
+
primaryClass={cs.CV},
|
| 55 |
+
url={https://arxiv.org/abs/2502.03629},
|
| 56 |
+
}
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
And prior work:
|
| 60 |
+
|
| 61 |
+
```
|
| 62 |
+
@InProceedings{brooks2022instructpix2pix,
|
| 63 |
+
author = {Brooks, Tim and Holynski, Aleksander and Efros, Alexei A.},
|
| 64 |
+
title = {InstructPix2Pix: Learning to Follow Image Editing Instructions},
|
| 65 |
+
booktitle = {CVPR},
|
| 66 |
+
year = {2023},
|
| 67 |
+
}
|
| 68 |
+
```
|