wujunqiang commited on
Commit
7aee809
1 Parent(s): cf9e098

Update readme.md

Browse files
Files changed (1) hide show
  1. README.md +176 -3
README.md CHANGED
@@ -1,3 +1,176 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ ## <a name="Introduction"></a>📖 Introduction
4
+
5
+ We provide IP-Adapter-Plus weights and inference code based on [Kolors-Basemodel](https://huggingface.co/Kwai-Kolors/Kolors). Examples of Kolors-IP-Adapter-Plus results are as follows:
6
+
7
+
8
+
9
+ <table >
10
+ <tr>
11
+ <td colspan="3" align="center">Example Result</td>
12
+ </tr>
13
+
14
+ <tr>
15
+ <td align="center">Reference Image </td>
16
+ <td align="center">Prompt </td>
17
+ <td align="center">Result Image </td>
18
+ </tr>
19
+
20
+ <tr>
21
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/test_ip.jpg" width=400px/></td>
22
+ <td align="center"><font style="font-size:12px">穿着黑色T恤衫,上面中文绿色大字写着“可图”。</p> Wearing a black T-shirt with the Chinese characters "Ketu" written in large green letters on it. </font> </td>
23
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/scripts/outputs/sample_ip_test_ip.jpg" width=400px/></td>
24
+ </tr>
25
+
26
+ <tr>
27
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/test_ip2.png" width=400px/></td>
28
+ <td align="center"><font style="font-size:12px">一只可爱的小狗在奔跑。</p>A cute dog is running. </font> </td>
29
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/scripts/outputs/sample_ip_test_ip2.jpg" width=400px/></td>
30
+ </tr>
31
+
32
+
33
+ </table>
34
+
35
+
36
+
37
+ <br>
38
+
39
+ **Our improvements**
40
+
41
+ - A stronger image feature extractor. We employ the Openai-CLIP-336 model as the image encoder, which allows us to preserve more details in the reference images
42
+ - More diverse and high-quality training data: We construct a large-scale and high-quality training dataset inspired by the data strategies of other works. We believe that paired training data can effectively improve performance.
43
+
44
+
45
+ <br>
46
+
47
+
48
+ ## <a name="Evaluation"></a>📊 Evaluation
49
+ For evaluation, we create a test set consisting of over 200 reference images and text prompts. We invite several image experts to provide fair ratings for the generated results of different models. The experts rate the generated images based on four criteria: visual appeal, text faithfulness, image faithfulness, and overall satisfaction. Image faithfulness measures the semantic preservation ability of IP-Adapter on reference images, while the other criteria follow the evaluation standards of BaseModel. The specific results are summarized in the table below, where Kolors-IP-Adapter-Plus achieves the highest overall satisfaction score.
50
+
51
+ | Model | Average Overall Satisfaction | Average Image Faithfulness | Average Visual Appeal | Average Text Faithfulness |
52
+ | :--------------: | :--------: | :--------: | :--------: | :--------: |
53
+ | SDXL-IP-Adapter-Plus | 2.29 | 2.64 | 3.22 | 4.02 |
54
+ | Midjourney-v6-CW | 2.79 | 3.0 | 3.92 | 4.35 |
55
+ | **Kolors-IP-Adapter-Plus** | **3.04** | **3.25** | **4.45** | **4.30** |
56
+
57
+ <font color=gray style="font-size:12px">*The ip_scale parameter is set to 0.3 in SDXL-IP-Adapter-Plus, while Midjourney-v6-CW utilizes the default cw scale.*</font>
58
+
59
+ ------
60
+
61
+ <br>
62
+
63
+
64
+ <table>
65
+ <tr>
66
+ <td colspan="5" align="center">Compare Result</td>
67
+ </tr>
68
+
69
+ <tr>
70
+ <td align="center">Reference Image </td>
71
+ <td align="center">Prompt </td>
72
+ <td align="center">Kolors-IP-Adapter-Plus Result </td>
73
+ <td align="center">SDXL-IP-Adapter-Plus Result </td>
74
+ <td align="center">Midjourney-v6-CW Result </td>
75
+ </tr>
76
+
77
+ <tr>
78
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/1.png" width=400px/></td>
79
+ <td align="center"><font style="font-size:10px">一个看向远山的少女形象,雪山背景,采用日本浮世绘风格,混合蓝色和红色柔和调色板,高分辨率 </p>Image of a girl looking towards distant mountains, snowy mountains background, in Japanese ukiyo-e style, mixed blue and red pastel color palette, high resolution.</font> </td>
80
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/1_kolors_ip_result.jpg" width=400px/> </td>
81
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/1_sdxl_ip_result.jpg" width=400px/> </td>
82
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/1_mj_cw_result.png" width=400px/> </td>
83
+ </tr>
84
+
85
+ <tr>
86
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/2.png" width=400px/></td>
87
+ <td align="center"><font style="font-size:10px">一个漂亮的美女,看向远方</p>A beautiful lady looking into the distance. </font></td>
88
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/2_kolors_ip_result.jpg" width=400px/> </td>
89
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/2_sdxl_ip_result.jpg" width=400px/> </td>
90
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/2_mj_cw_result.png" width=400px/> </td>
91
+ </tr>
92
+
93
+ <tr>
94
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/5.png" width=400px/></td>
95
+ <td align="center"><font style="font-size:10px">可爱的猫咪,在花丛中,看镜头</p>Cute cat among flowers, looking at the camera. </font></td>
96
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/5_kolors_ip_result.jpg" width=400px/> </td>
97
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/5_sdxl_ip_result.jpg" width=400px/> </td>
98
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/5_mj_cw_result.png" width=400px/> </td>
99
+ </tr>
100
+
101
+ <tr>
102
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/4.png" width=400px/></td>
103
+ <td align="center"><font style="font-size:10px">站在丛林前,戴着太阳帽,高画质,高细节,高清,疯狂的细节,超高清 </p>Standing in front of the jungle, wearing a sun hat, high quality, high detail, high definition, crazy details, ultra high definition.</font></td>
104
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/4_kolors_ip_result.jpg" width=400px/> </td>
105
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/4_sdxl_ip_result.jpg" width=400px/> </td>
106
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/4_mj_cw_result.png" width=400px/> </td>
107
+ </tr>
108
+
109
+
110
+ <tr>
111
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/3.png" width=400px/></td>
112
+ <td align="center"><font style="font-size:10px">做个头像,新海诚动漫风格,丰富的色彩,唯美风景,清新明亮,斑驳的光影,最好的质量,超细节,8K画质 </p>Create an avatar, Shinkai Makoto anime style, rich colors, beautiful scenery, fresh and bright, mottled light and shadow, best quality, ultra-detailed, 8K quality.</font></td>
113
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/3_kolors_ip_result.jpg" width=400px/> </td>
114
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/3_sdxl_ip_result.jpg" width=400px/> </td>
115
+ <td align="center"><img src="https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/3_mj_cw_result.png" width=400px/> </td>
116
+ </tr>
117
+
118
+ </tr>
119
+
120
+ </table>
121
+
122
+ <font color=gray style="font-size:12px"> *Kolors-IP-Adapter-Plus employs chinese prompts, while other methods use english prompts.*</font>
123
+
124
+
125
+
126
+ ## <a name="Usage"></a>🛠️ Usage
127
+
128
+ ### Requirements
129
+
130
+ The dependencies and installation are basically the same as the [Kolors-BaseModel](https://huggingface.co/Kwai-Kolors/Kolors).
131
+
132
+ <br>
133
+
134
+ 1. Repository Cloning and Dependency Installation
135
+
136
+ ```bash
137
+ apt-get install git-lfs
138
+ git clone https://github.com/Kwai-Kolors/Kolors
139
+ cd Kolors
140
+ conda create --name kolors python=3.8
141
+ conda activate kolors
142
+ pip install -r requirements.txt
143
+ python3 setup.py install
144
+ ```
145
+
146
+ 2. Weights download [link](https://huggingface.co/Kwai-Kolors/Kolors-IP-Adapter-Plus):
147
+ ```bash
148
+ huggingface-cli download --resume-download Kwai-Kolors/Kolors-IP-Adapter-Plus --local-dir weights/Kolors-IP-Adapter-Plus
149
+ ```
150
+ or
151
+ ```bash
152
+ git lfs clone https://huggingface.co/Kwai-Kolors/Kolors-IP-Adapter-Plus weights/Kolors-IP-Adapter-Plus
153
+ ```
154
+
155
+ 3. Inference:
156
+ ```bash
157
+ python ipadapter/sample_ipadapter_plus.py ./ipadapter/https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/test_ip.jpg "穿着黑色T恤衫,上面中文绿色大字写着“可图”"
158
+
159
+ python ipadapter/sample_ipadapter_plus.py ./ipadapter/https://raw.githubusercontent.com/junqiangwu/Kolors/master/ipadapter/assert/test_ip2.png "一只可爱的小狗在奔跑"
160
+
161
+ # The image will be saved to "scripts/outputs/"
162
+ ```
163
+
164
+ <br>
165
+
166
+
167
+ **Note**
168
+
169
+ The IP-Adapter-FaceID model based on Kolors will also be released soon!
170
+
171
+ <br>
172
+
173
+ ### Acknowledgments
174
+ - Thanks to [IP-Adapter](https://github.com/tencent-ailab/IP-Adapter) for providing the codebase.
175
+ <br>
176
+