Text-to-Video
Diffusers
Safetensors
I2VGenXLPipeline
image-to-video
StevenZhang commited on
Commit
7a28b7f
1 Parent(s): b788d6f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +283 -0
README.md CHANGED
@@ -1,3 +1,286 @@
1
  ---
2
  license: mit
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
  ---
4
+ # VGen
5
+
6
+
7
+ ![figure1](source/VGen.jpg "figure1")
8
+
9
+ VGen is an open-source video synthesis codebase developed by the Tongyi Lab of Alibaba Group, featuring state-of-the-art video generative models. This repository includes implementations of the following methods:
10
+
11
+
12
+ - [I2VGen-xl: High-quality image-to-video synthesis via cascaded diffusion models](https://i2vgen-xl.github.io/)
13
+ - [VideoComposer: Compositional Video Synthesis with Motion Controllability](https://videocomposer.github.io/)
14
+ - [Hierarchical Spatio-temporal Decoupling for Text-to-Video Generation](https://higen-t2v.github.io/)
15
+ - [A Recipe for Scaling up Text-to-Video Generation with Text-free Videos]()
16
+ - [InstructVideo: Instructing Video Diffusion Models with Human Feedback]()
17
+ - [DreamVideo: Composing Your Dream Videos with Customized Subject and Motion](https://dreamvideo-t2v.github.io/)
18
+ - [VideoLCM: Video Latent Consistency Model](https://arxiv.org/abs/2312.09109)
19
+ - [Modelscope text-to-video technical report](https://arxiv.org/abs/2308.06571)
20
+
21
+
22
+ VGen can produce high-quality videos from the input text, images, desired motion, desired subjects, and even the feedback signals provided. It also offers a variety of commonly used video generation tools such as visualization, sampling, training, inference, join training using images and videos, acceleration, and more.
23
+
24
+
25
+ <a href='https://i2vgen-xl.github.io/'><img src='https://img.shields.io/badge/Project-Page-Green'></a> <a href='https://arxiv.org/abs/2311.04145'><img src='https://img.shields.io/badge/Paper-Arxiv-red'></a> [![YouTube](https://badges.aleen42.com/src/youtube.svg)](https://youtu.be/XUi0y7dxqEQ) <a href='https://cloud.video.taobao.com/play/u/null/p/1/e/6/t/1/441039979087.mp4'><img src='source/logo.png'></a>
26
+
27
+
28
+ ## 🔥News!!!
29
+ - __[2023.12]__ We release the high-efficiency video generation method [VideoLCM](https://arxiv.org/abs/2312.09109)
30
+ - __[2023.12]__ We release the code and model of I2VGen-XL and the ModelScope T2V
31
+ - __[2023.12]__ We release the T2V method [HiGen](https://higen-t2v.github.io) and customizing T2V method [DreamVideo](https://dreamvideo-t2v.github.io).
32
+ - __[2023.12]__ We write an [introduction docment](doc/introduction.pdf) for VGen and compare I2VGen-XL with SVD.
33
+ - __[2023.11]__ We release a high-quality I2VGen-XL model, please refer to the [Webpage](https://i2vgen-xl.github.io)
34
+
35
+
36
+ ## TODO
37
+ - [x] Release the technical papers and webpage of [I2VGen-XL](doc/i2vgen-xl.md)
38
+ - [x] Release the code and pretrained models that can generate 1280x720 videos
39
+ - [ ] Release models optimized specifically for the human body and faces
40
+ - [ ] Updated version can fully maintain the ID and capture large and accurate motions simultaneously
41
+ - [ ] Release other methods and the corresponding models
42
+
43
+
44
+ ## Preparation
45
+
46
+ The main features of VGen are as follows:
47
+ - Expandability, allowing for easy management of your own experiments.
48
+ - Completeness, encompassing all common components for video generation.
49
+ - Excellent performance, featuring powerful pre-trained models in multiple tasks.
50
+
51
+
52
+ ### Installation
53
+
54
+ ```
55
+ conda create -n vgen python=3.8
56
+ conda activate vgen
57
+ pip install torch==1.12.0+cu113 torchvision==0.13.0+cu113 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu113
58
+ pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
59
+ ```
60
+
61
+ ### Datasets
62
+
63
+ We have provided a **demo dataset** that includes images and videos, along with their lists in ``data``.
64
+
65
+ *Please note that the demo images used here are for testing purposes and were not included in the training.*
66
+
67
+
68
+ ### Clone codeb
69
+
70
+ ```
71
+ git clone https://github.com/damo-vilab/i2vgen-xl.git
72
+ cd i2vgen-xl
73
+ ```
74
+
75
+
76
+ ## Getting Started with VGen
77
+
78
+ ### (1) Train your text-to-video model
79
+
80
+
81
+ Executing the following command to enable distributed training is as easy as that.
82
+ ```
83
+ python train_net.py --cfg configs/t2v_train.yaml
84
+ ```
85
+
86
+ In the `t2v_train.yaml` configuration file, you can specify the data, adjust the video-to-image ratio using `frame_lens`, and validate your ideas with different Diffusion settings, and so on.
87
+
88
+ - Before the training, you can download any of our open-source models for initialization. Our codebase supports custom initialization and `grad_scale` settings, all of which are included in the `Pretrain` item in yaml file.
89
+ - During the training, you can view the saved models and intermediate inference results in the `workspace/experiments/t2v_train`directory.
90
+
91
+ After the training is completed, you can perform inference on the model using the following command.
92
+ ```
93
+ python inference.py --cfg configs/t2v_infer.yaml
94
+ ```
95
+ Then you can find the videos you generated in the `workspace/experiments/test_img_01` directory. For specific configurations such as data, models, seed, etc., please refer to the `t2v_infer.yaml` file.
96
+
97
+ <!-- <table>
98
+ <center>
99
+ <tr>
100
+ <td ><center>
101
+ <video muted="true" autoplay="true" loop="true" height="260" src="https://cloud.video.taobao.com/play/u/null/p/1/e/6/t/1/441754174077.mp4"></video>
102
+ </center></td>
103
+ <td ><center>
104
+ <video muted="true" autoplay="true" loop="true" height="260" src="https://cloud.video.taobao.com/play/u/null/p/1/e/6/t/1/441138824052.mp4"></video>
105
+ </center></td>
106
+ </tr>
107
+ </center>
108
+ </table>
109
+ </center> -->
110
+
111
+ <table>
112
+ <center>
113
+ <tr>
114
+ <td ><center>
115
+ <image height="260" src="https://img.alicdn.com/imgextra/i4/O1CN01Ya2I5I25utrJwJ9Jf_!!6000000007587-2-tps-1280-720.png"></image>
116
+ </center></td>
117
+ <td ><center>
118
+ <image height="260" src="https://img.alicdn.com/imgextra/i3/O1CN01CrmYaz1zXBetmg3dd_!!6000000006723-2-tps-1280-720.png"></image>
119
+ </center></td>
120
+ </tr>
121
+ <tr>
122
+ <td ><center>
123
+ <p>Clike <a href="https://cloud.video.taobao.com/play/u/null/p/1/e/6/t/1/441754174077.mp4">HRER</a> to view the generated video.</p>
124
+ </center></td>
125
+ <td ><center>
126
+ <p>Clike <a href="https://cloud.video.taobao.com/play/u/null/p/1/e/6/t/1/441138824052.mp4">HRER</a> to view the generated video.</p>
127
+ </center></td>
128
+ </tr>
129
+ </center>
130
+ </table>
131
+ </center>
132
+
133
+
134
+ ### (2) Run the I2VGen-XL model
135
+
136
+ (i) Download model and test data:
137
+ ```
138
+ !pip install modelscope
139
+ from modelscope.hub.snapshot_download import snapshot_download
140
+ model_dir = snapshot_download('damo/I2VGen-XL', cache_dir='models/', revision='v1.0.0')
141
+ ```
142
+
143
+ (ii) Run the following command:
144
+ ```
145
+ python inference.py --cfg configs/i2vgen_xl_infer.yaml
146
+ ```
147
+ In a few minutes, you can retrieve the high-definition video you wish to create from the `workspace/experiments/test_img_01` directory. At present, we find that the current model performs inadequately on **anime images** and **images with a black background** due to the lack of relevant training data. We are consistently working to optimize it.
148
+
149
+
150
+ <span style="color:red">Due to the compression of our video quality in GIF format, please click 'HRER' below to view the original video.</span>
151
+
152
+ <center>
153
+ <table>
154
+ <center>
155
+ <tr>
156
+ <td ><center>
157
+ <image height="260" src="https://img.alicdn.com/imgextra/i1/O1CN01CCEq7K1ZeLpNQqrWu_!!6000000003219-0-tps-1280-720.jpg"></image>
158
+ </center></td>
159
+ <td ><center>
160
+ <!-- <video muted="true" autoplay="true" loop="true" height="260" src="https://cloud.video.taobao.com/play/u/null/p/1/e/6/t/1/442125067544.mp4"></video> -->
161
+ <image height="260" src="https://img.alicdn.com/imgextra/i4/O1CN01hIQcvG1spmQMLqBo0_!!6000000005816-1-tps-1280-704.gif"></image>
162
+ </center></td>
163
+ </tr>
164
+ <tr>
165
+ <td ><center>
166
+ <p>Input Image</p>
167
+ </center></td>
168
+ <td ><center>
169
+ <p>Clike <a href="https://cloud.video.taobao.com/play/u/null/p/1/e/6/t/1/442125067544.mp4">HRER</a> to view the generated video.</p>
170
+ </center></td>
171
+ </tr>
172
+ <tr>
173
+ <td ><center>
174
+ <image height="260" src="https://img.alicdn.com/imgextra/i4/O1CN01ZXY7UN23K8q4oQ3uG_!!6000000007236-2-tps-1280-720.png"></image>
175
+ </center></td>
176
+ <td ><center>
177
+ <!-- <video muted="true" autoplay="true" loop="true" height="260" src="https://cloud.video.taobao.com/play/u/null/p/1/e/6/t/1/441385957074.mp4"></video> -->
178
+ <image height="260" src="https://img.alicdn.com/imgextra/i1/O1CN01iaSiiv1aJZURUEY53_!!6000000003309-1-tps-1280-704.gif"></image>
179
+ </center></td>
180
+ </tr>
181
+ <tr>
182
+ <td ><center>
183
+ <p>Input Image</p>
184
+ </center></td>
185
+ <td ><center>
186
+ <p>Clike <a href="https://cloud.video.taobao.com/play/u/null/p/1/e/6/t/1/441385957074.mp4">HRER</a> to view the generated video.</p>
187
+ </center></td>
188
+ </tr>
189
+ <tr>
190
+ <td ><center>
191
+ <image height="260" src="https://img.alicdn.com/imgextra/i3/O1CN01NHpVGl1oat4H54Hjf_!!6000000005242-2-tps-1280-720.png"></image>
192
+ </center></td>
193
+ <td ><center>
194
+ <!-- <video muted="true" autoplay="true" loop="true" height="260" src="https://cloud.video.taobao.com/play/u/null/p/1/e/6/t/1/442102706767.mp4"></video> -->
195
+ <!-- <image muted="true" height="260" src="https://img.alicdn.com/imgextra/i4/O1CN01DgLj1T240jfpzKoaQ_!!6000000007329-1-tps-1280-704.gif"></image>
196
+ -->
197
+ <image height="260" src="https://img.alicdn.com/imgextra/i4/O1CN01DgLj1T240jfpzKoaQ_!!6000000007329-1-tps-1280-704.gif"></image>
198
+ </center></td>
199
+ </tr>
200
+ <tr>
201
+ <td ><center>
202
+ <p>Input Image</p>
203
+ </center></td>
204
+ <td ><center>
205
+ <p>Clike <a href="https://cloud.video.taobao.com/play/u/null/p/1/e/6/t/1/442102706767.mp4">HRER</a> to view the generated video.</p>
206
+ </center></td>
207
+ </tr>
208
+ <tr>
209
+ <td ><center>
210
+ <image height="260" src="https://img.alicdn.com/imgextra/i1/O1CN01odS61s1WW9tXen21S_!!6000000002795-0-tps-1280-720.jpg"></image>
211
+ </center></td>
212
+ <td ><center>
213
+ <!-- <video muted="true" autoplay="true" loop="true" height="260" src="https://cloud.video.taobao.com/play/u/null/p/1/e/6/t/1/442163934688.mp4"></video> -->
214
+ <image height="260" src="https://img.alicdn.com/imgextra/i3/O1CN01Jyk1HT28JkZtpAtY6_!!6000000007912-1-tps-1280-704.gif"></image>
215
+ </center></td>
216
+ </tr>
217
+ <tr>
218
+ <td ><center>
219
+ <p>Input Image</p>
220
+ </center></td>
221
+ <td ><center>
222
+ <p>Clike <a href="https://cloud.video.taobao.com/play/u/null/p/1/e/6/t/1/442163934688.mp4">HRER</a> to view the generated video.</p>
223
+ </center></td>
224
+ </tr>
225
+ </center>
226
+ </table>
227
+ </center>
228
+
229
+ ### (3) Other methods
230
+
231
+ In preparation.
232
+
233
+
234
+ ## Customize your own approach
235
+
236
+ Our codebase essentially supports all the commonly used components in video generation. You can manage your experiments flexibly by adding corresponding registration classes, including `ENGINE, MODEL, DATASETS, EMBEDDER, AUTO_ENCODER, DISTRIBUTION, VISUAL, DIFFUSION, PRETRAIN`, and can be compatible with all our open-source algorithms according to your own needs. If you have any questions, feel free to give us your feedback at any time.
237
+
238
+
239
+
240
+ ## BibTeX
241
+
242
+ If this repo is useful to you, please cite our corresponding technical paper.
243
+
244
+
245
+ ```bibtex
246
+ @article{2023i2vgenxl,
247
+ title={I2VGen-XL: High-Quality Image-to-Video Synthesis via Cascaded Diffusion Models},
248
+ author={Zhang, Shiwei and Wang, Jiayu and Zhang, Yingya and Zhao, Kang and Yuan, Hangjie and Qing, Zhiwu and Wang, Xiang and Zhao, Deli and Zhou, Jingren},
249
+ booktitle={arXiv preprint arXiv:2311.04145},
250
+ year={2023}
251
+ }
252
+ @article{2023videocomposer,
253
+ title={VideoComposer: Compositional Video Synthesis with Motion Controllability},
254
+ author={Wang, Xiang and Yuan, Hangjie and Zhang, Shiwei and Chen, Dayou and Wang, Jiuniu, and Zhang, Yingya, and Shen, Yujun, and Zhao, Deli and Zhou, Jingren},
255
+ booktitle={arXiv preprint arXiv:2306.02018},
256
+ year={2023}
257
+ }
258
+ @article{wang2023modelscope,
259
+ title={Modelscope text-to-video technical report},
260
+ author={Wang, Jiuniu and Yuan, Hangjie and Chen, Dayou and Zhang, Yingya and Wang, Xiang and Zhang, Shiwei},
261
+ journal={arXiv preprint arXiv:2308.06571},
262
+ year={2023}
263
+ }
264
+ @article{dreamvideo,
265
+ title={DreamVideo: Composing Your Dream Videos with Customized Subject and Motion},
266
+ author={Wei, Yujie and Zhang, Shiwei and Qing, Zhiwu and Yuan, Hangjie and Liu, Zhiheng and Liu, Yu and Zhang, Yingya and Zhou, Jingren and Shan, Hongming},
267
+ journal={arXiv preprint arXiv:2312.04433},
268
+ year={2023}
269
+ }
270
+ @article{qing2023higen,
271
+ title={Hierarchical Spatio-temporal Decoupling for Text-to-Video Generation},
272
+ author={Qing, Zhiwu and Zhang, Shiwei and Wang, Jiayu and Wang, Xiang and Wei, Yujie and Zhang, Yingya and Gao, Changxin and Sang, Nong },
273
+ journal={arXiv preprint arXiv:2312.04483},
274
+ year={2023}
275
+ }
276
+ @article{wang2023videolcm,
277
+ title={VideoLCM: Video Latent Consistency Model},
278
+ author={Wang, Xiang and Zhang, Shiwei and Zhang, Han and Liu, Yu and Zhang, Yingya and Gao, Changxin and Sang, Nong },
279
+ journal={arXiv preprint arXiv:2312.09109},
280
+ year={2023}
281
+ }
282
+ ```
283
+
284
+ ## Disclaimer
285
+
286
+ This open-source model is trained with using [WebVid-10M](https://m-bain.github.io/webvid-dataset/) and [LAION-400M](https://laion.ai/blog/laion-400-open-dataset/) datasets and is intended for <strong>RESEARCH/NON-COMMERCIAL USE ONLY</strong>.