HunyuanDiT
Diffusers
Safetensors
English
Chinese
Tencent-Hunyuan commited on
Commit
0d19b55
β€’
1 Parent(s): d2d70e2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +29 -37
README.md CHANGED
@@ -1,11 +1,3 @@
1
- <!-- ## **HunyuanDiT** -->
2
-
3
- <p align="center">
4
- <img src="./asset/logo.png" height=100>
5
- </p>
6
-
7
- # Hunyuan-DiT : A Powerful Multi-Resolution Diffusion Transformer with Fine-Grained Chinese Understanding
8
-
9
  -----
10
 
11
  This repo contains PyTorch model definitions, pre-trained weights and inference/sampling code for our paper exploring Hunyuan-DiT. You can find more visualizations on our [project page](https://dit.hunyuan.tencent.com/).
@@ -14,7 +6,7 @@ This repo contains PyTorch model definitions, pre-trained weights and inference/
14
  > Zhimin Li*, Jianwei Zhang*, Qin Lin, Jiangfeng Xiong, Yanxin Long, Xinchi Deng, Yingfang Zhang, Xingchao Liu, Minbin Huang, Zedong Xiao, Dayou Chen, Jiajun He, Jiahao Li, Wenyue Li, Chen Zhang, Rongwei Quan, Jianxiang Lu, Jiabin Huang, Xiaoyan Yuan, Xiaoxiao Zheng, Yixuan Li, Jihong Zhang, Chao Zhang, Meng Chen, Jie Liu, Zheng Fang, Weiyan Wang, Jinbao Xue, Yangyu Tao, JianChen Zhu, Kai Liu, Sihuan Lin, Yifu Sun, Yun Li, Dongdong Wang, Zhichao Hu, Xiao Xiao, Yan Chen, Yuhong Liu, Wei Liu, Di Wang, Yong Yang, Jie Jiang, Qinglin Lu‑
15
  > <br>Tencent Hunyuan<br>
16
 
17
- > [**DialogGen:Multi-modal Interactive Dialogue System for Multi-turn Text-to-Image Generation**](https://hunyuan-dialoggen.github.io/)<br>
18
  > Minbin Huang*, Yanxin Long*, Xinchi Deng, Ruihang Chu, Jiangfeng Xiong, Xiaodan Liang, Hong Cheng, Qinglin Lu&#8224;, Wei Liu
19
  > <br>Chinese University of Hong Kong, Tencent Hunyuan, Shenzhen Campus of Sun Yat-sen University<br>
20
 
@@ -23,32 +15,32 @@ This repo contains PyTorch model definitions, pre-trained weights and inference/
23
  ## πŸ“‘ Open-source Plan
24
 
25
  - Hunyuan-DiT (Text-to-Image Model)
26
- - [x] Inference βœ…
27
- - [x] Checkpoints βœ…
28
  - [ ] Distillation Version (Coming soon ⏩️)
29
  - [ ] TensorRT Version (Coming soon ⏩️)
30
  - [ ] Training (Coming later ⏩️)
31
  - DialogGen (Prompt Enhancement Model)
32
- - [x] Inference βœ…
33
- - [X] Web Demo (Gradio) βœ…
34
- - [X] Cli Demo βœ…
35
 
36
  ## Contents
37
- - [Hunyuan-DiT](#hunyuan-dit-a-powerful-multi-resolution-diffusion-transformer-with-fine-grained-chinese-understanding)
38
  - [Abstract](#abstract)
39
- - [πŸŽ‰ Hunyuan-DiT Key Features](#hunyuan-dit-key-features)
40
  - [Chinese-English Bilingual DiT Architecture](#chinese-english-bilingual-dit-architecture)
41
  - [Multi-turn Text2Image Generation](#multi-turn-text2image-generation)
42
  - [πŸ“ˆ Comparisons](#comparisons)
43
  - [πŸŽ₯ Visualization](#visualization)
44
  - [πŸ“œ Requirements](#requirements)
45
- - [πŸ›  Dependencies and Installation](#dependencies-and-installation)
46
  - [🧱 Download Pretrained Models](#download-pretrained-models)
47
- - [πŸ”‘ Inference](#inference)
48
  - [Using Gradio](#using-gradio)
49
  - [Using Command Line](#using-command-line)
50
  - [More Configurations](#more-configurations)
51
- - [πŸ”— BibTeX](#bibtex)
52
 
53
  ## **Abstract**
54
 
@@ -60,7 +52,7 @@ Through our carefully designed holistic human evaluation protocol with more than
60
  ### **Chinese-English Bilingual DiT Architecture**
61
  Hunyuan-DiT is a diffusion model in the latent space, as depicted in figure below. Following the Latent Diffusion Model, we use a pre-trained Variational Autoencoder (VAE) to compress the images into low-dimensional latent spaces and train a diffusion model to learn the data distribution with diffusion models. Our diffusion model is parameterized with a transformer. To encode the text prompts, we leverage a combination of pre-trained bilingual (English and Chinese) CLIP and multilingual T5 encoder.
62
  <p align="center">
63
- <img src="./asset/framework.png" height=500>
64
  </p>
65
 
66
  ### Multi-turn Text2Image Generation
@@ -70,7 +62,7 @@ step by step. In this section, we will detail how we empower Hunyuan-DiT with th
70
  conversations and image generation. We train MLLM to understand the multi-round user dialogue
71
  and output the new text prompt for image generation.
72
  <p align="center">
73
- <img src="./asset/mllm.png" height=300>
74
  </p>
75
 
76
  ## Comparisons
@@ -85,52 +77,53 @@ In order to comprehensively compare the generation capabilities of HunyuanDiT an
85
  </thead>
86
  <tbody>
87
  <tr>
88
- <td>SDXL</td> <td>&#10004</td> <td>64.3</td> <td>60.6</td> <td>91.1</td> <td>76.3</td> <td>42.7</td>
89
  </tr>
90
  <tr>
91
- <td>PixArt-Ξ±</td> <td>&#10004</td> <td>68.3</td> <td>60.9</td> <td>93.2</td> <td>77.5</td> <td>45.5</td>
92
  </tr>
93
  <tr>
94
- <td>Playground 2.5</td> <td>&#10004</td> <td>71.9</td> <td>70.8</td> <td>94.9</td> <td>83.3</td> <td>54.3</td>
95
  </tr>
96
 
97
  <tr>
98
  <td>SD 3</td> <td>&#10008</td> <td>77.1</td> <td>69.3</td> <td>94.6</td> <td>82.5</td> <td>56.7</td>
99
 
100
  </tr>
101
- <tr style="font-weight: bold; background-color: #f2f2f2;">
102
- <td>Hunyuan-DiT</td><td>&#10004</td> <td>74.2</td> <td>74.3</td> <td>95.4</td> <td>86.6</td> <td>59.0</td>
103
- </tr>
104
  <tr>
105
  <td>MidJourney v6</td><td>&#10008</td> <td>73.5</td> <td>80.2</td> <td>93.5</td> <td>87.2</td> <td>63.3</td>
106
  </tr>
107
  <tr>
108
  <td>DALL-E 3</td><td>&#10008</td> <td>83.9</td> <td>80.3</td> <td>96.5</td> <td>89.4</td> <td>71.0</td>
109
  </tr>
 
 
 
110
  </table>
111
  </p>
112
 
113
- ## πŸŽ₯Visualization
114
 
115
  * **Chinese Elements**
116
  <p align="center">
117
- <img src="./asset/chinese elements understanding.png" height=220>
118
  </p>
119
 
120
  * **Long Text Input**
121
 
122
 
123
  <p align="center">
124
- <img src="./asset/long text understanding.png" height=310>
125
  </p>
126
 
127
  * **Multi-turn Text2Image Generation**
128
 
 
129
  [demo video](https://youtu.be/4AaHrYnuIcE)
130
 
131
  ---
132
 
133
- ## πŸ“œRequirements
134
 
135
  This repo consists of DialogGen (a prompt enhancement model) and Hunyuan-DiT (a text-to-image model).
136
 
@@ -150,7 +143,7 @@ The following table shows the requirements for running the models (The TensorRT
150
  * **Recommended**: We recommend using a GPU with 32GB of memory for better generation quality.
151
  * Tested operating system: Linux
152
 
153
- ## πŸ› οΈDependencies and Installation
154
 
155
  Begin by cloning the repository:
156
  ```bash
@@ -175,7 +168,7 @@ python -m pip install -r requirements.txt
175
  python -m pip install git+https://github.com/Dao-AILab/[email protected]
176
  ```
177
 
178
- ## 🧱Download Pretrained Models
179
  To download the model, first install the huggingface-cli. (Detailed instructions are available [here](https://huggingface.co/docs/huggingface_hub/guides/cli).)
180
 
181
  ```bash
@@ -193,9 +186,6 @@ huggingface-cli download Tencent-Hunyuan/HunyuanDiT --local-dir ./ckpts
193
  ```
194
  Note:If an `No such file or directory: 'ckpts/.huggingface/.gitignore.lock'` like error occurs during the download process, you can ignore the error and retry the command by executing `huggingface-cli download Tencent-Hunyuan/HunyuanDiT --local-dir ./ckpts`
195
 
196
- For more information about the model, visit the Hugging Face repository [here](https://huggingface.co/Tencent-Hunyuan/HunyuanDiT).
197
-
198
-
199
  All models will be automatically downloaded. For more information about the model, visit the Hugging Face repository [here](https://huggingface.co/Tencent-Hunyuan/HunyuanDiT).
200
 
201
  | Model | #Params | Download URL |
@@ -246,6 +236,8 @@ python sample_t2i.py --infer-mode fa --prompt "ζΈ”θˆŸε”±ζ™š"
246
  python sample_t2i.py --prompt "ζΈ”θˆŸε”±ζ™š" --image-size 1280 768
247
  ```
248
 
 
 
249
  ### More Configurations
250
 
251
  We list some more useful configurations for easy usage:
@@ -273,4 +265,4 @@ If you find Hunyuan-DiT useful for your research and applications, please cite u
273
  author={Zhimin Li, Jianwei Zhang, Qin Lin, Jiangfeng Xiong, Yanxin Long, Xinchi Deng, Yingfang Zhang, Xingchao Liu, Minbin Huang, Zedong Xiao, Dayou Chen, Jiajun He, Jiahao Li, Wenyue Li, Chen Zhang, Rongwei Quan, Jianxiang Lu, Jiabin Huang, Xiaoyan Yuan, Xiaoxiao Zheng, Yixuan Li, Jihong Zhang, Chao Zhang, Meng Chen, Jie Liu, Zheng Fang, Weiyan Wang, Jinbao Xue, Yangyu Tao, JianChen Zhu, Kai Liu, Sihuan Lin, Yifu Sun, Yun Li, Dongdong Wang, Zhichao Hu, Xiao Xiao, Yan Chen, Yuhong Liu, Wei Liu, Di Wang, Yong Yang, Jie Jiang, Qinglin Lu},
274
  year={2024},
275
  }
276
- ```
 
 
 
 
 
 
 
 
 
1
  -----
2
 
3
  This repo contains PyTorch model definitions, pre-trained weights and inference/sampling code for our paper exploring Hunyuan-DiT. You can find more visualizations on our [project page](https://dit.hunyuan.tencent.com/).
 
6
  > Zhimin Li*, Jianwei Zhang*, Qin Lin, Jiangfeng Xiong, Yanxin Long, Xinchi Deng, Yingfang Zhang, Xingchao Liu, Minbin Huang, Zedong Xiao, Dayou Chen, Jiajun He, Jiahao Li, Wenyue Li, Chen Zhang, Rongwei Quan, Jianxiang Lu, Jiabin Huang, Xiaoyan Yuan, Xiaoxiao Zheng, Yixuan Li, Jihong Zhang, Chao Zhang, Meng Chen, Jie Liu, Zheng Fang, Weiyan Wang, Jinbao Xue, Yangyu Tao, JianChen Zhu, Kai Liu, Sihuan Lin, Yifu Sun, Yun Li, Dongdong Wang, Zhichao Hu, Xiao Xiao, Yan Chen, Yuhong Liu, Wei Liu, Di Wang, Yong Yang, Jie Jiang, Qinglin Lu‑
7
  > <br>Tencent Hunyuan<br>
8
 
9
+ > [**DialogGen:Multi-modal Interactive Dialogue System for Multi-turn Text-to-Image Generation**](https://arxiv.org/abs/2403.08857)<br>
10
  > Minbin Huang*, Yanxin Long*, Xinchi Deng, Ruihang Chu, Jiangfeng Xiong, Xiaodan Liang, Hong Cheng, Qinglin Lu&#8224;, Wei Liu
11
  > <br>Chinese University of Hong Kong, Tencent Hunyuan, Shenzhen Campus of Sun Yat-sen University<br>
12
 
 
15
  ## πŸ“‘ Open-source Plan
16
 
17
  - Hunyuan-DiT (Text-to-Image Model)
18
+ - [x] Inference
19
+ - [x] Checkpoints
20
  - [ ] Distillation Version (Coming soon ⏩️)
21
  - [ ] TensorRT Version (Coming soon ⏩️)
22
  - [ ] Training (Coming later ⏩️)
23
  - DialogGen (Prompt Enhancement Model)
24
+ - [x] Inference
25
+ - [X] Web Demo (Gradio)
26
+ - [X] Cli Demo
27
 
28
  ## Contents
29
+ - [Hunyuan-DiT](#hunyuan-dit--a-powerful-multi-resolution-diffusion-transformer-with-fine-grained-chinese-understanding)
30
  - [Abstract](#abstract)
31
+ - [πŸŽ‰ Hunyuan-DiT Key Features](#-hunyuan-dit-key-features)
32
  - [Chinese-English Bilingual DiT Architecture](#chinese-english-bilingual-dit-architecture)
33
  - [Multi-turn Text2Image Generation](#multi-turn-text2image-generation)
34
  - [πŸ“ˆ Comparisons](#comparisons)
35
  - [πŸŽ₯ Visualization](#visualization)
36
  - [πŸ“œ Requirements](#requirements)
37
+ - [πŸ›  Dependencies and Installation](#%EF%B8%8Fdependencies-and-installation)
38
  - [🧱 Download Pretrained Models](#download-pretrained-models)
39
+ - [πŸ”‘ Inference](#-inference)
40
  - [Using Gradio](#using-gradio)
41
  - [Using Command Line](#using-command-line)
42
  - [More Configurations](#more-configurations)
43
+ - [πŸ”— BibTeX](#-bibtex)
44
 
45
  ## **Abstract**
46
 
 
52
  ### **Chinese-English Bilingual DiT Architecture**
53
  Hunyuan-DiT is a diffusion model in the latent space, as depicted in figure below. Following the Latent Diffusion Model, we use a pre-trained Variational Autoencoder (VAE) to compress the images into low-dimensional latent spaces and train a diffusion model to learn the data distribution with diffusion models. Our diffusion model is parameterized with a transformer. To encode the text prompts, we leverage a combination of pre-trained bilingual (English and Chinese) CLIP and multilingual T5 encoder.
54
  <p align="center">
55
+ <img src="https://raw.githubusercontent.com/Tencent/HunyuanDiT/main/asset/framework.png" height=450>
56
  </p>
57
 
58
  ### Multi-turn Text2Image Generation
 
62
  conversations and image generation. We train MLLM to understand the multi-round user dialogue
63
  and output the new text prompt for image generation.
64
  <p align="center">
65
+ <img src="https://raw.githubusercontent.com/Tencent/HunyuanDiT/main/asset/mllm.png" height=300>
66
  </p>
67
 
68
  ## Comparisons
 
77
  </thead>
78
  <tbody>
79
  <tr>
80
+ <td>SDXL</td> <td> βœ” </td> <td>64.3</td> <td>60.6</td> <td>91.1</td> <td>76.3</td> <td>42.7</td>
81
  </tr>
82
  <tr>
83
+ <td>PixArt-Ξ±</td> <td> βœ”</td> <td>68.3</td> <td>60.9</td> <td>93.2</td> <td>77.5</td> <td>45.5</td>
84
  </tr>
85
  <tr>
86
+ <td>Playground 2.5</td> <td>βœ”</td> <td>71.9</td> <td>70.8</td> <td>94.9</td> <td>83.3</td> <td>54.3</td>
87
  </tr>
88
 
89
  <tr>
90
  <td>SD 3</td> <td>&#10008</td> <td>77.1</td> <td>69.3</td> <td>94.6</td> <td>82.5</td> <td>56.7</td>
91
 
92
  </tr>
 
 
 
93
  <tr>
94
  <td>MidJourney v6</td><td>&#10008</td> <td>73.5</td> <td>80.2</td> <td>93.5</td> <td>87.2</td> <td>63.3</td>
95
  </tr>
96
  <tr>
97
  <td>DALL-E 3</td><td>&#10008</td> <td>83.9</td> <td>80.3</td> <td>96.5</td> <td>89.4</td> <td>71.0</td>
98
  </tr>
99
+ <tr style="font-weight: bold; background-color: #f2f2f2;">
100
+ <td>Hunyuan-DiT</td><td>βœ”</td> <td>74.2</td> <td>74.3</td> <td>95.4</td> <td>86.6</td> <td>59.0</td>
101
+ </tr>
102
  </table>
103
  </p>
104
 
105
+ ## πŸŽ₯ Visualization
106
 
107
  * **Chinese Elements**
108
  <p align="center">
109
+ <img src="https://raw.githubusercontent.com/Tencent/HunyuanDiT/main/asset/chinese elements understanding.png" height=220>
110
  </p>
111
 
112
  * **Long Text Input**
113
 
114
 
115
  <p align="center">
116
+ <img src="https://raw.githubusercontent.com/Tencent/HunyuanDiT/main/asset/long text understanding.png" height=310>
117
  </p>
118
 
119
  * **Multi-turn Text2Image Generation**
120
 
121
+
122
  [demo video](https://youtu.be/4AaHrYnuIcE)
123
 
124
  ---
125
 
126
+ ## πŸ“œ Requirements
127
 
128
  This repo consists of DialogGen (a prompt enhancement model) and Hunyuan-DiT (a text-to-image model).
129
 
 
143
  * **Recommended**: We recommend using a GPU with 32GB of memory for better generation quality.
144
  * Tested operating system: Linux
145
 
146
+ ## πŸ› οΈ Dependencies and Installation
147
 
148
  Begin by cloning the repository:
149
  ```bash
 
168
  python -m pip install git+https://github.com/Dao-AILab/[email protected]
169
  ```
170
 
171
+ ## 🧱 Download Pretrained Models
172
  To download the model, first install the huggingface-cli. (Detailed instructions are available [here](https://huggingface.co/docs/huggingface_hub/guides/cli).)
173
 
174
  ```bash
 
186
  ```
187
  Note:If an `No such file or directory: 'ckpts/.huggingface/.gitignore.lock'` like error occurs during the download process, you can ignore the error and retry the command by executing `huggingface-cli download Tencent-Hunyuan/HunyuanDiT --local-dir ./ckpts`
188
 
 
 
 
189
  All models will be automatically downloaded. For more information about the model, visit the Hugging Face repository [here](https://huggingface.co/Tencent-Hunyuan/HunyuanDiT).
190
 
191
  | Model | #Params | Download URL |
 
236
  python sample_t2i.py --prompt "ζΈ”θˆŸε”±ζ™š" --image-size 1280 768
237
  ```
238
 
239
+ More example prompts can be found in [example_prompts.txt](example_prompts.txt)
240
+
241
  ### More Configurations
242
 
243
  We list some more useful configurations for easy usage:
 
265
  author={Zhimin Li, Jianwei Zhang, Qin Lin, Jiangfeng Xiong, Yanxin Long, Xinchi Deng, Yingfang Zhang, Xingchao Liu, Minbin Huang, Zedong Xiao, Dayou Chen, Jiajun He, Jiahao Li, Wenyue Li, Chen Zhang, Rongwei Quan, Jianxiang Lu, Jiabin Huang, Xiaoyan Yuan, Xiaoxiao Zheng, Yixuan Li, Jihong Zhang, Chao Zhang, Meng Chen, Jie Liu, Zheng Fang, Weiyan Wang, Jinbao Xue, Yangyu Tao, JianChen Zhu, Kai Liu, Sihuan Lin, Yifu Sun, Yun Li, Dongdong Wang, Zhichao Hu, Xiao Xiao, Yan Chen, Yuhong Liu, Wei Liu, Di Wang, Yong Yang, Jie Jiang, Qinglin Lu},
266
  year={2024},
267
  }
268
+ ```