Wandering Giants Compute · Learn
Tutorial

How to Run Open-Source AI Video Models in the Cloud

The short answer

Rent a GPU with root access (24 GB for Wan 2.1 1.3B, Wan 2.2 TI2V-5B or LTX-Video; 80 GB or more for 13–14B models), SSH in, install diffusers or the model's own repo, download weights with huggingface-cli, generate, and export MP4 with export_to_video. Use torchrun across 8 GPUs for faster 14B clips.

Small-model GPU
RTX 4090, 24 GB, $1.59/hr
Large-model GPU
H100 80 GB or RTX PRO 6000 96 GB
Wan 2.1 1.3B speed
~4 min per 5 s 480p clip on an RTX 4090 (published)
Libraries
diffusers 0.33+ or each model's own repo; ffmpeg for video files
Multi-GPU (Wan)
torchrun --nproc_per_node=8 with --dit_fsdp --t5_fsdp --ulysses_size 8
Open licences
Wan 2.1/2.2 and Mochi 1: Apache 2.0
VRAM figures
Approximate; depend on resolution, frames and offload

Open-weight video models have reached the point where a rented GPU and an afternoon get you real clips: Wan, HunyuanVideo, LTX-Video, Mochi 1 and CogVideoX all run with a few commands. The catch is resources. Video models need more VRAM and far more time than image models, so choosing the right card and knowing how to keep a long render alive matters. This tutorial takes you from an empty GPU to MP4 files for each model, then shows how to split a large render across eight GPUs.

It is part of our series on running Stable Diffusion and generative models on a cloud GPU. For hardware choices in depth, read what GPU you need for AI video generation first.

Which model and GPU should you start with?

Start with a small model on a 24 GB card to learn the workflow, then move to a 13–14B model on 80 GB or more for quality. VRAM figures here are approximate and depend on resolution, frame count and offloading.

ModelStart onApprox. VRAMLicenceWhy start here
Wan 2.1 T2V-1.3BRTX 4090 (24 GB)≈8 GB (published)Apache 2.0Light, fast, commercial-friendly
LTX-VideoRTX 4090≈12–24 GBLightricks open-weights licenceVery fast drafts
Wan 2.2 TI2V-5BRTX 4090 with offload24 GB (published)Apache 2.0720p text-or-image to video on one consumer-class card
CogVideoX-5BRTX 4090 with offload≈5–25 GBCogVideoX LicenseWell documented in diffusers
Mochi 1L40S (48 GB) or larger≈20–60 GBApache 2.0Strong motion; heavy
HunyuanVideoH100 (80 GB) or RTX PRO 6000 (96 GB)≈45–60 GB (published)Tencent Hunyuan Community LicenseHigh quality; territorial licence limits
Wan 2.1 / 2.2 14B80 GB+, or 8 GPUs≈40–80 GBApache 2.0Top open quality at 720p

Step 1: Launch a GPU and prepare the environment

Choose the Root way in. On Wandering Giants Compute you get SSH into Ubuntu with the NVIDIA driver, CUDA and PyTorch already installed. Video weights are large (a 14B model plus its encoders is tens of gigabytes), so check the disk first.

bash
ssh -p PORT USER@HOST
nvidia-smi && df -h ~

sudo apt-get update && sudo apt-get install -y git python3-venv tmux ffmpeg
python3 -m venv ~/video --system-site-packages     # reuse the installed PyTorch
source ~/video/bin/activate
pip install -U pip "huggingface_hub[cli]" hf_transfer
pip install -U diffusers transformers accelerate safetensors sentencepiece \
               protobuf ftfy imageio imageio-ffmpeg
export HF_HUB_ENABLE_HF_TRANSFER=1
huggingface-cli login            # token from huggingface.co, Settings, Access Tokens

Run every long job inside tmux new -s render so a dropped connection does not kill it. These examples assume diffusers 0.33 or newer, which includes the Wan, HunyuanVideo, LTX-Video, Mochi and CogVideoX pipelines; check the diffusers documentation if an import fails.

Step 2: Generate your first clip with Wan 2.1 1.3B

Wan 2.1 is Alibaba's open video model family, released under Apache 2.0. The 1.3B text-to-video model is the gentlest start.

python
# wan13b.py
import torch
from diffusers import AutoencoderKLWan, WanPipeline
from diffusers.utils import export_to_video

