Skip to main content

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 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.

VersionParametersVRAMContextNotes
CogVideoX-2B2B (trained in fp16)SAT 18GB / diffusers from 4GB / INT8 from 3.6GB226-token prompt | 720×480 · 8N+1 frames (N≤6, max 49) · 8fps · 6sThe 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-5BMarketed as 5B (HF card counts 6B)SAT 26GB / diffusers from 5GB / INT8 from 4.4GB / multi-GPU bf16 15GB226-token prompt | 720×480 · max 49 frames · 8fps · 6sbf16 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-I2VMarketed as 5BSAT 26GB / diffusers from 5GB / INT8 from 4.4GB226-token prompt | 720×480 · max 49 frames · 8fps · 6sThe 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-5BMarketed 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 top224-token prompt | 1360×768 · 16N+1 frames (N≤10, default 81) · 16fps · 5 or 10sThe 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-I2VMarketed as 5BSame as 1.5-5B: from 10GB, INT8 from 7GB, 19GB / 11GB with offload224-token prompt | height fixed at 768, width 768–1360 and divisible by 16 · default 81 frames · 16fps · up to 10sThe 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.

  1. 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
  2. 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
  3. 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()
  4. 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?

Tier by tier: CogVideoX-2B runs from 4GB via diffusers and 3.6GB in INT8; CogVideoX-5B from 5GB, 4.4GB in INT8, ~15GB for bf16 multi-GPU; CogVideoX1.5-5B from 10GB, 7GB in INT8, with a ~33GB unoptimised peak that drops to 19GB with enable_model_cpu_offload and 11GB once VAE tiling is on. So yes — a 24GB 4090 handles 1.5-5B comfortably as long as offload is enabled. On NexGPU that is an RTX 4090 24GB at $0.540/GPU-hr, or an RTX 3090 24GB at just $0.193/GPU-hr, billed per second. If you still OOM, moving to a 32GB RTX 5090 ($0.723) or a 48GB RTX A6000 ($0.817) is one instance restart away.

What changed between CogVideoX and CogVideoX1.5, and which should I deploy?

1.5 raises resolution from 720×480 to 1360×768, changes the frame rule from 8N+1 (N≤6, max 49) to 16N+1 (N≤10, default 81), doubles frame rate from 8fps to 16fps, replaces the fixed 6-second clip with 5 or 10 seconds, standardises position encoding on 3d_rope_pos_embed, and nudges the prompt cap from 226 to 224 tokens. The cost is time: at the same 50 steps, 5B takes ~180s on an A100 while 1.5-5B takes ~1000s — more than 5× slower. Use 1.5-5B for finished shots and 2B or 5B for fast prompt sweeps. On NexGPU those map to an A100 PCIE 80GB at $0.824/GPU-hr and an RTX 3090 24GB at $0.193/GPU-hr, and switching between them mid-project is the cheapest way to work.

Does CogVideoX accept Chinese prompts?

No. All five open checkpoints use a T5-XXL text encoder and every model card lists the prompt language as English, capped at 224 or 226 tokens; feeding Chinese degrades output noticeably. The official demo approach is to expand your intent into a shot-level English description with GLM first — that is exactly what convert_demo.py in the repo does — and long, specific prompts beat one-liners by a wide margin. Practically, you can run a small language model for prompt rewriting alongside CogVideoX itself on the same NexGPU instance: nodes go up to 14 GPUs and 2,152GB of VRAM, so the whole chain fits in one box.

Is CogVideoX still being updated, or is deploying it now a dead end?

The open-weight line does stop at CogVideoX1.5 — released 2024-11-08 with the diffusers version on 11-15, and the last significant repo update was CogKit on 2025-03-24, the unified fine-tuning and inference framework for CogView4 and CogVideoX. CogVideoX-2 and CogVideoX-3 that followed are API-only, with no weights published. So "CogVideoX local deployment" specifically means the 1.5-5B tier today. It remains worth deploying because the weights are downloadable, LoRA-trainable, fully offline and runnable on a single consumer card — none of which an API gives you. And if you want to bench it against later arrivals like Wan or HunyuanVideo, that is just another instance on NexGPU: 51 countries and regions, 1,175 verified rentable nodes, 2,498 GPUs and 75 GPU models, with no card purchase required to run the comparison.

Can I use CogVideoX commercially? How does the licence work?

Two different answers, so don't conflate them. CogVideoX-2B is Apache 2.0 with no extra commercial hurdle. CogVideoX-5B, 5B-I2V, 1.5-5B and 1.5-5B-I2V use the custom CogVideoX LICENSE: free for academic research, but commercial use requires registering for a basic commercial licence through Zhipu's open platform, which covers up to one million visits per month before you need to talk to their business team. The licence also requires the copyright and licence statements to travel with all copies or significant portions, and prohibits military and other restricted uses. The sane order of operations is to rent by the hour on NexGPU and prove the output first — no minimum, no quota request, no setup fee — then decide whether the licensing process is worth starting.

How much VRAM does fine-tuning CogVideoX take? What's the gap between LoRA and full?

finetrainers (formerly cogvideox-factory) publishes measured figures for CogVideoX-5B text-to-video at 49×512×768, rank 128, fp8 weights, gradient checkpointing and precomputed conditions and latents: 18GB for LoRA, 53GB for full fine-tuning. Precomputation itself takes a separate chunk of memory, but you can run it and release before training. In short, LoRA fits a single 24GB card and full fine-tuning needs 80GB. On NexGPU that means an RTX 4090 24GB at $0.540/GPU-hr, or an RTX A6000 48GB at $0.817/GPU-hr if you want higher-resolution LoRA runs, and an A100 SXM4 80GB at $1.088/GPU-hr for full fine-tuning. Stop the instance and compute billing stops immediately, while your weights stay on storage for the next session.

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.