Simulation / Modeling / Design How to Run NVIDIA Cosmos 3 on Local AI Devices Using Hugging Face Diffusers Nov 24, 2026 By Atharva Joshi and Jibin Varghese Discuss (0)

AI-Generated Summary

  • NVIDIA Cosmos 3 Nano is a world foundation model that generates videos from text, images, and other inputs to support physical AI development.
  • The Cosmos-Framework offloading package enables running Cosmos 3 Nano on GPUs with as little as 12 GB of VRAM by storing model weights in system RAM and transferring them to the GPU as needed during generation.
  • An FP8 checkpoint with native mixed precision reduces peak GPU memory usage while maintaining BF16 scaled dot-product attention for the attention layers.
  • The adapter supports seven generation modalities including text-to-video, image-to-video, video-to-video, sound generation, action generation, and control-guided generation through the official Diffusers modular pipeline.
  • Benchmark results across GeForce RTX 5070, 5080, 4090, and 5090 show pipeline latency and peak memory usage for each resolution and modality, with the RTX 5070 completing 720p text-to-video in 2,624.9 seconds at 9.94 GiB peak memory using BF16.

Next Steps

Powered by NVIDIA Nemotron. AI-generated content may summarize information incompletely. Verify important information. Learn more

Running video generation models locally can be challenging when model weights and intermediate data exceed available GPU memory. NVIDIA Cosmos 3 Nano is a world foundation model that generates videos from text, images, and other inputs to support physical AI development. Learn more about NVIDIA Cosmos for physical AI.

This tutorial walks you through how to run Cosmos 3 Nano on a GPU with as little as 12 GB of VRAM by storing most model weights in system RAM and transferring them to the GPU as needed. Using Hugging Face Diffusers, you’ll generate your first video, explore sound and additional input types, and use an FP8 checkpoint to further reduce memory requirements.

This streaming adapter builds on top of the native group offloading approach from the Hugging Face library to enable generation on a smaller GPU. The tradeoff is that this requires increased system RAM use and PCIe transfers for a smaller GPU-memory requirement. Note that this approach does not provide interactive latency or stream weights directly from disk during inference.

Step 1: Generate your first video

Use an existing Linux environment with Python 3.12 and a CUDA-enabled PyTorch build compatible with your GPU. The tested consumer-GPU hosts had approximately 128 GB of system RAM; this is not a measured minimum.

Clone Cosmos-Framework and install its standalone offloading package in your active environment. Run all examples and benchmark commands below from the package directory:

git clone https://github.com/NVIDIA/cosmos-framework.git

cd cosmos-framework/packages/diffusers-cpu-offloading
uv pip install '.[benchmarks]'

Pass the Hugging Face repository ID directly to build_pipeline. The first load downloads the checkpoint. Subsequent loads reuse cached files. Safety checking is enabled by default.

import torch

from cosmos3_streaming import StreamingConfig, build_pipeline

device = "cuda:0"
config = StreamingConfig(device=device)

pipe = build_pipeline(
    "nvidia/Cosmos3-Nano",
    config=config,
    dtype=torch.bfloat16,
)

With no revision argument, the BF16 load uses the repository’s default branch. The default configuration chooses appropriate memory-saving behavior automatically.

Start with BF16 and PyTorch scaled dot-product attention (SDPA), the baseline used on all four tested GPUs.

Set the video options

This example generates 189 frames at 720p. For faster iteration on a 12 GB GPU, change height and width to 480 and 848, or 240 and 432.

common_video_args = {
    "negative_prompt": "",
    "num_frames": 189,
    "height": 720,
    "width": 1280,
    "fps": 24.0,
    "num_inference_steps": 35,
    "guidance_scale": 6.0,
    "add_resolution_template": False,
    "add_duration_template": False,
}

Generate and save the video

Next, generate and save the video using the following script:

t2v = pipe(
    prompt='{"scene":"A robot arm working in a kitchen"}',
    generator=torch.Generator(device=device).manual_seed(123),
    output="videos",
    **common_video_args,
)

# Save the returned video frames as an MP4 file:

from diffusers.utils import export_to_video

export_to_video(t2v, "cosmos3_t2v.mp4", fps=common_video_args["fps"])

Step 2: Offload weights storage

The central idea is to store model weights in system RAM and use the GPU for computation.

