drogozhang commited on
Commit
171e8c1
·
1 Parent(s): 8d938f6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +71 -0
README.md CHANGED
@@ -1,3 +1,74 @@
1
  ---
2
  license: creativeml-openrail-m
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: creativeml-openrail-m
3
  ---
4
+
5
+ # InstructPix2Pix checkpoint fine-tuned on [MagicBrush](https://osu-nlp-group.github.io/MagicBrush/).
6
+
7
+ ## Env Setup
8
+
9
+ To use this checkpoint on InstructPix2Pix model, set up env like this:
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 model into checkpoints via
18
+
19
+ ```shell
20
+ cd checkpoints
21
+ wget https://huggingface.co/osunlp/InstructPix2Pix-MagicBrush/resolve/main/MagicBrush-epoch-000168.ckpt
22
+ ```
23
+
24
+ Then go back to the root folder and set up the env following the instructpix2pix guidelines.
25
+
26
+ ## Launch
27
+
28
+ ### Edit a single image:
29
+
30
+ ```python
31
+ python edit_cli.py --input [YOUR_IMG_PATH] --output imgs/output.jpg --edit "EDIT INSTRUCTION" --ckpt checkpoints/MagicBrush-epoch-000168.ckpt
32
+
33
+ # Our model is fine-tuned for fine-grained real image editing. Therefore, it may not perform well on style transfer or other editings on large region.
34
+ # e.g. python edit_cli.py --input imgs/example.jpg --output imgs/output.jpg --edit "let him wear a black T-shirt" --ckpt checkpoints/MagicBrush-epoch-000168.ckpt
35
+ ```
36
+
37
+
38
+
39
+ ### Launch
40
+
41
+ ```python
42
+ python edit_app.py --ckpt checkpoints/MagicBrush-epoch-000168.ckpt
43
+ ```
44
+
45
+
46
+
47
+
48
+
49
+ ## Citation
50
+
51
+ If you find this checkpoint useful, please consider citing our paper:
52
+
53
+ ```
54
+ @misc{Zhang2023MagicBrush,
55
+ title={MagicBrush: A Manually Annotated Dataset for Instruction-Guided Image Editing},
56
+ author={Kai Zhang and Lingbo Mo and Wenhu Chen and Huan Sun and Yu Su},
57
+ year={2023},
58
+ eprint={2306.10012},
59
+ archivePrefix={arXiv},
60
+ primaryClass={cs.CV}
61
+ }
62
+ ```
63
+
64
+ And our prior work!
65
+
66
+ ```
67
+ @InProceedings{brooks2022instructpix2pix,
68
+ author = {Brooks, Tim and Holynski, Aleksander and Efros, Alexei A.},
69
+ title = {InstructPix2Pix: Learning to Follow Image Editing Instructions},
70
+ booktitle = {CVPR},
71
+ year = {2023},
72
+ }
73
+ ```
74
+