diff --git a/README.md b/README.md
index 45440ca..2b67613 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,12 @@
+
+> [!NOTE]
+> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
+> [English](./README.en.md) · [原始项目](https://github.com/zai-org/CogVideo) · [上游 README](https://github.com/zai-org/CogVideo/blob/HEAD/README.md)
+> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
+
# CogVideo & CogVideoX
-[中文阅读](./README_zh.md)
+[Read this in English](./README.md)
[日本語で読む](./README_ja.md)
@@ -8,115 +14,97 @@
-Experience the CogVideoX-5B model online at 🤗 Huggingface Space or 🤖 ModelScope Space +在 🤗 Huggingface Space 或 🤖 ModelScope Space 在线体验 CogVideoX-5B 模型
-📚 View the paper and user guide +📚 查看 论文 和 使用文档
- 👋 Join our WeChat and Discord + 👋 加入我们的 微信 和 Discord
-📍 Visit QingYing and API Platform to experience larger-scale commercial video generation models. +📍 前往 清影 和 API平台 体验更大规模的商业版视频生成模型。
-## Project Updates +## 项目更新 -- 🔥🔥 **News**: ```2025/03/24```: We have launched [CogKit](https://github.com/THUDM/CogKit), a fine-tuning and inference framework for the **CogView4** and **CogVideoX** series. This toolkit allows you to fully explore and utilize our multimodal generation models. -- 🔥 **News**: ```2025/02/28```: DDIM Inverse is now supported in `CogVideoX-5B` and `CogVideoX1.5-5B`. Check [here](inference/ddim_inversion.py). -- 🔥 **News**: ```2025/01/08```: We have updated the code for `Lora` fine-tuning based on the `diffusers` version model, which uses less GPU memory. For more details, please see [here](finetune/README.md). -- 🔥 **News**: ```2024/11/15```: We released the `CogVideoX1.5` model in the diffusers version. Only minor parameter adjustments are needed to continue using previous code. -- 🔥 **News**: ```2024/11/08```: We have released the CogVideoX1.5 model. CogVideoX1.5 is an upgraded version of the open-source model CogVideoX. -The CogVideoX1.5-5B series supports 10-second videos with higher resolution, and CogVideoX1.5-5B-I2V supports video generation at any resolution. -The SAT code has already been updated, while the diffusers version is still under adaptation. Download the SAT version code [here](https://huggingface.co/THUDM/CogVideoX1.5-5B-SAT). -- 🔥 **News**: ```2024/10/13```: A more cost-effective fine-tuning framework for `CogVideoX-5B` that works with a single - 4090 GPU, [cogvideox-factory](https://github.com/a-r-r-o-w/cogvideox-factory), has been released. It supports - fine-tuning with multiple resolutions. Feel free to use it! -- 🔥 **News**: ```2024/10/10```: We have updated our technical report. Please - click [here](https://arxiv.org/pdf/2408.06072) to view it. More training details and a demo have been added. To see - the demo, click [here](https://yzy-thu.github.io/CogVideoX-demo/).- 🔥 **News**: ```2024/10/09```: We have publicly - released the [technical documentation](https://zhipu-ai.feishu.cn/wiki/DHCjw1TrJiTyeukfc9RceoSRnCh) for CogVideoX - fine-tuning on Feishu, further increasing distribution flexibility. All examples in the public documentation can be - fully reproduced. -- 🔥 **News**: ```2024/9/19```: We have open-sourced the CogVideoX series image-to-video model **CogVideoX-5B-I2V**. - This model can take an image as a background input and generate a video combined with prompt words, offering greater - controllability. With this, the CogVideoX series models now support three tasks: text-to-video generation, video - continuation, and image-to-video generation. Welcome to try it online - at [Experience](https://huggingface.co/spaces/THUDM/CogVideoX-5B-Space). -- 🔥 ```2024/9/19```: The Caption - model [CogVLM2-Caption](https://huggingface.co/THUDM/cogvlm2-llama3-caption), used in the training process of - CogVideoX to convert video data into text descriptions, has been open-sourced. Welcome to download and use it. -- 🔥 ```2024/8/27```: We have open-sourced a larger model in the CogVideoX series, **CogVideoX-5B**. We have - significantly optimized the model's inference performance, greatly lowering the inference threshold. - You can run **CogVideoX-2B** on older GPUs like `GTX 1080TI`, and **CogVideoX-5B** on desktop GPUs like `RTX 3060`. Please strictly - follow the [requirements](requirements.txt) to update and install dependencies, and refer - to [cli_demo](inference/cli_demo.py) for inference code. Additionally, the open-source license for - the **CogVideoX-2B** model has been changed to the **Apache 2.0 License**. -- 🔥 ```2024/8/6```: We have open-sourced **3D Causal VAE**, used for **CogVideoX-2B**, which can reconstruct videos with - almost no loss. -- 🔥 ```2024/8/6```: We have open-sourced the first model of the CogVideoX series video generation models, **CogVideoX-2B - **. -- 🌱 **Source**: ```2022/5/19```: We have open-sourced the CogVideo video generation model (now you can see it in - the `CogVideo` branch). This is the first open-source large Transformer-based text-to-video generation model. You can - access the [ICLR'23 paper](https://arxiv.org/abs/2205.15868) for technical details. +- 🔥🔥 **News**: ```2025/03/24```: 我们推出了 [CogKit](https://github.com/THUDM/CogKit) 工具,这是一个微调**CogView4**, **CogVideoX** 系列的微调和推理框架,一个工具包,玩转我们的多模态生成模型。 +- 🔥 **News**: ```2025/02/28```: DDIM Inverse 已经在`CogVideoX-5B` 和 `CogVideoX1.5 -5B` 支持,查看 [here](inference/ddim_inversion.py). +- 🔥 **News**: ```2025/01/08```: 我们更新了基于`diffusers`版本模型的`Lora`微调代码,占用显存更低,详情请见[这里](finetune/README_zh.md)。 +- 🔥 **News**: ```2024/11/15```: 我们发布 `CogVideoX1.5` 模型的diffusers版本,仅需调整部分参数即可沿用之前的代码。 +- 🔥 **News**: ```2024/11/08```: 我们发布 `CogVideoX1.5` 模型。CogVideoX1.5 是 CogVideoX 开源模型的升级版本。 +CogVideoX1.5-5B 系列模型支持 **10秒** 长度的视频和更高的分辨率,其中 `CogVideoX1.5-5B-I2V` 支持 **任意分辨率** 的视频生成,SAT代码已经更新。`diffusers`版本还在适配中。SAT版本代码前往 [这里](https://huggingface.co/THUDM/CogVideoX1.5-5B-SAT) 下载。 +- 🔥**News**: ```2024/10/13```: 成本更低,单卡4090可微调 `CogVideoX-5B` + 的微调框架[cogvideox-factory](https://github.com/a-r-r-o-w/cogvideox-factory)已经推出,多种分辨率微调,欢迎使用。 +- 🔥 **News**: ```2024/10/10```: 我们更新了我们的技术报告,请点击 [这里](https://arxiv.org/pdf/2408.06072) + 查看,附上了更多的训练细节和demo,关于demo,点击[这里](https://yzy-thu.github.io/CogVideoX-demo/) 查看。 +- 🔥 **News**: ```2024/10/09```: 我们在飞书[技术文档](https://zhipu-ai.feishu.cn/wiki/DHCjw1TrJiTyeukfc9RceoSRnCh") + 公开CogVideoX微调指导,以进一步增加分发自由度,公开文档中所有示例可以完全复现 +- 🔥 **News**: ```2024/9/19```: 我们开源 CogVideoX 系列图生视频模型 **CogVideoX-5B-I2V** + 。该模型可以将一张图像作为背景输入,结合提示词一起生成视频,具有更强的可控性。 + 至此,CogVideoX系列模型已经支持文本生成视频,视频续写,图片生成视频三种任务。欢迎前往在线[体验](https://huggingface.co/spaces/THUDM/CogVideoX-5B-Space)。 +- 🔥 **News**: ```2024/9/19```: CogVideoX 训练过程中用于将视频数据转换为文本描述的 Caption + 模型 [CogVLM2-Caption](https://huggingface.co/THUDM/cogvlm2-llama3-caption) + 已经开源。欢迎前往下载并使用。 +- 🔥 ```2024/8/27```: 我们开源 CogVideoX 系列更大的模型 **CogVideoX-5B** + 。我们大幅度优化了模型的推理性能,推理门槛大幅降低,您可以在 `GTX 1080TI` 等早期显卡运行 **CogVideoX-2B**,在 `RTX 3060` + 等桌面端甜品卡运行 **CogVideoX-5B** 模型。 请严格按照[要求](requirements.txt) + 更新安装依赖,推理代码请查看 [cli_demo](inference/cli_demo.py)。同时,**CogVideoX-2B** 模型开源协议已经修改为**Apache 2.0 协议**。 +- 🔥 ```2024/8/6```: 我们开源 **3D Causal VAE**,用于 **CogVideoX-2B**,可以几乎无损地重构视频。 +- 🔥 ```2024/8/6```: 我们开源 CogVideoX 系列视频生成模型的第一个模型, **CogVideoX-2B**。 +- 🌱 **Source**: ```2022/5/19```: 我们开源了 CogVideo 视频生成模型(现在你可以在 `CogVideo` 分支中看到),这是首个开源的基于 + Transformer 的大型文本生成视频模型,您可以访问 [ICLR'23 论文](https://arxiv.org/abs/2205.15868) 查看技术细节。 -## Table of Contents +## 目录 -Jump to a specific section: +跳转到指定部分: -- [Quick Start](#quick-start) - - [Prompt Optimization](#prompt-optimization) +- [快速开始](#快速开始) + - [提示词优化](#提示词优化) - [SAT](#sat) - [Diffusers](#diffusers) -- [Gallery](#gallery) +- [视频作品](#视频作品) - [CogVideoX-5B](#cogvideox-5b) - [CogVideoX-2B](#cogvideox-2b) -- [Model Introduction](#model-introduction) -- [Friendly Links](#friendly-links) -- [Project Structure](#project-structure) - - [Quick Start with Colab](#quick-start-with-colab) - - [Inference](#inference) +- [模型介绍](#模型介绍) +- [友情链接](#友情链接) +- [完整项目代码结构](#完整项目代码结构) + - [Colab 快速使用](#colab-快速使用) + - [inference](#inference) - [finetune](#finetune) - [sat](#sat-1) - - [Tools](#tools) + - [tools](#tools) - [CogVideo(ICLR'23)](#cogvideoiclr23) -- [Citation](#citation) -- [Model-License](#model-license) +- [引用](#引用) +- [模型协议](#模型协议) -## Quick Start +## 快速开始 -### Prompt Optimization +### 提示词优化 -Before running the model, please refer to [this guide](inference/convert_demo.py) to see how we use large models like -GLM-4 (or other comparable products, such as GPT-4) to optimize the model. This is crucial because the model is trained -with long prompts, and a good prompt directly impacts the quality of the video generation. +在开始运行模型之前,请参考 [这里](inference/convert_demo.py) 查看我们是怎么使用GLM-4(或者同级别的其他产品,例如GPT-4) +大模型对模型进行优化的,这很重要, +由于模型是在长提示词下训练的,一个好的提示词直接影响了视频生成的质量。 ### SAT -**Please make sure your Python version is between 3.10 and 3.12, inclusive of both 3.10 and 3.12.** - -Follow instructions in [sat_demo](sat/README.md): Contains the inference code and fine-tuning code of SAT weights. It is -recommended to improve based on the CogVideoX model structure. Innovative researchers use this code to better perform -rapid stacking and development. +查看sat文件夹下的 [sat_demo](sat/README.md):包含了 SAT 权重的推理代码和微调代码,推荐基于此代码进行 CogVideoX +模型结构的改进,研究者使用该代码可以更好的进行快速的迭代和开发。 ### Diffusers -**Please make sure your Python version is between 3.10 and 3.12, inclusive of both 3.10 and 3.12.** - ``` pip install -r requirements.txt ``` -Then follow [diffusers_demo](inference/cli_demo.py): A more detailed explanation of the inference code, mentioning the -significance of common parameters. +查看[diffusers_demo](inference/cli_demo.py):包含对推理代码更详细的解释,包括各种关键的参数。 -For more details on quantized inference, please refer -to [diffusers-torchao](https://github.com/sayakpaul/diffusers-torchao/). With Diffusers and TorchAO, quantized inference -is also possible leading to memory-efficient inference as well as speedup in some cases when compiled. A full list of -memory and time benchmarks with various settings on A100 and H100 has been published -at [diffusers-torchao](https://github.com/sayakpaul/diffusers-torchao). +欲了解更多关于量化推理的细节,请参考 [diffusers-torchao](https://github.com/sayakpaul/diffusers-torchao/)。使用 Diffusers +和 TorchAO,量化推理也是可能的,这可以实现内存高效的推理,并且在某些情况下编译后速度有所提升。有关在 A100 和 H100 +上使用各种设置的内存和时间基准测试的完整列表,已发布在 [diffusers-torchao](https://github.com/sayakpaul/diffusers-torchao) +上。 -## Gallery +## 视频作品 ### CogVideoX-5B @@ -170,94 +158,94 @@ at [diffusers-torchao](https://github.com/sayakpaul/diffusers-torchao). -To view the corresponding prompt words for the gallery, please click [here](resources/galary_prompt.md) -## Model Introduction +查看画廊的对应提示词,请点击[这里](resources/galary_prompt.md) -CogVideoX is an open-source version of the video generation model originating -from [QingYing](https://chatglm.cn/video?lang=en?fr=osm_cogvideo). The table below displays the list of video generation -models we currently offer, along with their foundational information. +## 模型介绍 -| Model Name | -CogVideoX1.5-5B (Latest) | -CogVideoX1.5-5B-I2V (Latest) | +模型名 | +CogVideoX1.5-5B (最新) | +CogVideoX1.5-5B-I2V (最新) | CogVideoX-2B | CogVideoX-5B | -CogVideoX-5B-I2V | +CogVideoX-5B-I2V | ||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Release Date | -November 8, 2024 | -November 8, 2024 | -August 6, 2024 | -August 27, 2024 | -September 19, 2024 | +发布时间 | +2024年11月8日 | +2024年11月8日 | +2024年8月6日 | +2024年8月27日 | +2024年9月19日 |
| Video Resolution | +视频分辨率 | 1360 * 768 | Min(W, H) = 768 768 ≤ Max(W, H) ≤ 1360 Max(W, H) % 16 = 0 |
720 * 480 | |||||||
| Number of Frames | -Should be 16N + 1 where N <= 10 (default 81) | -Should be 8N + 1 where N <= 6 (default 49) | +帧数 | +必须为 16N + 1 其中 N <= 10 (默认 81) | +必须为 8N + 1 其中 N <= 6 (默认 49) | ||||||
| Inference Precision | -BF16 (Recommended), FP16, FP32, FP8*, INT8, Not supported: INT4 | -FP16*(Recommended), BF16, FP32, FP8*, INT8, Not supported: INT4 | -BF16 (Recommended), FP16, FP32, FP8*, INT8, Not supported: INT4 | +推理精度 | +BF16(推荐), FP16, FP32,FP8*,INT8,不支持INT4 | +FP16*(推荐), BF16, FP32,FP8*,INT8,不支持INT4 | +BF16(推荐), FP16, FP32,FP8*,INT8,不支持INT4 | ||||
| Single GPU Memory Usage |
- SAT BF16: 76GB diffusers BF16: from 10GB* diffusers INT8(torchao): from 7GB* |
- SAT FP16: 18GB diffusers FP16: 4GB minimum* diffusers INT8 (torchao): 3.6GB minimum* |
- SAT BF16: 26GB diffusers BF16 : 5GB minimum* diffusers INT8 (torchao): 4.4GB minimum* |
+ 单GPU显存消耗 |
+ SAT BF16: 76GB diffusers BF16 : 10GB起* diffusers INT8(torchao): 7G起* |
+ SAT FP16: 18GB diffusers FP16: 4GB起* diffusers INT8(torchao): 3.6G起* |
+ SAT BF16: 26GB diffusers BF16 : 5GB起* diffusers INT8(torchao): 4.4G起* |
||||
| Multi-GPU Memory Usage | +多GPU推理显存消耗 | BF16: 24GB* using diffusers |
FP16: 10GB* using diffusers |
BF16: 15GB* using diffusers |
|||||||
| Inference Speed (Step = 50, FP/BF16) |
- Single A100: ~1000 seconds (5-second video) Single H100: ~550 seconds (5-second video) |
- Single A100: ~90 seconds Single H100: ~45 seconds |
- Single A100: ~180 seconds Single H100: ~90 seconds |
+ 推理速度 (Step = 50, FP/BF16) |
+ 单卡A100: ~1000秒(5秒视频) 单卡H100: ~550秒(5秒视频) |
+ 单卡A100: ~90秒 单卡H100: ~45秒 |
+ 单卡A100: ~180秒 单卡H100: ~90秒 |
||||
| Prompt Language | +提示词语言 | English* | |||||||||
| Prompt Token Limit | +提示词长度上限 | 224 Tokens | 226 Tokens | ||||||||
| Video Length | -5 seconds or 10 seconds | -6 seconds | +视频长度 | +5 秒 或 10 秒 | +6 秒 | ||||||
| Frame Rate | -16 frames / second | -8 frames / second | +帧率 | +16 帧 / 秒 | +8 帧 / 秒 | ||||||
| Position Encoding | +位置编码 | 3d_rope_pos_embed | 3d_sincos_pos_embed | 3d_rope_pos_embed | 3d_rope_pos_embed + learnable_pos_embed | ||||||
| Download Link (Diffusers) | +下载链接 (Diffusers) | 🤗 HuggingFace 🤖 ModelScope 🟣 WiseModel |
🤗 HuggingFace 🤖 ModelScope 🟣 WiseModel |
🤗 HuggingFace 🤖 ModelScope 🟣 WiseModel |
@@ -265,19 +253,17 @@ models we currently offer, along with their foundational information.
🤗 HuggingFace 🤖 ModelScope 🟣 WiseModel |
||||||
| Download Link (SAT) | +下载链接 (SAT) | 🤗 HuggingFace 🤖 ModelScope 🟣 WiseModel |
SAT | ||||||||