zR
commited on
Commit
•
0105673
1
Parent(s):
17ab7f9
test release
Browse files- README.md +117 -35
- README_zh.md +104 -16
README.md
CHANGED
@@ -26,94 +26,176 @@ inference: false
|
|
26 |
|
27 |
## Demo Show
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
## Model Introduction
|
30 |
|
31 |
-
CogVideoX is an open-source version of the video generation model originating from [QingYing](https://chatglm.cn/video).
|
32 |
-
The table below displays the list of video generation models we currently offer, along with their foundational
|
33 |
-
information.
|
34 |
|
35 |
<table style="border-collapse: collapse; width: 100%;">
|
36 |
<tr>
|
37 |
<th style="text-align: center;">Model Name</th>
|
38 |
<th style="text-align: center;">CogVideoX-2B</th>
|
39 |
-
<th style="text-align: center;">CogVideoX-5B (
|
40 |
</tr>
|
41 |
<tr>
|
42 |
<td style="text-align: center;">Model Description</td>
|
43 |
-
<td style="text-align: center;">Entry-level model
|
44 |
<td style="text-align: center;">Larger model with higher video generation quality and better visual effects.</td>
|
45 |
</tr>
|
46 |
-
<tr>
|
47 |
-
<td style="text-align: center;">Inference Speed<br>(Step = 50)</td>
|
48 |
-
<td style="text-align: center;">FP16: ~90* s</td>
|
49 |
-
<td style="text-align: center;">BF16: ~180* s</td>
|
50 |
-
</tr>
|
51 |
<tr>
|
52 |
<td style="text-align: center;">Inference Precision</td>
|
53 |
-
<td style="text-align: center;"><b>FP16*(
|
54 |
-
<td style="text-align: center;"><b>BF16(
|
55 |
</tr>
|
56 |
<tr>
|
57 |
-
<td style="text-align: center;">Single GPU
|
58 |
<td style="text-align: center;">FP16: 18GB using <a href="https://github.com/THUDM/SwissArmyTransformer">SAT</a> / <b>12.5GB* using diffusers</b><br><b>INT8: 7.8GB* using diffusers</b></td>
|
59 |
<td style="text-align: center;">BF16: 26GB using <a href="https://github.com/THUDM/SwissArmyTransformer">SAT</a> / <b>20.7GB* using diffusers</b><br><b>INT8: 11.4GB* using diffusers</b></td>
|
60 |
</tr>
|
61 |
<tr>
|
62 |
-
<td style="text-align: center;">Multi-GPU
|
63 |
-
<td style="text-align: center;"><b>FP16: 10GB* using diffusers</b
|
64 |
-
<td style="text-align: center;"><b>BF16: 15GB* using diffusers</b
|
|
|
|
|
|
|
|
|
|
|
65 |
</tr>
|
66 |
<tr>
|
67 |
-
<td style="text-align: center;">Fine-tuning
|
|
|
|
|
|
|
|
|
|
|
68 |
<td style="text-align: center;">47 GB (bs=1, LORA)<br> 61 GB (bs=2, LORA)<br> 62GB (bs=1, SFT)</td>
|
69 |
-
<td style="text-align: center;">63 GB (bs=1, LORA)<br> 80 GB (bs=2, LORA)<br> 75GB (bs=1, SFT)
|
70 |
</tr>
|
71 |
<tr>
|
72 |
<td style="text-align: center;">Prompt Language</td>
|
73 |
<td colspan="2" style="text-align: center;">English*</td>
|
74 |
</tr>
|
75 |
<tr>
|
76 |
-
<td style="text-align: center;">
|
77 |
<td colspan="2" style="text-align: center;">226 Tokens</td>
|
78 |
</tr>
|
79 |
<tr>
|
80 |
<td style="text-align: center;">Video Length</td>
|
81 |
-
<td colspan="2" style="text-align: center;">6
|
82 |
</tr>
|
83 |
<tr>
|
84 |
<td style="text-align: center;">Frame Rate</td>
|
85 |
-
<td colspan="2" style="text-align: center;">8
|
86 |
</tr>
|
87 |
<tr>
|
88 |
<td style="text-align: center;">Video Resolution</td>
|
89 |
-
<td colspan="2" style="text-align: center;">720
|
90 |
</tr>
|
91 |
-
|
92 |
<td style="text-align: center;">Positional Encoding</td>
|
93 |
<td style="text-align: center;">3d_sincos_pos_embed</td>
|
94 |
-
<td style="text-align: center;">3d_rope_pos_embed
|
95 |
</tr>
|
96 |
</table>
|
97 |
|
98 |
**Data Explanation**
|
99 |
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
while maintaining minimal video quality loss, though the inference speed will be significantly reduced.
|
108 |
-
+ Inference speed tests also used the memory optimization mentioned above. Without memory optimization, inference speed
|
109 |
-
increases by approximately 10%. Only the `diffusers` version of the model supports quantization.
|
110 |
-
+ The model only supports English input; other languages can be translated to English for refinement by large models.
|
111 |
|
112 |
**Note**
|
113 |
|
114 |
+ Using [SAT](https://github.com/THUDM/SwissArmyTransformer) for inference and fine-tuning of SAT version
|
115 |
models. Feel free to visit our GitHub for more information.
|
116 |
|
|
|
|
|
117 |
## Quick Start 🤗
|
118 |
|
119 |
This model supports deployment using the huggingface diffusers library. You can deploy it by following these steps.
|
|
|
26 |
|
27 |
## Demo Show
|
28 |
|
29 |
+
<!DOCTYPE html>
|
30 |
+
<html lang="en">
|
31 |
+
<head>
|
32 |
+
<meta charset="UTF-8">
|
33 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
34 |
+
<title>Video Gallery with Captions</title>
|
35 |
+
<style>
|
36 |
+
.video-container {
|
37 |
+
display: flex;
|
38 |
+
flex-wrap: wrap;
|
39 |
+
justify-content: space-around;
|
40 |
+
}
|
41 |
+
.video-item {
|
42 |
+
width: 45%;
|
43 |
+
margin-bottom: 20px;
|
44 |
+
transition: transform 0.3s;
|
45 |
+
}
|
46 |
+
.video-item:hover {
|
47 |
+
transform: scale(1.1);
|
48 |
+
}
|
49 |
+
.caption {
|
50 |
+
text-align: center;
|
51 |
+
margin-top: 10px;
|
52 |
+
font-size: 11px;
|
53 |
+
}
|
54 |
+
</style>
|
55 |
+
</head>
|
56 |
+
<body>
|
57 |
+
<div class="video-container">
|
58 |
+
<div class="video-item">
|
59 |
+
<video width="100%" controls>
|
60 |
+
<source src="https://github.com/user-attachments/assets/cf5953ea-96d3-48fd-9907-c4708752c714" type="video/mp4">
|
61 |
+
</video>
|
62 |
+
<div class="caption">A garden comes to life as a kaleidoscope of butterflies flutters amidst the blossoms, their delicate wings casting shadows on the petals below. In the background, a grand fountain cascades water with a gentle splendor, its rhythmic sound providing a soothing backdrop. Beneath the cool shade of a mature tree, a solitary wooden chair invites solitude and reflection, its smooth surface worn by the touch of countless visitors seeking a moment of tranquility in nature's embrace.</div>
|
63 |
+
</div>
|
64 |
+
<div class="video-item">
|
65 |
+
<video width="100%" controls>
|
66 |
+
<source src="https://github.com/user-attachments/assets/fe0a78e6-b669-4800-8cf0-b5f9b5145b52" type="video/mp4">
|
67 |
+
</video>
|
68 |
+
<div class="caption">A small boy, head bowed and determination etched on his face, sprints through the torrential downpour as lightning crackles and thunder rumbles in the distance. The relentless rain pounds the ground, creating a chaotic dance of water droplets that mirror the dramatic sky's anger. In the far background, the silhouette of a cozy home beckons, a faint beacon of safety and warmth amidst the fierce weather. The scene is one of perseverance and the unyielding spirit of a child braving the elements.</div>
|
69 |
+
</div>
|
70 |
+
<div class="video-item">
|
71 |
+
<video width="100%" controls>
|
72 |
+
<source src="https://github.com/user-attachments/assets/c182f606-8f8c-421d-b414-8487070fcfcb" type="video/mp4">
|
73 |
+
</video>
|
74 |
+
<div class="caption">A suited astronaut, with the red dust of Mars clinging to their boots, reaches out to shake hands with an alien being, their skin a shimmering blue, under the pink-tinged sky of the fourth planet. In the background, a sleek silver rocket, a beacon of human ingenuity, stands tall, its engines powered down, as the two representatives of different worlds exchange a historic greeting amidst the desolate beauty of the Martian landscape.</div>
|
75 |
+
</div>
|
76 |
+
<div class="video-item">
|
77 |
+
<video width="100%" controls>
|
78 |
+
<source src="https://github.com/user-attachments/assets/7db2bbce-194d-434d-a605-350254b6c298" type="video/mp4">
|
79 |
+
</video>
|
80 |
+
<div class="caption">An elderly gentleman, with a serene expression, sits at the water's edge, a steaming cup of tea by his side. He is engrossed in his artwork, brush in hand, as he renders an oil painting on a canvas that's propped up against a small, weathered table. The sea breeze whispers through his silver hair, gently billowing his loose-fitting white shirt, while the salty air adds an intangible element to his masterpiece in progress. The scene is one of tranquility and inspiration, with the artist's canvas capturing the vibrant hues of the setting sun reflecting off the tranquil sea.</div>
|
81 |
+
</div>
|
82 |
+
<div class="video-item">
|
83 |
+
<video width="100%" controls>
|
84 |
+
<source src="https://github.com/user-attachments/assets/62b01046-8cab-44cc-bd45-4d965bb615ec" type="video/mp4">
|
85 |
+
</video>
|
86 |
+
<div class="caption">In a dimly lit bar, purplish light bathes the face of a mature man, his eyes blinking thoughtfully as he ponders in close-up, the background artfully blurred to focus on his introspective expression, the ambiance of the bar a mere suggestion of shadows and soft lighting.</div>
|
87 |
+
</div>
|
88 |
+
<div class="video-item">
|
89 |
+
<video width="100%" controls>
|
90 |
+
<source src="https://github.com/user-attachments/assets/d78e552a-4b3f-4b81-ac3f-3898079554f6" type="video/mp4">
|
91 |
+
</video>
|
92 |
+
<div class="caption">A golden retriever, sporting sleek black sunglasses, with its lengthy fur flowing in the breeze, sprints playfully across a rooftop terrace, recently refreshed by a light rain. The scene unfolds from a distance, the dog's energetic bounds growing larger as it approaches the camera, its tail wagging with unrestrained joy, while droplets of water glisten on the concrete behind it. The overcast sky provides a dramatic backdrop, emphasizing the vibrant golden coat of the canine as it dashes towards the viewer.</div>
|
93 |
+
</div>
|
94 |
+
<div class="video-item">
|
95 |
+
<video width="100%" controls>
|
96 |
+
<source src="https://github.com/user-attachments/assets/30894f12-c741-44a2-9e6e-ddcacc231e5b" type="video/mp4">
|
97 |
+
</video>
|
98 |
+
<div class="caption">On a brilliant sunny day, the lakeshore is lined with an array of willow trees, their slender branches swaying gently in the soft breeze. The tranquil surface of the lake reflects the clear blue sky, while several elegant swans glide gracefully through the still water, leaving behind delicate ripples that disturb the mirror-like quality of the lake. The scene is one of serene beauty, with the willows' greenery providing a picturesque frame for the peaceful avian visitors.</div>
|
99 |
+
</div>
|
100 |
+
<div class="video-item">
|
101 |
+
<video width="100%" controls>
|
102 |
+
<source src="https://github.com/user-attachments/assets/926575ca-7150-435b-a0ff-4900a963297b" type="video/mp4">
|
103 |
+
</video>
|
104 |
+
<div class="caption">A Chinese mother, draped in a soft, pastel-colored robe, gently rocks back and forth in a cozy rocking chair positioned in the tranquil setting of a nursery. The dimly lit bedroom is adorned with whimsical mobiles dangling from the ceiling, casting shadows that dance on the walls. Her baby, swaddled in a delicate, patterned blanket, rests against her chest, the child's earlier cries now replaced by contented coos as the mother's soothing voice lulls the little one to sleep. The scent of lavender fills the air, adding to the serene atmosphere, while a warm, orange glow from a nearby nightlight illuminates the scene with a gentle hue, capturing a moment of tender love and comfort.</div>
|
105 |
+
</div>
|
106 |
+
</div>
|
107 |
+
</body>
|
108 |
+
</html>
|
109 |
+
|
110 |
## Model Introduction
|
111 |
|
112 |
+
CogVideoX is an open-source version of the video generation model originating from [QingYing](https://chatglm.cn/video?fr=osm_cogvideo). The table below displays the list of video generation models we currently offer, along with their foundational information.
|
|
|
|
|
113 |
|
114 |
<table style="border-collapse: collapse; width: 100%;">
|
115 |
<tr>
|
116 |
<th style="text-align: center;">Model Name</th>
|
117 |
<th style="text-align: center;">CogVideoX-2B</th>
|
118 |
+
<th style="text-align: center;">CogVideoX-5B (This Repository)</th>
|
119 |
</tr>
|
120 |
<tr>
|
121 |
<td style="text-align: center;">Model Description</td>
|
122 |
+
<td style="text-align: center;">Entry-level model, balancing compatibility. Low cost for running and secondary development.</td>
|
123 |
<td style="text-align: center;">Larger model with higher video generation quality and better visual effects.</td>
|
124 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
125 |
<tr>
|
126 |
<td style="text-align: center;">Inference Precision</td>
|
127 |
+
<td style="text-align: center;"><b>FP16* (Recommended)</b>, BF16, FP32, FP8*, INT8, no support for INT4</td>
|
128 |
+
<td style="text-align: center;"><b>BF16 (Recommended)</b>, FP16, FP32, FP8*, INT8, no support for INT4</td>
|
129 |
</tr>
|
130 |
<tr>
|
131 |
+
<td style="text-align: center;">Single GPU VRAM Consumption</td>
|
132 |
<td style="text-align: center;">FP16: 18GB using <a href="https://github.com/THUDM/SwissArmyTransformer">SAT</a> / <b>12.5GB* using diffusers</b><br><b>INT8: 7.8GB* using diffusers</b></td>
|
133 |
<td style="text-align: center;">BF16: 26GB using <a href="https://github.com/THUDM/SwissArmyTransformer">SAT</a> / <b>20.7GB* using diffusers</b><br><b>INT8: 11.4GB* using diffusers</b></td>
|
134 |
</tr>
|
135 |
<tr>
|
136 |
+
<td style="text-align: center;">Multi-GPU Inference VRAM Consumption</td>
|
137 |
+
<td style="text-align: center;"><b>FP16: 10GB* using diffusers</b></td>
|
138 |
+
<td style="text-align: center;"><b>BF16: 15GB* using diffusers</b></td>
|
139 |
+
</tr>
|
140 |
+
<tr>
|
141 |
+
<td style="text-align: center;">Inference Speed<br>(Step = 50, FP/BF16)</td>
|
142 |
+
<td style="text-align: center;">Single A100: ~90 seconds<br>Single H100: ~45 seconds</td>
|
143 |
+
<td style="text-align: center;">Single A100: ~180 seconds<br>Single H100: ~90 seconds</td>
|
144 |
</tr>
|
145 |
<tr>
|
146 |
+
<td style="text-align: center;">Fine-tuning Precision</td>
|
147 |
+
<td style="text-align: center;"><b>FP16</b></td>
|
148 |
+
<td style="text-align: center;"><b>BF16</b></td>
|
149 |
+
</tr>
|
150 |
+
<tr>
|
151 |
+
<td style="text-align: center;">Fine-tuning VRAM Consumption (per GPU)</td>
|
152 |
<td style="text-align: center;">47 GB (bs=1, LORA)<br> 61 GB (bs=2, LORA)<br> 62GB (bs=1, SFT)</td>
|
153 |
+
<td style="text-align: center;">63 GB (bs=1, LORA)<br> 80 GB (bs=2, LORA)<br> 75GB (bs=1, SFT)</td>
|
154 |
</tr>
|
155 |
<tr>
|
156 |
<td style="text-align: center;">Prompt Language</td>
|
157 |
<td colspan="2" style="text-align: center;">English*</td>
|
158 |
</tr>
|
159 |
<tr>
|
160 |
+
<td style="text-align: center;">Prompt Length Limit</td>
|
161 |
<td colspan="2" style="text-align: center;">226 Tokens</td>
|
162 |
</tr>
|
163 |
<tr>
|
164 |
<td style="text-align: center;">Video Length</td>
|
165 |
+
<td colspan="2" style="text-align: center;">6 Seconds</td>
|
166 |
</tr>
|
167 |
<tr>
|
168 |
<td style="text-align: center;">Frame Rate</td>
|
169 |
+
<td colspan="2" style="text-align: center;">8 Frames per Second</td>
|
170 |
</tr>
|
171 |
<tr>
|
172 |
<td style="text-align: center;">Video Resolution</td>
|
173 |
+
<td colspan="2" style="text-align: center;">720 x 480, no support for other resolutions (including fine-tuning)</td>
|
174 |
</tr>
|
175 |
+
<tr>
|
176 |
<td style="text-align: center;">Positional Encoding</td>
|
177 |
<td style="text-align: center;">3d_sincos_pos_embed</td>
|
178 |
+
<td style="text-align: center;">3d_rope_pos_embed</td>
|
179 |
</tr>
|
180 |
</table>
|
181 |
|
182 |
**Data Explanation**
|
183 |
|
184 |
+
- When testing with the diffusers library, the `enable_model_cpu_offload()` option and `pipe.vae.enable_tiling()` optimization were enabled. This solution has not been tested for actual VRAM/memory usage on devices other than **NVIDIA A100/H100**. Generally, this solution can be adapted to all devices with **NVIDIA Ampere architecture** and above. If optimization is disabled, VRAM usage will increase significantly, with peak VRAM approximately 3 times the value in the table.
|
185 |
+
- When performing multi-GPU inference, the `enable_model_cpu_offload()` optimization needs to be disabled.
|
186 |
+
- Using an INT8 model will result in reduced inference speed. This is done to accommodate GPUs with lower VRAM, allowing inference to run properly with minimal video quality loss, though the inference speed will be significantly reduced.
|
187 |
+
- The 2B model is trained using `FP16` precision, while the 5B model is trained using `BF16` precision. It is recommended to use the precision used in model training for inference.
|
188 |
+
- `FP8` precision must be used on `NVIDIA H100` and above devices, requiring source installation of the `torch`, `torchao`, `diffusers`, and `accelerate` Python packages. `CUDA 12.4` is recommended.
|
189 |
+
- Inference speed testing also used the aforementioned VRAM optimization scheme. Without VRAM optimization, inference speed increases by about 10%. Only models using `diffusers` support quantization.
|
190 |
+
- The model only supports English input; other languages can be translated to English during large model refinements.
|
|
|
|
|
|
|
|
|
191 |
|
192 |
**Note**
|
193 |
|
194 |
+ Using [SAT](https://github.com/THUDM/SwissArmyTransformer) for inference and fine-tuning of SAT version
|
195 |
models. Feel free to visit our GitHub for more information.
|
196 |
|
197 |
+
|
198 |
+
|
199 |
## Quick Start 🤗
|
200 |
|
201 |
This model supports deployment using the huggingface diffusers library. You can deploy it by following these steps.
|
README_zh.md
CHANGED
@@ -13,15 +13,96 @@
|
|
13 |
|
14 |
## 作品案例
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
## 模型介绍
|
17 |
|
18 |
-
CogVideoX是 [清影](https://chatglm.cn/video) 同源的开源版本视频生成模型。下表展示目前我们提供的视频生成模型列表,以及相关基础信息。
|
19 |
|
20 |
<table style="border-collapse: collapse; width: 100%;">
|
21 |
<tr>
|
22 |
<th style="text-align: center;">模型名</th>
|
23 |
<th style="text-align: center;">CogVideoX-2B</th>
|
24 |
-
<th style="text-align: center;">CogVideoX-5B (
|
25 |
</tr>
|
26 |
<tr>
|
27 |
<td style="text-align: center;">模型介绍</td>
|
@@ -29,24 +110,29 @@ CogVideoX是 [清影](https://chatglm.cn/video) 同源的开源版本视频生
|
|
29 |
<td style="text-align: center;">视频生成质量更高,视觉效果更好的更大尺寸模型。</td>
|
30 |
</tr>
|
31 |
<tr>
|
32 |
-
<td style="text-align: center;"
|
33 |
-
<td style="text-align: center;">FP16
|
34 |
-
<td style="text-align: center;">BF16
|
35 |
</tr>
|
36 |
<tr>
|
37 |
<td style="text-align: center;">单GPU显存消耗<br></td>
|
38 |
-
<td style="text-align: center;">18GB using <a href="https://github.com/THUDM/SwissArmyTransformer">SAT</a><br><b>
|
39 |
-
<td style="text-align: center;">26GB using <a href="https://github.com/THUDM/SwissArmyTransformer">SAT</a><br><b>
|
40 |
</tr>
|
41 |
<tr>
|
42 |
-
<td style="text-align: center;"
|
43 |
-
<td style="text-align: center;"><b>
|
44 |
-
<td style="text-align: center;"><b>
|
45 |
</tr>
|
46 |
<tr>
|
47 |
-
<td style="text-align: center;"
|
48 |
-
<td style="text-align: center;"
|
49 |
-
<td style="text-align: center;"
|
|
|
|
|
|
|
|
|
|
|
50 |
</tr>
|
51 |
<tr>
|
52 |
<td style="text-align: center;">微调显存消耗(每卡)</td>
|
@@ -83,11 +169,13 @@ CogVideoX是 [清影](https://chatglm.cn/video) 同源的开源版本视频生
|
|
83 |
**数据解释**
|
84 |
|
85 |
+ 使用 diffusers 库进行测试时,启用了 `enable_model_cpu_offload()` 选项 和 `pipe.vae.enable_tiling()` 优化,该方案未测试在非
|
86 |
-
|
87 |
-
|
88 |
+ 多GPU推理时,需要关闭 `enable_model_cpu_offload()` 优化。
|
89 |
+ 使用 INT8 模型会导致推理速度降低,此举是为了满足显存较低的显卡能正常推理并保持较少的视频质量损失,推理速度大幅降低。
|
90 |
-
+
|
|
|
|
|
91 |
+ 模型仅支持英语输入,其他语言可以通过大模型润色时翻译为英语。
|
92 |
|
93 |
**提醒**
|
|
|
13 |
|
14 |
## 作品案例
|
15 |
|
16 |
+
<!DOCTYPE html>
|
17 |
+
<html lang="en">
|
18 |
+
<head>
|
19 |
+
<meta charset="UTF-8">
|
20 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
21 |
+
<title>Video Gallery with Captions</title>
|
22 |
+
<style>
|
23 |
+
.video-container {
|
24 |
+
display: flex;
|
25 |
+
flex-wrap: wrap;
|
26 |
+
justify-content: space-around;
|
27 |
+
}
|
28 |
+
.video-item {
|
29 |
+
width: 45%;
|
30 |
+
margin-bottom: 20px;
|
31 |
+
transition: transform 0.3s;
|
32 |
+
}
|
33 |
+
.video-item:hover {
|
34 |
+
transform: scale(1.1);
|
35 |
+
}
|
36 |
+
.caption {
|
37 |
+
text-align: center;
|
38 |
+
margin-top: 10px;
|
39 |
+
font-size: 11px;
|
40 |
+
}
|
41 |
+
</style>
|
42 |
+
</head>
|
43 |
+
<body>
|
44 |
+
<div class="video-container">
|
45 |
+
<div class="video-item">
|
46 |
+
<video width="100%" controls>
|
47 |
+
<source src="https://github.com/user-attachments/assets/cf5953ea-96d3-48fd-9907-c4708752c714" type="video/mp4">
|
48 |
+
</video>
|
49 |
+
<div class="caption">A garden comes to life as a kaleidoscope of butterflies flutters amidst the blossoms, their delicate wings casting shadows on the petals below. In the background, a grand fountain cascades water with a gentle splendor, its rhythmic sound providing a soothing backdrop. Beneath the cool shade of a mature tree, a solitary wooden chair invites solitude and reflection, its smooth surface worn by the touch of countless visitors seeking a moment of tranquility in nature's embrace.</div>
|
50 |
+
</div>
|
51 |
+
<div class="video-item">
|
52 |
+
<video width="100%" controls>
|
53 |
+
<source src="https://github.com/user-attachments/assets/fe0a78e6-b669-4800-8cf0-b5f9b5145b52" type="video/mp4">
|
54 |
+
</video>
|
55 |
+
<div class="caption">A small boy, head bowed and determination etched on his face, sprints through the torrential downpour as lightning crackles and thunder rumbles in the distance. The relentless rain pounds the ground, creating a chaotic dance of water droplets that mirror the dramatic sky's anger. In the far background, the silhouette of a cozy home beckons, a faint beacon of safety and warmth amidst the fierce weather. The scene is one of perseverance and the unyielding spirit of a child braving the elements.</div>
|
56 |
+
</div>
|
57 |
+
<div class="video-item">
|
58 |
+
<video width="100%" controls>
|
59 |
+
<source src="https://github.com/user-attachments/assets/c182f606-8f8c-421d-b414-8487070fcfcb" type="video/mp4">
|
60 |
+
</video>
|
61 |
+
<div class="caption">A suited astronaut, with the red dust of Mars clinging to their boots, reaches out to shake hands with an alien being, their skin a shimmering blue, under the pink-tinged sky of the fourth planet. In the background, a sleek silver rocket, a beacon of human ingenuity, stands tall, its engines powered down, as the two representatives of different worlds exchange a historic greeting amidst the desolate beauty of the Martian landscape.</div>
|
62 |
+
</div>
|
63 |
+
<div class="video-item">
|
64 |
+
<video width="100%" controls>
|
65 |
+
<source src="https://github.com/user-attachments/assets/7db2bbce-194d-434d-a605-350254b6c298" type="video/mp4">
|
66 |
+
</video>
|
67 |
+
<div class="caption">An elderly gentleman, with a serene expression, sits at the water's edge, a steaming cup of tea by his side. He is engrossed in his artwork, brush in hand, as he renders an oil painting on a canvas that's propped up against a small, weathered table. The sea breeze whispers through his silver hair, gently billowing his loose-fitting white shirt, while the salty air adds an intangible element to his masterpiece in progress. The scene is one of tranquility and inspiration, with the artist's canvas capturing the vibrant hues of the setting sun reflecting off the tranquil sea.</div>
|
68 |
+
</div>
|
69 |
+
<div class="video-item">
|
70 |
+
<video width="100%" controls>
|
71 |
+
<source src="https://github.com/user-attachments/assets/62b01046-8cab-44cc-bd45-4d965bb615ec" type="video/mp4">
|
72 |
+
</video>
|
73 |
+
<div class="caption">In a dimly lit bar, purplish light bathes the face of a mature man, his eyes blinking thoughtfully as he ponders in close-up, the background artfully blurred to focus on his introspective expression, the ambiance of the bar a mere suggestion of shadows and soft lighting.</div>
|
74 |
+
</div>
|
75 |
+
<div class="video-item">
|
76 |
+
<video width="100%" controls>
|
77 |
+
<source src="https://github.com/user-attachments/assets/d78e552a-4b3f-4b81-ac3f-3898079554f6" type="video/mp4">
|
78 |
+
</video>
|
79 |
+
<div class="caption">A golden retriever, sporting sleek black sunglasses, with its lengthy fur flowing in the breeze, sprints playfully across a rooftop terrace, recently refreshed by a light rain. The scene unfolds from a distance, the dog's energetic bounds growing larger as it approaches the camera, its tail wagging with unrestrained joy, while droplets of water glisten on the concrete behind it. The overcast sky provides a dramatic backdrop, emphasizing the vibrant golden coat of the canine as it dashes towards the viewer.</div>
|
80 |
+
</div>
|
81 |
+
<div class="video-item">
|
82 |
+
<video width="100%" controls>
|
83 |
+
<source src="https://github.com/user-attachments/assets/30894f12-c741-44a2-9e6e-ddcacc231e5b" type="video/mp4">
|
84 |
+
</video>
|
85 |
+
<div class="caption">On a brilliant sunny day, the lakeshore is lined with an array of willow trees, their slender branches swaying gently in the soft breeze. The tranquil surface of the lake reflects the clear blue sky, while several elegant swans glide gracefully through the still water, leaving behind delicate ripples that disturb the mirror-like quality of the lake. The scene is one of serene beauty, with the willows' greenery providing a picturesque frame for the peaceful avian visitors.</div>
|
86 |
+
</div>
|
87 |
+
<div class="video-item">
|
88 |
+
<video width="100%" controls>
|
89 |
+
<source src="https://github.com/user-attachments/assets/926575ca-7150-435b-a0ff-4900a963297b" type="video/mp4">
|
90 |
+
</video>
|
91 |
+
<div class="caption">A Chinese mother, draped in a soft, pastel-colored robe, gently rocks back and forth in a cozy rocking chair positioned in the tranquil setting of a nursery. The dimly lit bedroom is adorned with whimsical mobiles dangling from the ceiling, casting shadows that dance on the walls. Her baby, swaddled in a delicate, patterned blanket, rests against her chest, the child's earlier cries now replaced by contented coos as the mother's soothing voice lulls the little one to sleep. The scent of lavender fills the air, adding to the serene atmosphere, while a warm, orange glow from a nearby nightlight illuminates the scene with a gentle hue, capturing a moment of tender love and comfort.</div>
|
92 |
+
</div>
|
93 |
+
</div>
|
94 |
+
</body>
|
95 |
+
</html>
|
96 |
+
|
97 |
## 模型介绍
|
98 |
|
99 |
+
CogVideoX是 [清影](https://chatglm.cn/video?fr=osm_cogvideo) 同源的开源版本视频生成模型。下表展示目前我们提供的视频生成模型列表,以及相关基础信息。
|
100 |
|
101 |
<table style="border-collapse: collapse; width: 100%;">
|
102 |
<tr>
|
103 |
<th style="text-align: center;">模型名</th>
|
104 |
<th style="text-align: center;">CogVideoX-2B</th>
|
105 |
+
<th style="text-align: center;">CogVideoX-5B (本仓库)</th>
|
106 |
</tr>
|
107 |
<tr>
|
108 |
<td style="text-align: center;">模型介绍</td>
|
|
|
110 |
<td style="text-align: center;">视频生成质量更高,视觉效果更好的更大尺寸模型。</td>
|
111 |
</tr>
|
112 |
<tr>
|
113 |
+
<td style="text-align: center;">推理精度</td>
|
114 |
+
<td style="text-align: center;"><b>FP16*(推荐)</b>, BF16, FP32,FP8*,INT8,不支持INT4</td>
|
115 |
+
<td style="text-align: center;"><b>BF16(推荐)</b>, FP16, FP32,FP8*,INT8,不支持INT4</td>
|
116 |
</tr>
|
117 |
<tr>
|
118 |
<td style="text-align: center;">单GPU显存消耗<br></td>
|
119 |
+
<td style="text-align: center;">FP16: 18GB using <a href="https://github.com/THUDM/SwissArmyTransformer">SAT</a> / <b>12.5GB* using diffusers</b><br><b>INT8: 7.8GB* using diffusers</b></td>
|
120 |
+
<td style="text-align: center;">BF16: 26GB using <a href="https://github.com/THUDM/SwissArmyTransformer">SAT</a> / <b>20.7GB* using diffusers</b><br><b>INT8: 11.4GB* using diffusers</b></td>
|
121 |
</tr>
|
122 |
<tr>
|
123 |
+
<td style="text-align: center;">多GPU推理显存消耗</td>
|
124 |
+
<td style="text-align: center;"><b>FP16: 10GB* using diffusers</b><br></td>
|
125 |
+
<td style="text-align: center;"><b>BF16: 15GB* using diffusers</b><br></td>
|
126 |
</tr>
|
127 |
<tr>
|
128 |
+
<td style="text-align: center;">推理速度<br>(Step = 50, FP/BF16)</td>
|
129 |
+
<td style="text-align: center;">单卡A100: ~90秒<br>单卡H100: ~45秒</td>
|
130 |
+
<td style="text-align: center;">单卡A100: ~180秒<br>单卡H100: ~90秒</td>
|
131 |
+
</tr>
|
132 |
+
<tr>
|
133 |
+
<td style="text-align: center;">微调精度</td>
|
134 |
+
<td style="text-align: center;"><b>FP16</b></td>
|
135 |
+
<td style="text-align: center;"><b>BF16</b></td>
|
136 |
</tr>
|
137 |
<tr>
|
138 |
<td style="text-align: center;">微调显存消耗(每卡)</td>
|
|
|
169 |
**数据解释**
|
170 |
|
171 |
+ 使用 diffusers 库进行测试时,启用了 `enable_model_cpu_offload()` 选项 和 `pipe.vae.enable_tiling()` 优化,该方案未测试在非
|
172 |
+
**NVIDIA A100 / H100** 外的设备上的实际显存 / 内存占用。通常,该方案可以适配于所有 **NVIDIA 安培架构**
|
173 |
+
以上的设备。若关闭优化,显存占用会成倍增加,峰值显存约为表格的3倍。
|
174 |
+ 多GPU推理时,需要关闭 `enable_model_cpu_offload()` 优化。
|
175 |
+ 使用 INT8 模型会导致推理速度降低,此举是为了满足显存较低的显卡能正常推理并保持较少的视频质量损失,推理速度大幅降低。
|
176 |
+
+ 2B 模型采用 `FP16` 精度训练, 5B模型采用 `BF16` 精度训练。我们推荐使用模型训练的精度进行推理。
|
177 |
+
+ `FP8` 精度必须在`NVIDIA H100` 及以上的设备上使用,需要源代码安装`torch`,`torchao`,`diffusers`,`accelerate` python包,推荐使用 `CUDA 12.4`。
|
178 |
+
+ 推理速度测试同样采用了上述显存优化方案,不采用显存优化的情况下,推理速度提升约10%。 只有`diffusers`版本模型支持量化。
|
179 |
+ 模型仅支持英语输入,其他语言可以通过大模型润色时翻译为英语。
|
180 |
|
181 |
**提醒**
|