model_id = "Wan-AI/Wan2.1-T2V-1.3B-Diffusers"
vae = AutoencoderKLWan.from_pretrained(model_id, subfolder="vae", torch_dtype=torch.float32)
pipe = WanPipeline.from_pretrained(model_id, vae=vae, torch_dtype=torch.bfloat16).to("cuda")

frames = pipe(
    prompt="a red fox trotting through fresh snow at sunrise, tracking shot",
    negative_prompt="blurry, distorted, low quality, static",
    height=480, width=832, num_frames=81, guidance_scale=5.0,
).frames[0]
export_to_video(frames, "wan13b.mp4", fps=16)
bash
python wan13b.py

81 frames at 16 fps is about 5 seconds. The Wan team publishes about four minutes for a 480p clip from this model on an RTX 4090. Keep the VAE in FP32 as shown; it is small, and it avoids colour artefacts.

Step 3: Run Wan 2.2 TI2V-5B from the official repo

Wan 2.2's 5B model does text-to-video and image-to-video at 720p and is designed to fit a 24 GB card with offloading. The official repo exposes the memory options as flags.

bash
git clone https://github.com/Wan-Video/Wan2.2 ~/Wan2.2
cd ~/Wan2.2
pip install -r requirements.txt     # if flash_attn fails to build, install the rest first, then flash_attn last

huggingface-cli download Wan-AI/Wan2.2-TI2V-5B --local-dir ./Wan2.2-TI2V-5B

python generate.py --task ti2v-5B --size 1280*704 \
  --ckpt_dir ./Wan2.2-TI2V-5B \
  --offload_model True --convert_model_dtype --t5_cpu \
  --prompt "a paper lantern drifting over a dark lake, gentle ripples, cinematic"

--offload_model True moves model parts to CPU RAM between stages, --t5_cpu keeps the T5 text encoder on the CPU, and --convert_model_dtype converts weights to a lower-memory dtype. On an 80 GB card you can drop all three for speed. Add --image path/to/start.jpg to animate a still image. The Wan 2.2 repository lists the other tasks, including the larger A14B models, which want about 80 GB on one GPU.

Step 4: Split a 14B render across 8 GPUs

For the 14B models at 720p, one GPU means a long wait. Wan's reference code can shard one generation across several GPUs with FSDP and Ulysses sequence parallelism, using torchrun. Launch a machine with 8 of the same GPU.

bash
git clone https://github.com/Wan-Video/Wan2.1 ~/Wan2.1
cd ~/Wan2.1
pip install -r requirements.txt
pip install "xfuser>=0.4.1"          # sequence-parallel support used by multi-GPU mode

huggingface-cli download Wan-AI/Wan2.1-T2V-14B --local-dir ./Wan2.1-T2V-14B

torchrun --nproc_per_node=8 generate.py --task t2v-14B --size 1280*720 \
  --ckpt_dir ./Wan2.1-T2V-14B \
  --dit_fsdp --t5_fsdp --ulysses_size 8 \
  --prompt "aerial shot of a fishing village at golden hour, waves breaking on rocks"

--dit_fsdp and --t5_fsdp shard the diffusion transformer and text encoder across the GPUs; --ulysses_size 8 splits the sequence of video tokens across all eight. Scaling is not perfectly linear because GPUs exchange data every step, but the wall-clock time drops substantially. The same mechanics are explained in how to generate AI images faster using multiple GPUs. Check the Wan 2.1 repository for the flags supported by your checkout.

Step 5: Run LTX-Video for fast drafts

LTX-Video from Lightricks is built for speed and suits drafting motion before a slower final render.

python
# ltx.py
import torch
from diffusers import LTXPipeline
from diffusers.utils import export_to_video

pipe = LTXPipeline.from_pretrained("Lightricks/LTX-Video", torch_dtype=torch.bfloat16).to("cuda")

frames = pipe(
    prompt="a chef plating a dessert in a busy restaurant kitchen, shallow depth of field",
    negative_prompt="worst quality, inconsistent motion, blurry, jittery, distorted",
    width=704, height=480, num_frames=161, num_inference_steps=50,
).frames[0]
export_to_video(frames, "ltx.mp4", fps=24)

Lightricks has published several LTX-Video versions, including larger ones; the LTX-Video repository lists them with their licence terms.

Step 6: Run HunyuanVideo on an 80 GB card

