license: other
license_name: cogvideox
license_link: https://huggingface.co/THUDM/CogVideoX-2b/blob/main/LICENSE
language:
- en
tags:
- cogvideox
- video-generation
- thudm
inference: false
CogVideoX-2B
📄 中文阅读 | 🌐 Github | 📜 arxiv (coming soon)
Demo Show
Model Introduction
CogVideoX is an open-source video generation model that shares the same origins as 清影. The table below provides a list of the video generation models we currently offer, along with their basic information.
Model Name | CogVideoX-2B (Current Repos) |
---|---|
Supported Prompt Language | English |
GPU Memory Required for Inference | 21.6GB |
GPU Memory Required for Fine-tuning (bs=1) | 46.2GB |
Prompt Length | 226 Tokens |
Video Length | 6 seconds |
Frames Per Second | 8 frames |
Resolution | 720 * 480 |
Positional Embeddings | Sinusoidal |
Quantized Inference | Not Supported |
Multi-card Inference | Not Supported |
Quick Start 🤗
This model supports deployment using the huggingface diffusers library. You can deploy it by following these steps.
We recommend that you visit our GitHub and check out the relevant prompt optimizations and conversions to get a better experience.
- Install the required dependencies
pip install --upgrade opencv-python transformers
pip install git+https://github.com/huggingface/diffusers.git@32da2e7673cfe0475a47c41b859f5fbd8bf17a40#egg=diffusers # Still in PR
- Run the code
import torch
from diffusers import CogVideoXPipeline
from diffusers.utils import export_to_video
prompt = "A girl ridding a bike"
pipe = CogVideoXPipeline.from_pretrained(
"THUDM/CogVideoX-2b",
torch_dtype=torch.float16
).to("cuda")
prompt_embeds, _ = pipe.encode_prompt(
prompt=prompt,
do_classifier_free_guidance=True,
num_videos_per_prompt=1,
max_sequence_length=226,
device="cuda",
dtype=torch.float16,
)
video = pipe(
num_inference_steps=50,
guidance_scale=6,
prompt_embeds=prompt_embeds,
).frames[0]
export_to_video(video, "output.mp4", fps=8)
If the generated model appears “all green” and not viewable in the default MAC player, it is a normal phenomenon (due to OpenCV saving video issues). Simply use a different player to view the video.
Explore the Model
Welcome to our github, where you will find:
- More detailed technical details and code explanation.
- Optimization and conversion of prompt words.
- Reasoning and fine-tuning of SAT version models, and even pre-release.
- Project update log dynamics, more interactive opportunities.
- CogVideoX toolchain to help you better use the model.
Model License
This model is released under the CogVideoX LICENSE.
Citation
The technical report is still being written, stay tuned.