To run large models within tight VRAM limits, this execution model manages memory and compute across the CPU and GPU in four ways:

  • Checkpoint weights that are not currently needed remain in system RAM, in BF16 or the checkpoint’s FP8 representation.
  • The next transformer block is transferred to the GPU when required.
  • Every matrix multiplication and attention operation runs on CUDA.
  • The adapter manages memory for denoising, the variational autoencoder (VAE) that encodes and decodes video, and safety checking.

With this approach, system RAM acts as the backing store for model weights. More demanding requests, including 720p Transfer on a 12 GB GPU, use an automatic lower-memory execution mode while keeping model computation on CUDA.

Move weights from system RAM to the GPU

Next, move weights from system RAM to the GPU. Figure 1 shows the path from checkpoint storage to GPU computation. Checkpoint files remain on disk between runs. During generation, system RAM is the backing store for weights that are not currently on the GPU. This is why a fast SSD helps with model loading, while sufficient system RAM and PCIe bandwidth matter during generation.

Model weights load from an SSD checkpoint into CPU RAM, then transfer over PCIe to the GPU. One transformer block computes at a time using CUDA. The next block may be prefetched when GPU memory headroom allows.
Figure 1. Streaming model weights from system RAM to the GPU enables NVIDIA Cosmos 3 Nano generation without keeping the full model in GPU memory 

Reuse understanding context during generation

Diffusers provides sequential, model-level, and group-level CPU offloading to move model components between CPU and GPU memory. The Cosmos adapter builds on those mechanisms and coordinates when the model’s understanding and generation pathways run.

NVIDIA Cosmos 3, an open omnimodal world foundation model for physical AI, has two complementary pathways inside its transformer:

  • The understanding pathway interprets the prompt and other conditioning inputs. These inputs remain fixed during generation.
  • The generation pathway processes the evolving video, sound, or action representation at every denoising step while using the understanding result as context.

The transformer contains both understanding and generation computation. With fixed conditioning and precision, the adapter prepares the understanding context once and reuses it during generation. If native FP8 precision changes during denoising, that context is refreshed to match.

Video 1 shows how generation traverses the transformer blocks at each denoising step. A 35-step request runs denoising steps 1 through 35. Each step traverses 36 transformer blocks, indexed 0 through 35. After block 35, the scheduler updates the generation state and the next step starts at block 0. After the final denoising step, the pipeline decodes the output.

Video 1. Learn how Cosmos 3 Nano streams weights from CPU to GPU

Classifier-free guidance (CFG) in Hugging Face combines predictions with and without prompt conditioning at each denoising step. The adapter reuses each streamed block across these predictions instead of transferring its weights for each branch. Transfer can add a control branch, which the automatic low-memory mode handles through the same API.

Keep the official Diffusers pipeline

The adapter uses the official Diffusers modular pipeline for:

  • Prompt processing
  • Conditioning and latent preparation
  • Sequence preparation
  • The denoising loop and UniPC scheduler
  • Masking and classifier-free guidance output handling
  • VAE decode
  • Safety checking
  • Output conversion

Manage memory across the complete request

Block offloading alone is not enough for the complete Cosmos pipeline. The adapter applies the following behavior automatically.

Reuse fixed understanding work

With fixed precision, the understanding pathway runs once for fixed conditioning inputs and its context is reused during denoising.

Stream generation blocks

Transformer weights remain in system RAM until their block is needed. The active block moves to the GPU, performs its CUDA work for the current denoising step, and makes room for the next block. Guidance predictions share the same block placement whenever possible.

Overlap transfers with computation

When the GPU has enough headroom, the next block can begin moving while the current block computes. Larger workloads automatically use the safer lower-memory schedule. There is no user-facing transfer schedule to configure.

Manage decoding and safety checks

VAE processing and safety checking have different memory requirements from denoising. The adapter manages those phases separately and automatically uses memory-efficient VAE execution on constrained cards. Users do not choose device-specific tuning values.

Handle larger Transfer requests

Transfer Modality performs more guidance work than text-to-video (T2V) and image-to-video (I2V). At 720p on a 12 GB GPU, the adapter automatically selects a lower-memory execution mode. The full GeForce RTX 5070 modality results include its generation time and guardrail settings.

Step 3: Generate other modalities ( sound, action, etc )

Reuse pipe, device, and common_video_args from Step 1 for the examples in this section. Replace the input image and video paths with your own files. The prompts are illustrative; use the benchmark scripts for the exact measured inputs. Video-only calls return a list of frames. Calls requesting sound or action return a mapping of the requested outputs.

