Model reference · open weights

CogVideoX

Video zai-org Text→video 2 builds Open weights 20k dl/mo

CogVideoX is an open-weight video model from zai-org. CogVideoX-2b (FP16) weighs 13.8 GB; the smallest configuration that runs it is RTX 3060 12 GB.

  • CogVideoX is a text-to-video generation model developed by zai-org, published as zai-org/CogVideoX-2b.
  • It features 1.7B parameters and supports English input.
  • The model is released under the Apache 2.0 license.

Summary of the zai-org/CogVideoX-2b model card, 2026-10-01

What it is

Released byzai-org
Released2024-08-05
Parameters1.7B
VRAM13.8 GB for the weights

What it runs on

Memory and cards for CogVideoX-2b (FP16)

13.8 GBweights, file size
9.5 GBbiggest part
537 MBruntime overhead
CardWeightsMemory
RTX 3060 12 GBtight (encoders offloaded)11.6 GB
RTX 4060 Ti 16 GBtight15.4 GB
RTX 3090 24 GBfits23.4 GB
RTX 4090 24 GBfits23.4 GB
RTX 5090 32 GBfits31.0 GB
L40S 48 GBfits44.0 GB
A100 80 GBfits78.2 GB
H100 80 GBfits78.1 GB
RTX PRO 6000 Blackwell 96 GBfits93.8 GB
DGX Spark (GB10) 128 GB unifiedfits107 GB
H200 141 GBfits138 GB
B200 180 GBfits176 GB

Builds

Sizes, precisions & builds

BuildParamsPrecisionWeightsSmallest setup
CogVideoX-2b (above) ↗ 1.7BFP16 13.8 GBRTX 3060 12 GB
CogVideoX-5b ↗ 5.6BBF16 21.5 GBRTX 4060 Ti 16 GB

From the model card

What zai-org says about CogVideoX

Read the model card

📍 Visit QingYing and API Platform to experience commercial video generation models.

Demo Show

    .video-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-around;
    }
    .video-item {
        width: 45%;
        margin-bottom: 20px;
        transition: transform 0.3s;
    }
    .video-item:hover {
        transform: scale(1.1);
    }
    .caption {
        text-align: center;
        margin-top: 10px;
        font-size: 11px;
    }

Model Introduction

CogVideoX is an open-source version of the video generation model originating from QingYing. The table below displays the list of video generation models we currently offer, along with their foundational information.

Data Explanation

  • When testing using the diffusers library, all optimizations provided by the diffusers library 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 the optimizations are disabled, VRAM usage will increase significantly, with peak VRAM usage being about 3 times higher than the table shows. However, speed will increase by 3-4 times. You can selectively disable some optimizations, including:
pipe.enable_model_cpu_offload()
pipe.enable_sequential_cpu_offload()
pipe.vae.enable_slicing()
pipe.vae.enable_tiling()
  • When performing multi-GPU inference, the enable_model_cpu_offload() optimization needs to be disabled.
  • Using INT8 models will reduce inference speed. This is to ensure that GPUs with lower VRAM can perform inference normally while maintaining minimal video quality loss, though inference speed will decrease significantly.
  • The 2B model is trained with FP16 precision, and the 5B model is trained with BF16 precision. We recommend using the precision the model was trained with for inference.
  • PytorchAO and Optimum-quanto can be used to quantize the text encoder, Transformer, and VAE modules to reduce CogVideoX's memory requirements. This makes it possible to run the model on a free T4 Colab or GPUs with smaller VRAM! It is also worth noting that TorchAO quantization is fully compatible with torch.compile, which can significantly improve inference speed. FP8 precision must be used on devices with NVIDIA H100 or above, which requires installing the torch, torchao, diffusers, and accelerate Python packages from source. CUDA 12.4 is recommended.
  • The inference speed test also used the above VRAM optimization scheme. Without VRAM optimization, inference speed increases by about 10%. Only the diffusers version of the model supports quantization.
  • The model only supports English input; other languages can be translated into English during refinement by a large model.

Note

  • Using SAT for inference and fine-tuning of SAT version models. Feel free to visit our GitHub for more information.

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.

  1. Install the required dependencies
# diffusers>=0.30.1
# transformers>=0.44.0
# accelerate>=0.33.0 (suggest install from source)
# imageio-ffmpeg>=0.5.1
pip install --upgrade transformers accelerate diffusers imageio-ffmpeg
  1. Run the code
import torch
from diffusers import CogVideoXPipeline
from diffusers.utils import export_to_video

prompt = "A panda, dressed in a small, red jacket and a tiny hat, sits on a wooden stool in a serene bamboo forest. The panda's fluffy paws strum a miniature acoustic guitar, producing soft, melodic tunes. Nearby, a few other pandas gather, watching curiously and some clapping in rhythm. Sunlight filters through the tall bamboo, casting a gentle glow on the scene. The panda's face is expressive, showing concentration and joy as it plays. The background includes a small, flowing stream and vibrant green foliage, enhancing the peaceful and magical atmosphere of this unique musical performance."

pipe = CogVideoXPipeline.from_pretrained(
    "THUDM/CogVideoX-2b",
    torch_dtype=torch.float16
)

pipe.enable_model_cpu_offload()
pipe.enable_sequential_cpu_offload()
pipe.vae.enable_slicing()
pipe.vae.enable_tiling()
video = pipe(
    prompt=prompt,
    num_videos_per_prompt=1,
    num_inference_steps=50,
    num_frames=49,
    guidance_scale=6,
    generator=torch.Generator(device="cuda").manual_seed(42),
).frames[0]

export_to_video(video, "output.mp4", fps=8)

Quantized Inference

PytorchAO and Optimum-quanto can be used to quantize the Text Encoder, Transformer and VAE modules to lower the memory requirement of CogVideoX. This makes it possible to run the model on free-tier T4 Colab or smaller VRAM GPUs as well! It is also worth noting that TorchAO quantization is fully compatible with torch.compile, which allows for much faster inference speed.

# To get started, PytorchAO needs to be installed from the GitHub source and PyTorch Nightly.
# Source and nightly installation is only required until next release.

import torch
from diffusers import AutoencoderKLCogVideoX, CogVideoXTransformer3DModel, CogVideoXPipeline
from diffusers.utils import export_to_video
+ from transformers import T5EncoderModel
+ from torchao.quantization import quantize_, int8_weight_only, int8_dynamic_activation_int8_weight

+ quantization = int8_w

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

Running it yourself

Run it on a rented GPU

Rent a machine by the hour. Runs as it is with diffusers, on the machine, in Python.

# on your rented machine: pip install diffusers transformers accelerate ftfy
import torch
from diffusers import DiffusionPipeline
from diffusers.utils import export_to_video

pipe = DiffusionPipeline.from_pretrained("zai-org/CogVideoX-2b", torch_dtype=torch.bfloat16).to("cuda")
frames = pipe(prompt="a drone shot over a forest at sunrise").frames[0]
export_to_video(frames, "/workspace/out.mp4", fps=16)
Renting a GPU: connect, tunnels, Python
© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms