Text-to-video model
CogVideoX local deployment: 4GB to 33GB — do the VRAM maths before you rent
CogVideoX-2B squeezes under 4GB with sequential offload. CogVideoX1.5-5B peaks at 33GB with nothing enabled. That eightfold spread is the whole decision between a $0.193 RTX 3090 and a $0.824 A100 80GB.
CogVideoX · self-hosted
CogVideoX is Zhipu's (Z.ai, originally Tsinghua's THUDM) open-weight diffusion-transformer text-to-video family, described in arXiv 2408.06072. Three pieces do the work: a 3D causal VAE that shortens the video sequence and suppresses inter-frame flicker, an expert transformer with adaptive LayerNorm that aligns text to picture, and 3D full attention that captures motion over time. The text encoder is T5-XXL, which is a large and unavoidable share of the memory bill. Five open checkpoints exist: CogVideoX-2B, CogVideoX-5B, CogVideoX-5B-I2V, CogVideoX1.5-5B and CogVideoX1.5-5B-I2V. The Hugging Face org has moved from THUDM to zai-org and the GitHub repo is now zai-org/CogVideo; old paths redirect, so both spellings resolve to the same weights.
Something to know up front: the open-weight line stops at CogVideoX1.5. It shipped 2024-11-08 with the diffusers conversion on 11-15, and the last major repo event was CogKit, the unified fine-tuning and inference framework for CogView4 and CogVideoX, on 2025-03-24. Everything after that — CogVideoX-2, CogVideoX-3 — is API-only; CogVideoX-3 on docs.z.ai goes up to 3840×2160 at 30 or 60fps for $0.2 a video, with no weights released. So "CogVideoX local deployment" today means CogVideoX1.5-5B: 1360×768, 16N+1 frames (N≤10, default 81), 16fps, 5 or 10 seconds. Its value is downloadable, LoRA-able, fully offline weights — not a leaderboard win.
This is the worst possible model to buy a card for on spec. The memory curve is steep, and the official diffusers table is blunt about it: ~33GB with nothing enabled, 19GB with enable_model_cpu_offload, 11GB once you add VAE tiling, and under 4GB with enable_sequential_cpu_offload at a speed the docs themselves call very slow. Run 1.5-5B from the native SAT weights instead and you need 76GB. Time is just as punishing: 50 steps for a 5-second clip is roughly 1000 seconds on an A100 and 550 on an H100, so every iteration costs you a quarter of an hour. Per-second rental turns both facts into a controllable line item: tune on a cheap 24GB card, batch-render on an 80GB one, stop the instance when you are done.
01 —
Five open checkpoints — pick the wrong tier and you OOM
Every VRAM figure here comes from the official model cards and the diffusers memory table, not from estimation.
| Version | Parameters | VRAM | Context | Notes |
|---|---|---|---|---|
| CogVideoX-2B | 2B (trained in fp16) | SAT 18GB / diffusers from 4GB / INT8 from 3.6GB | 226-token prompt | 720×480 · 8N+1 frames (N≤6, max 49) · 8fps · 6s | The only Apache 2.0 checkpoint in the family, so commercial use carries no extra paperwork. Weakest output of the five, but the cheapest way to sweep prompts and validate a pipeline: ~90s for 50 steps on an A100, ~45s on an H100. |
| CogVideoX-5B | Marketed as 5B (HF card counts 6B) | SAT 26GB / diffusers from 5GB / INT8 from 4.4GB / multi-GPU bf16 15GB | 226-token prompt | 720×480 · max 49 frames · 8fps · 6s | bf16 is the recommended precision and position encoding moves to 3d_rope_pos_embed. ~180s for 50 steps on an A100, ~90s on an H100 — the quality/speed sweet spot. Note the licence is the custom CogVideoX LICENSE, not Apache. |
| CogVideoX-5B-I2V | Marketed as 5B | SAT 26GB / diffusers from 5GB / INT8 from 4.4GB | 226-token prompt | 720×480 · max 49 frames · 8fps · 6s | The image-to-video branch. Position encoding is 3d_rope plus a learnable component, so these weights are not interchangeable with the T2V checkpoint. This is the one for first-frame-driven shots and turning product stills into motion. |
| CogVideoX1.5-5B | Marketed as 5B (HF card counts 6B) | SAT 76GB / diffusers from 10GB / INT8 from 7GB / ~33GB peak unoptimised / 19GB with model_cpu_offload / 11GB with VAE tiling on top | 224-token prompt | 1360×768 · 16N+1 frames (N≤10, default 81) · 16fps · 5 or 10s | The highest tier you can actually self-host. The T2V checkpoint was pretrained at 1360×768 and degrades visibly away from it; the docs recommend 81 or 161 frames exported at 16fps. Requires diffusers 0.32 or newer — older versions throw a transformer config mismatch. |
| CogVideoX1.5-5B-I2V | Marketed as 5B | Same as 1.5-5B: from 10GB, INT8 from 7GB, 19GB / 11GB with offload | 224-token prompt | height fixed at 768, width 768–1360 and divisible by 16 · default 81 frames · 16fps · up to 10s | The only open checkpoint that produces 10-second 1360×768 image-to-video. Its size rules are stricter than T2V: height must be 768 and both dimensions divisible by 16, so a casual 1280×720 request errors out. |
02 —
Four ways to run it, four cards
Match the card to what you are actually doing — don't default to 80GB just to feel safe.
INT8 quantised with VAE tiling, getting 2B/5B working and dialling in prompt templates
RTX 3090 24GB$0.193/GPU-hr
INT8 5B occupies just 4.4GB and 1.5-5B starts at 7GB, so 24GB is generous. Ampere gives you native bf16, and this is the cheapest 24GB card on the network — your entire experimentation phase costs pennies per hour.
Day-to-day CogVideoX1.5-5B rendering: bf16 with enable_model_cpu_offload (19GB)
RTX 4090 24GB$0.540/GPU-hr
24GB catches the 19GB offload peak exactly, and adding VAE tiling drops it to 11GB with room to spare. Ada also unlocks fp8 fast mode and SageAttention (roughly 20–30% faster on Linux), neither of which a 3090 can use.
No offload at all, everything resident, torch.compile, batch-rendering 1360×768×81 frames
A100 PCIE 80GB$0.824/GPU-hr
The 33GB peak stays in VRAM with no paging, which is the only way to match the published benchmark. Diffusers measured 76.27s compiled versus 96.89s uncompiled on an 80GB A100 — about a fifth off, for free.
Full fine-tuning of CogVideoX-5B (finetrainers measured 53GB)
A100 SXM4 80GB$1.088/GPU-hr
LoRA needs only 18GB and fits a 4090; full fine-tuning at 53GB fits nothing under 80GB. When you scale out, SXM4's NVLink beats PCIE — NexGPU nodes go up to 14 GPUs and 2,152GB of VRAM in a single box.
03 —
Four steps to your first clip
From cold instance to output.mp4, with the traps written into each step.
- 01
Start the instance, install the right diffusers
Pick a PyTorch or ComfyUI image from NexGPU's 2,000+ prebuilt images and get in over SSH, Jupyter or the web terminal. CogVideoX1.5 needs diffusers 0.32 or newer — anything older fails loading the transformer with a config mismatch, which is the single most common first-run failure. Don't skip imageio-ffmpeg; export_to_video depends on it to write the file.
pip install -U "diffusers>=0.32.0" transformers accelerate sentencepiece imageio-ffmpeg - 02
Pull the weights — don't mix SAT and diffusers versions
Budget roughly 30GB for weights plus cache. The THUDM/ path on Hugging Face redirects to zai-org/, so both spellings fetch the same files. What matters is that the repo hosts both native SAT weights and diffusers weights, and they are not interchangeable: SAT 1.5-5B wants 76GB of VRAM, while the diffusers conversion is the one that starts at 10GB.
hf download zai-org/CogVideoX1.5-5B --local-dir ./CogVideoX1.5-5B - 03
The three lines that make 24GB work
These take the peak from 33GB down to 11GB: model-level offload gets you to 19GB, VAE tiling and slicing take it the rest of the way. Do not casually swap in enable_sequential_cpu_offload — it genuinely lands under 4GB, but it shuttles weights between CPU and GPU on every step and the docs flag the speed as very slow; a single clip can stretch past an hour. If you want to go lower without that penalty, use torchao's Int8WeightOnlyConfig with group offloading: quantised 5B lands around 16GB and stays fully compatible with torch.compile.
pipe.enable_model_cpu_offload(); pipe.vae.enable_tiling(); pipe.vae.enable_slicing() - 04
Render — or switch to a ComfyUI graph
The official cli_demo.py defaults to 81 frames, 16fps, 50 steps, guidance_scale 6.0 and CogVideoXDPMScheduler with trailing timestep spacing. Prompts are English only, capped at 224 tokens (226 on the older checkpoints), and a one-line prompt reliably produces mush — the official demo path is to expand your intent into a shot-level English description with GLM first. For a node graph instead, use a ComfyUI image with ComfyUI-CogVideoXWrapper: it supports fp8 fast, GGUF and torchao quantisation, plus the ecosystem branches like CogVideoX-Fun 1.1 pose control, Tora trajectory control and DimensionX LoRAs. Note its update 8 was a breaking change, so old workflows need reworking.
python inference/cli_demo.py --prompt "A panda in a red jacket plays an acoustic guitar in a misty bamboo forest, cinematic lighting" --model_path zai-org/CogVideoX1.5-5B --generate_type t2v
What a real batch actually costs
Phase one, tuning, on an RTX 3090 24GB at $0.193/GPU-hr: INT8 5B occupies 4.4GB, and two hours is enough to try two or three dozen variants of prompt template, guidance_scale and step count — $0.193 × 2 = $0.386. Phase two, batch rendering, on an A100 PCIE 80GB at $0.824/GPU-hr: CogVideoX1.5-5B at 50 steps, 81 frames, 1360×768 is measured at roughly 1000 seconds per clip on an A100, and the diffusers torch.compile result of 76.27s versus 96.89s is about a 21% saving, so call it 790 seconds per clip. That is about 4.5 clips an hour, or $0.824 ÷ 4.5 ≈ $0.18 of GPU per clip. For a 200-clip batch: 200 × 790 ÷ 3600 ≈ 43.9 hours, and 43.9 × $0.824 ≈ $36.2. Weights plus outputs run about 30GB, so storage at the $0.414/GB-month median is roughly $12.4/month, and downloading 200 finished clips at ~5MB each is 1GB of egress × $0.0081/GB ≈ one cent. For comparison, the official CogVideoX-3 API charges $0.2 per video — self-hosting undercuts it on unit price, and the weights, the data and the LoRAs stay yours. Compute is metered per second and stops the moment the instance stops; storage keeps billing until you destroy the volume, so clean up after a batch.
04 —
FAQ
How much VRAM does CogVideoX need? Will it run on a 24GB 4090?
What changed between CogVideoX and CogVideoX1.5, and which should I deploy?
Does CogVideoX accept Chinese prompts?
Is CogVideoX still being updated, or is deploying it now a dead end?
Can I use CogVideoX commercially? How does the licence work?
How much VRAM does fine-tuning CogVideoX take? What's the gap between LoRA and full?
Start building on NexGPU
Enterprise R&D team or solo developer — either way, your first job can be running in minutes.
Sign up to browse live network pricing. No payment method required.
