wujunqiang commited on
Commit
d548620
·
verified ·
1 Parent(s): dead3e9

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +119 -3
README.md CHANGED
@@ -1,3 +1,119 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ tags:
6
+ - Kolors
7
+ - text-to-image
8
+ - stable-diffusion
9
+ library_name: diffusers
10
+ ---
11
+
12
+
13
+ Kolors-ControlNet-Canny weights and inference code
14
+
15
+
16
+ ## <a name="Introduction"></a>📖 Introduction
17
+
18
+ We provide two ControlNet weights and inference code based on Kolors-Basemodel: Canny and Depth. You can find some example images in the following.
19
+
20
+
21
+ **1、ControlNet Demos**
22
+
23
+ <img src="demo1.png">
24
+
25
+
26
+ **2、ControlNet and IP-Adapter-Plus Demos**
27
+
28
+ We also support joint inference code between Kolors-IPadapter and Kolors-ControlNet.
29
+
30
+ <img src="demo2.png">
31
+
32
+ ## <a name="Evaluation"></a>📊 Evaluation
33
+ To evaluate the performance of models, we compiled a test set of more than 200 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, conditional controllability, and overall satisfaction. Conditional controllability measures controlnet's ability to preserve spatial structure, while the other criteria follow the evaluation standards of BaseModel. The specific results are summarized in the table below, where Kolors-ControlNet achieved better performance in various criterias.
34
+
35
+ **1、Canny**
36
+
37
+ | Model | Average Overall Satisfaction | Average Visual Appeal | Average Text Faithfulness | Average Conditional Controllability |
38
+ | :--------------: | :--------: | :--------: | :--------: | :--------: |
39
+ | SDXL-ControlNet-Canny | 3.14 | 3.63 | 4.37 | 2.84 |
40
+ | **Kolors-ControlNet-Canny** | **4.06** | **4.64** | **4.45** | **3.52** |
41
+
42
+
43
+
44
+ **2、Depth**
45
+
46
+ | Model | Average Overall Satisfaction | Average Visual Appeal | Average Text Faithfulness | Average Conditional Controllability |
47
+ | :--------------: | :--------: | :--------: | :--------: | :--------: |
48
+ | SDXL-ControlNet-Canny | 3.35 | 3.77 | 4.26 | 4.5 |
49
+ | **Kolors-ControlNet-Depth** | **4.12** | **4.12** | **4.62** | **4.6** |
50
+
51
+ <img src="compare_demo.png">
52
+
53
+ <font color=gray style="font-size:12px">*The [SDXL-ControlNet-Canny](https://huggingface.co/diffusers/controlnet-canny-sdxl-1.0) and [SDXL-ControlNet-Depth](https://huggingface.co/diffusers/controlnet-depth-sdxl-1.0) load [DreamShaper-XL](https://civitai.com/models/112902?modelVersionId=351306) as backbone model.*</font>
54
+
55
+ ------
56
+
57
+ ## <a name="Usage"></a>🛠️ Usage
58
+
59
+ ### Requirements
60
+
61
+ The dependencies and installation are basically the same as the [Kolors-BaseModel](https://huggingface.co/Kwai-Kolors/Kolors).
62
+
63
+ <br>
64
+
65
+
66
+ 1. Weights download:
67
+ ```bash
68
+ # Canny - ControlNet
69
+ huggingface-cli download --resume-download Kwai-Kolors/Kolors-ControlNet-Canny --local-dir weights/Kolors-ControlNet-Canny
70
+
71
+ # Depth - ControlNet
72
+ huggingface-cli download --resume-download Kwai-Kolors/Kolors-ControlNet-Depth --local-dir weights/Kolors-ControlNet-Depth
73
+ ```
74
+
75
+ If you intend to utilize the depth estimation network, please ensure to download its corresponding model weights.
76
+ ```
77
+ huggingface-cli download lllyasviel/Annotators ./dpt_hybrid-midas-501f0c75.pt --local-dir ./controlnet/annotator/ckpts
78
+ ```
79
+
80
+
81
+ ### Inference:
82
+
83
+
84
+ **a. Using canny ControlNet:**
85
+
86
+ ```bash
87
+ python ./controlnet/sample_controlNet.py ./controlnet/assets/woman_1.png 一个漂亮的女孩,高品质,超清晰,色彩鲜艳,超高分辨率,最佳品质,8k,高清,4K Canny
88
+
89
+ python ./controlnet/sample_controlNet.py ./controlnet/assets/dog.png 全景,一只可爱的白色小狗坐在杯子里,看向镜头,动漫风格,3d渲染,辛烷值渲染 Canny
90
+
91
+ # The image will be saved to "controlnet/outputs/"
92
+ ```
93
+
94
+ **b. Using depth ControlNet:**
95
+
96
+ ```bash
97
+ python ./controlnet/sample_controlNet.py ./controlnet/assets/woman_2.png 新海诚风格,丰富的色彩,穿着绿色衬衫的女人站在田野里,唯美风景,清新明亮,斑驳的光影,最好的质量,超细节,8K画质 Depth
98
+
99
+ python ./controlnet/sample_controlNet.py ./controlnet/assets/bird.png 一只颜色鲜艳的小鸟,高品质,超清晰,色彩鲜艳,超高分辨率,最佳品质,8k,高清,4K Depth
100
+
101
+ # The image will be saved to "controlnet/outputs/"
102
+ ```
103
+
104
+
105
+ **c. Using depth ControlNet + IP-Adapter-Plus:**
106
+
107
+ If you intend to utilize the kolors-ip-adapter-plus, please ensure to download its corresponding model weights.
108
+
109
+ ```bash
110
+ python ./controlnet/sample_controlNet_ipadapter.py ./controlnet/assets/woman_2.png ./ipadapter/asset/2.png 一个红色头发的女孩,唯美风景,清新明亮,斑驳的光影,最好的质量,超细节,8K画质 Depth
111
+
112
+ # The image will be saved to "controlnet/outputs/"
113
+ ```
114
+
115
+ ### Acknowledgments
116
+ - Thanks to [ControlNet](https://github.com/lllyasviel/ControlNet) for providing the codebase.
117
+
118
+ <br>
119
+