Image-to-video

Condition generation on an image with image=.

from diffusers.utils import load_image

image = load_image("/path/to/conditioning_image.jpg")
i2v = pipe(
    prompt='{"scene":"A vehicle approaches a rockfall on a coastal road"}',
    image=image,
    generator=torch.Generator(device=device).manual_seed(1111),
    output="videos",
    **common_video_args,
)

Video-to-video

Pass a source video and choose the conditioning frames for video-to-video (V2V) generation.

from diffusers.utils import load_video

source_video = load_video("/path/to/source_video.mp4")
v2v = pipe(
    prompt='{"scene":"A robot pours liquid into a cup"}',
    video=source_video,
    condition_frame_indexes_vision=[0, 1],
    condition_video_keep="first",
    generator=torch.Generator(device=device).manual_seed(0),
    output="videos",
    **common_video_args,
)

Text-to-video with sound

Set enable_sound=True and include an audio description to generate video and sound together.

t2v_sound = pipe(
    prompt=(
        '{"scene":"A robot arm working in a kitchen",'
        '"audio_description":"Soft servo whirring and a ceramic clink."}'
    ),
    enable_sound=True,
    generator=torch.Generator(device=device).manual_seed(0),
    output=["videos", "sound", "sampling_rate"],
    **common_video_args,
)

Image-to-video with sound

Combine the image input with enable_sound=True to generate both outputs.

i2v_sound = pipe(
    prompt=(
        '{"scene":"A vehicle travels along a coastal road",'
        '"audio_description":"Road noise, wind, and distant waves."}'
    ),
    image=image,
    enable_sound=True,
    generator=torch.Generator(device=device).manual_seed(0),
    output=["videos", "sound", "sampling_rate"],
    **common_video_args,
)

Action generation

Use CosmosActionCondition to select the action domain and provide the conditioning video.

from diffusers import CosmosActionCondition

action_result = pipe(
    prompt="Put the pot to the left of the purple item.",
    action=CosmosActionCondition(
        mode="policy",
        chunk_size=16,
        domain_name="bridge_orig_lerobot",
        resolution_tier=480,
        video=load_video("/path/to/bridge_input.mp4"),
        view_point="ego_view",
    ),
    fps=5,
    num_inference_steps=30,
    guidance_scale=1.0,
    use_system_prompt=False,
    generator=torch.Generator(device=device).manual_seed(0),
    output=["videos", "action"],
)

Control-guided generation

Pass a control video with the control_videos argument. Safety checking remains enabled in this example; the benchmark’s guardrails-off exception is documented with the results.

transfer = pipe(
    prompt='{"scene":"Transform the input using edge guidance"}',
    negative_prompt="",
    control_videos={
        "edge": load_video("/path/to/control_edge.mp4"),
    },
    num_frames=121,
    height=720,
    width=1280,
    fps=30.0,
    num_inference_steps=35,
    guidance_scale=3.0,
    control_guidance=1.5,
    generator=torch.Generator(device=device).manual_seed(0),
    output="videos",
)

Diffusers routes each call to the appropriate workflow and loads the required components through the same pipeline.

Step 4: Use the FP8 checkpoint

Use nvidia/Cosmos3-Nano with the FP8 branch for the dedicated FP8 checkpoint. From the same package directory, install the FP8 extra, which includes NVIDIA Model Optimizer, before loading the checkpoint:

uv pip install '.[benchmarks,fp8]'

Select the FP8 branch through the same Hub API by passing revision="fp8":

pipe = build_pipeline(
    "nvidia/Cosmos3-Nano",
    revision="fp8",
    config=StreamingConfig(device="cuda:0"),
    dtype=torch.bfloat16,
    checkpoint_precision="fp8",
)

The adapter uses the checkpoint’s native Diffusers precision policy. W8A8 uses 8-bit weights and 8-bit activations. W8A16 reuses the stored 8-bit weights, dequantizes them for a linear operation, and uses 16-bit activations. The tested Nano video checkpoint selects W8A16 for the first three and last three denoising steps and W8A8 for the middle steps. Note that attention remains BF16 SDPA; the entire pipeline does not run in FP8.

Step 5: Choose a GPU and resolution

Use Table 1 to choose a starting resolution. The default configuration adapts automatically to the requested resolution, modality, and available GPU memory.