HunyuanVideo is Tencent's 13B video model. Use the diffusers-format weights; on 80 GB or more you can keep everything on the GPU at moderate resolutions.

python
# hunyuan.py
import torch
from diffusers import HunyuanVideoPipeline, HunyuanVideoTransformer3DModel
from diffusers.utils import export_to_video

model_id = "hunyuanvideo-community/HunyuanVideo"
transformer = HunyuanVideoTransformer3DModel.from_pretrained(
    model_id, subfolder="transformer", torch_dtype=torch.bfloat16)
pipe = HunyuanVideoPipeline.from_pretrained(
    model_id, transformer=transformer, torch_dtype=torch.float16)
pipe.vae.enable_tiling()
pipe.to("cuda")              # on smaller cards: pipe.enable_model_cpu_offload()

frames = pipe(
    prompt="a vintage tram climbing a steep cobbled street in the rain",
    height=544, width=960, num_frames=61, num_inference_steps=30,
).frames[0]
export_to_video(frames, "hunyuan.mp4", fps=15)

Read the licence before you use the output: the Tencent Hunyuan Community License has usage and territorial restrictions, and at release it excluded the EU, the UK and South Korea.

Step 7: Mochi 1 and CogVideoX in a few lines

Both follow the same diffusers pattern. Mochi 1 (Genmo, Apache 2.0) is heavy, so use offload and VAE tiling below 80 GB:

python
import torch
from diffusers import MochiPipeline
from diffusers.utils import export_to_video

pipe = MochiPipeline.from_pretrained("genmo/mochi-1-preview", torch_dtype=torch.bfloat16)
pipe.enable_model_cpu_offload()
pipe.enable_vae_tiling()
frames = pipe("a hummingbird hovering at a red flower, slow motion", num_frames=85).frames[0]
export_to_video(frames, "mochi.mp4", fps=30)

CogVideoX-5B produces 49 frames (about 6 seconds at 8 fps) at 720×480:

python
import torch
from diffusers import CogVideoXPipeline
from diffusers.utils import export_to_video

pipe = CogVideoXPipeline.from_pretrained("THUDM/CogVideoX-5b", torch_dtype=torch.bfloat16)
pipe.enable_model_cpu_offload()
pipe.vae.enable_tiling()
frames = pipe("a sailing boat crossing a calm bay at dawn", num_frames=49,
              num_inference_steps=50, guidance_scale=6.0).frames[0]
export_to_video(frames, "cogvideox.mp4", fps=8)

Can you use ComfyUI for video instead?

Yes. ComfyUI supports Wan, HunyuanVideo, LTX-Video and Mochi natively, and its workflow templates include ready-made video graphs. Install it as in how to run ComfyUI on a cloud GPU, put the video model files in the folders the template names, and open it through an SSH tunnel. ComfyUI is the better choice for iterating on a look; diffusers or the official repos are better for scripted batches.

How do you get clips off the machine and join them?

Outputs are ordinary MP4 files. Copy them home with rsync, and use ffmpeg on the GPU machine to join or re-encode:

bash
# On your computer
rsync -avz -e "ssh -p PORT" USER@HOST:~/renders/ ./renders/

# On the GPU machine: join clips listed in clips.txt (lines like: file 'a.mp4')
ffmpeg -f concat -safe 0 -i clips.txt -c copy joined.mp4
# Upscale frame rate by interpolation (simple, not AI-based)
ffmpeg -i wan13b.mp4 -vf "minterpolate=fps=32" wan13b_32fps.mp4

What does a video session cost?

You pay for GPU minutes, and video uses a lot of them. Cost per clip = minutes per clip ÷ 60 × hourly price. The Wan 1.3B figure is published by the Wan team; the others are our rough estimates for 5-second clips, not measurements.

JobGPUMinutes per clip20 clips: GPU timeOur cost for 20 clips
Wan 2.1 1.3B, 480pRTX 4090~4 (published)~1.3 h1.3 × $1.59/hr ≈ $2.07
LTX-Video, 704×480RTX 4090~1.5 (est.)~0.5 h0.5 × $1.59/hr ≈ $0.80
Wan 2.2 TI2V-5B, 720pRTX 4090up to ~9 (published)~3 h3 × $1.59/hr ≈ $4.77
HunyuanVideo, 544×960H100 PCIe~15 (est.)~5 h5 × $4.99/hr ≈ $24.95
Wan 2.1 14B, 720p8 × H100 PCIe~5 wall-clock (est.)~13 h of GPU time13.3 × $4.99/hr ≈ $66.37