GPU classRecommended use
12 GBStart at 240p or 480p for iteration. Full 720p is supported, including Transfer, but can be substantially slower.
16 GB480p is a practical iteration mode; 720p is supported with automatic memory management.
24 GBFull-resolution generation has more working room and is materially faster in the tested configuration.
32 GBBest measured consumer-GPU latency for the 720p BF16 workload.
Table 1. Suggested starting resolutions by GPU memory capacity

These are guidance ranges rather than fixed limits. Resolution, frame count, modality, checkpoint precision, available system RAM, and PCIe bandwidth all affect fit and runtime.

Step 6: Benchmark setup and results

The presented results cover text-to-video across four GeForce RTX cards and all seven generation modalities on the GeForce RTX 5070. Use Table 4 to estimate memory requirements and wait times. Hosts, software revisions, and safety settings can affect latency, so these single-run measurements are not a controlled GPU ranking or a multiseed BF16-versus-FP8 comparison.

Reproduce the benchmarks

From the package directory used in Step 1, run the BF16 and FP8 benchmarks separately to measure your system. These commands cover all seven modalities and three resolution tiers. Install the FP8 dependency from Step 4 before running the FP8 command.

python benchmarks/benchmark_bf16.py --output-dir artifacts/benchmark-bf16
python benchmarks/benchmark_fp8.py --output-dir artifacts/benchmark-fp8

The benchmark guide in benchmarks/README.md explains the pinned inputs, per-case logs, summary tables, --resume, and --preflight-only. Safety checks are enabled by default. Reproducing the labeled Transfer timings requires an explicit Transfer-only run with --transfer-without-guardrails. The FP8 runner records the exact checkpoint revision and uses the native Diffusers policy.

Test settings

The benchmark workloads use the bundled model-card inputs. Each saved video was checked for its output dimensions, frame count, and frame rate. Sound cases also produced WAV files, and Action cases produced action JSON. Table 2 lists the generation and timing settings.

ControlBF16 T2VRTX 5070 modalities
Output189 frames, 24 fps189 frames for video/sound; 17 for Action; 121 at 30 fps for Transfer
Resolution tiers432×240, 848×480, 1280×720432×240, 848×480, 1280×720; action uses corresponding tiers
Denoising35 UniPC steps, CFG 6, seed 12335 steps for video/sound/Transfer; 30 for Action; fixed per-modality inputs and seeds
SafetyEnabledEnabled except the explicitly labeled guardrails-off Transfer rows
TimingPipeline call through returned framesPipeline call through returned modality tensors
ExcludedConstruction, checkpoint loading, MP4 encodingConstruction, checkpoint loading, file encoding
Table 2. Generation settings and timing definitions

Tested hardware

Table 3 lists the tested GPUs. Each host had approximately 128 GB of system RAM. CPU offloading exchanges GPU memory pressure for system RAM use. The measured consumer-GPU hosts had approximately 128 GB of system RAM.

GPUArchitectureCompute capabilityVRAMSystem RAM
GeForce RTX 5070Blackwell GB205SM12012 GB128 GB class
GeForce RTX 5080Blackwell GB203SM12016 GB128 GB class
GeForce RTX 4090Ada AD102SM8924 GB128 GB class
GeForce RTX 5090Blackwell GB202SM12032 GB128 GB class
Table 3. GPU and host specifications for the measured systems

Text-to-video results across RTX GPUs

Table 4 compares text-to-video measurements across RTX cards. Pipeline time includes prompt processing, understanding, denoising, VAE decode, and safety checking, but excludes checkpoint loading and MP4 encoding. The RTX 5070 entries also appear in the full modality results in Table 5.

GPUVRAMResolutionPrecisionPipeline latencyPeak device memory
RTX 507012,227 MiB1280×720BF16 SDPA2,624.9 s (43.75 min)9.94 GiB
RTX 507012,227 MiB848×480BF16 SDPA849.5 s (14.16 min)6.68 GiB
RTX 507012,227 MiB432×240BF16 SDPA207.6 s (3.46 min)4.30 GiB
RTX 507012,227 MiB1280×720Native mixed FP8, BF16 SDPA2,235.7 s (37.26 min)9.16 GiB
RTX 507012,227 MiB848×480Native mixed FP8, BF16 SDPA716.2 s (11.94 min)6.23 GiB
RTX 507012,227 MiB432×240Native mixed FP8, BF16 SDPA170.6 s (2.84 min)3.95 GiB
RTX 508016,303 MiB1280×720BF16 SDPA1,594.4 s (26.57 min)11.92 GiB
RTX 508016,303 MiB848×480BF16 SDPA569.3 s (9.49 min)6.87 GiB
RTX 508016,303 MiB432×240BF16 SDPA160.6 s (2.68 min)4.42 GiB
RTX 409023,028 MiB1280×720BF16 SDPA1,052.2 s (17.54 min)16.56 GiB
RTX 409023,028 MiB848×480BF16 SDPA422.6 s (7.04 min)7.52 GiB
RTX 409023,028 MiB432×240BF16 SDPA195.3 s (3.26 min)4.47 GiB
RTX 509032,607 MiB1280×720BF16 SDPA1,016.7 s (16.94 min)18.22 GiB
RTX 509032,607 MiB848×480BF16 SDPA282.4 s (4.71 min)7.88 GiB
RTX 509032,607 MiB432×240BF16 SDPA122.9 s (2.05 min)4.70 GiB
Table 4. Full text-to-video pipeline latency and peak GPU memory across RTX cards

Full modality results on RTX 5070

Table 5 lists full generations on the 12 GB RTX 5070 with a 128 GB-class host. Times are pipeline calls in seconds, excluding loading and file encoding; peaks are device-used GPU memory in GiB. FP8 uses the checkpoint’s native W8A16 first/last-three schedule and W8A8 middle steps. Prompt and output safety checks are enabled for both precisions except in the labeled Transfer rows.

ModalityOutput sizeBF16 time (s)BF16 peak (GiB)FP8 time (s)FP8 peak (GiB)
T2V432×240207.64.30170.63.95
T2V848×480849.56.68716.26.23
T2V1280×7202,624.99.942,235.79.16
I2V432×240215.04.39176.14.07
I2V848×480868.66.91738.26.54
I2V1280×7202,655.310.842,269.110.66
T2V with sound432×240218.14.82177.64.82
T2V with sound848×480864.86.78731.56.32
T2V with sound1280×7202,647.711.062,256.010.92
I2V with sound432×240222.75.18182.94.84
I2V with sound848×480876.36.91745.36.55
I2V with sound1280×7202,675.310.852,284.310.67
V2V432×240214.44.38176.04.07
V2V848×480867.17.36738.67.00
V2V1280×7202,655.811.202,267.111.20
Action320×24050.83.5937.33.35
Action640×480 (480p tier)63.85.5151.95.15
Action640×480 (720p tier)65.98.0654.37.69
Transfer*432×240269.03.85208.43.52
Transfer*848×4801,234.27.841,027.77.49
Transfer*1280×7204,834.99.764,279.110.87
Table 5. Full BF16 and FP8 generation results on GeForce RTX 5070

*Transfer produces 121 frames at 30 fps. Other video/sound rows produce 189 frames with 35 steps; Action produces 17 frames with 30 steps. Action 720p tier outputs 640×480, not 1280×720

Get started with Cosmos 3 Nano on GeForce RTX GPUs

Weight streaming enables you to experiment with NVIDIA Cosmos 3 Nano on RTX GPUs with as little as 12 GB of VRAM by storing model weights in system RAM while keeping computation on the GPU.

To get started, install the Cosmos-Framework offloading package and run the BF16 text-to-video example at 240p or 480p. Then explore image- and video-conditioned generation, sound, actions, and control inputs through the same Diffusers API. Try the FP8 checkpoint and use the included benchmarks to compare generation time and memory use on your hardware.

Discuss (0)

Tags

Agentic AI / Generative AI | Developer Tools & Techniques | Simulation / Modeling / Design | General | Cosmos | RTX GPU | Intermediate Technical | Tutorial | AI Foundation Models | Physical AI | Video Generation

About the Authors

Avatar photo About Atharva Joshi
Atharva Joshi is a deep learning algorithms engineer at NVIDIA, focused on kernel performance and inference optimization for world foundation models, including NVIDIA Cosmos. His expertise and technical interests span GPU kernel development, ML accelerator architectures, and hardware-aware optimization for efficient training and inference. He holds a master’s degree in Computer Science from the University of Southern California. View all posts by Atharva Joshi Avatar photo About Jibin Varghese
Jibin Varghese is an engineering leader in agentic, local and physical AI at NVIDIA. He works on the intersection of agentics and low-memory compute for running agents on edge devices, and is a core contributor to the Cosmos series of world foundation models. He holds a master’s degree in Computer Science from Texas A&M University, College Station. View all posts by Jibin Varghese

Comments