The last row shows the trade-off of splitting one clip across eight GPUs: you wait far less, but because scaling is below linear you use somewhat more total GPU time than on a single card. Drafting with a small model and rendering only the keepers with a big one is the most effective saving.

What goes wrong, and how do you fix it?

ProblemFix
CUDA out of memoryFewer frames or lower resolution; enable_model_cpu_offload(); VAE tiling; --t5_cpu in Wan's repo; a bigger GPU
flash_attn fails to buildInstall other requirements first, then flash_attn; or run without it where the repo allows (slower)
Render dies when laptop sleepsRun inside tmux or with nohup ... > log.txt 2>&1 &
Washed-out or flickering coloursUse the VAE dtype the model card recommends (Wan: FP32 VAE)
Slow downloadsexport HF_HUB_ENABLE_HF_TRANSFER=1 with hf_transfer installed
CPU RAM exhausted when offloadingOffload needs system RAM; use a bigger machine or fewer offloaded parts

When does renting from Wandering Giants Compute fit?

Renting from us fits video work that needs big GPUs in bursts. You can launch an RTX 4090 for drafts, an 80 GB H100, a 96 GB RTX PRO 6000 Blackwell or a 141 GB H200 for large models, or 8 of the same card in one machine for split renders, all with root access, Ubuntu, CUDA and PyTorch ready. Billing is by the minute from prepaid credit; when credit runs out the machine stops and its disk is kept for 7 days, so an overnight render cannot overspend. Footage and prompts stay on your machine.

We do not offer multi-node clusters or serverless video endpoints, and we are not the cheapest per hour; for a comparison of who offers what, see the best GPU providers for AI video. To build a service on top of these models, read how to build a scalable AI image and video generation platform. When you are ready to render, choose a GPU.

Frequently asked questions

What is the easiest open-source video model to run on a cloud GPU?

Wan 2.1 T2V-1.3B through diffusers is one of the easiest: it needs about 8 GB of VRAM, is Apache 2.0 and produces a 5-second 480p clip in a few minutes on an RTX 4090. LTX-Video is another light, fast option.

Can I run Wan 2.1 14B on one GPU?

Yes on an 80 GB or larger card, and on smaller cards with model offloading and the T5 encoder on CPU, at a large cost in speed. On a single GPU, a 720p clip takes tens of minutes; the repo's multi-GPU mode cuts that substantially.

Should I use diffusers or the official repo for video models?

diffusers gives one consistent Python API across Wan, HunyuanVideo, LTX-Video, Mochi and CogVideoX and is easiest to wrap in your own code. The official repos often get new features, faster kernels and multi-GPU modes first. ComfyUI also supports these models with built-in workflow templates.

How do I save the output as an MP4?

diffusers pipelines return a list of frames; pass them to diffusers.utils.export_to_video(frames, "out.mp4", fps=16) using the frame rate the model was trained for. Install ffmpeg on the machine if you also want to re-encode, trim or join clips.

Are open video models allowed for commercial use?

It depends on the model. Wan 2.1, Wan 2.2 and Mochi 1 are Apache 2.0. CogVideoX-2B is Apache 2.0 while CogVideoX-5B has its own licence. HunyuanVideo uses the Tencent Hunyuan Community License with territorial restrictions. Always read the model card.

How do I keep a long video render running if my SSH connection drops?

Start it inside tmux (tmux new -s render) or with nohup and output redirected to a log file. The job keeps running on the GPU; reconnect and reattach with tmux attach -t render.

Wandering Giants Compute

Rent the GPU for this, by the minute.

Launch an RTX 4090 for drafts or up to eight H100s or RTX PRO 6000s for final renders, with CUDA and PyTorch ready and billing by the minute.

Prepaid credit, billed by the minute, stops itself when credit runs out. Prices in £, $, €, ¥, CA$, A$, CHF and S$; UK prices include VAT.

Keep reading

About this article. Written by the Wandering Giants Compute team, the people who run Wandering Giants Compute. Hardware figures are the manufacturers’ published specifications. Speeds and costs marked as estimates are worked out from those specifications and our current prices, with the method shown; they are not measured benchmarks. Wandering Giants prices are taken live from our price list each time this page is built.

Last reviewed 25 November 2026.