Views
No views yet
Cosmos3OmniTransformer from NVIDIA's
nvidia/Cosmos3-Super — the 64B
omnimodal Cosmos 3 world model (text-to-image, text-to-video, image-to-video,
optional synchronized sound). Produced with
NVIDIA TensorRT Model Optimizer (ModelOpt)
on a single 96 GB workstation GPU, via a streaming method that never materializes
the ~128 GB bf16 model (method scripts included).Only the transformer is quantized. The VAEs and tokenizers are the original bf16 components, bundled so the repo is self-contained. Loading requires the bundledload_cosmos3_modelopt.py(see How to use).
| Build | Bits (weights) | Repo size | Resident VRAM | s/it (1024² still) |
|---|---|---|---|---|
| NVFP4 (this repo) | 4-bit (E2M1 + scales) | ~36 GB | ~43 GB (meas.) | ~4.6 |
| FP8 (sibling) | 8-bit (E4M3) | ~64 GB | ~67 GB (meas.) | ~1.2 |
modelopt_state.pth is part of the checkpoint and is required — it
restores the quantized module structure at load. Do not delete it.load_cosmos3_modelopt.py) is required, not optional. The
current diffusers/accelerate/modelopt combination cannot materialize a
pre-quantized ModelOpt checkpoint unaided; the loader applies three small,
source-verified workarounds (parameter materialization for packed weights,
payload-dtype restoration for FP8, and weight-only quantizer enforcement)
plus the validated bf16 dtype normalization. ModelOpt marks this path
experimental; expect the loader to become unnecessary as upstream catches up.diffusers build with Cosmos 3 support (currently from source) plus
modelopt and accelerate. Pin to the verified versions for guaranteed
reproducibility (newer versions may also work, but this code path moves fast):1pip install "git+https://github.com/huggingface/diffusers.git@2c7efb95349296cf6bcce981ea036275a82a94df"
2pip install accelerate "nvidia-modelopt==0.44.0"1from load_cosmos3_modelopt import load_pipe # bundled in this repo
2from diffusers import UniPCMultistepScheduler
3
4pipe = load_pipe("prometheusAIR/Cosmos3-Super-nvfp4") # or a local path
5pipe.scheduler = UniPCMultistepScheduler.from_config(
6 pipe.scheduler.config, flow_shift=3.0 # NVIDIA's text-to-image setting; use 5.0 for image-to-video
7)
8
9# Single image -- pass parameters EXPLICITLY (see warning below):
10r = pipe("a weathered lighthouse on a cliff at golden hour, photoreal, 50mm",
11 height=1024, width=1024, num_frames=1,
12 num_inference_steps=50, guidance_scale=4.0)
13r.video[0].save("out.png") # .video is the list of PIL frames; [0] is the image
14
15# Video (~2 s): frame counts of the form 4n+1 map cleanly to the VAE's 4x
16# temporal compression; 24 fps is the native rate and conditions the model.
17r = pipe("The lighthouse beam sweeps slowly across the water. Static camera.",
18 height=704, width=1280, num_frames=49, fps=24.0,
19 num_inference_steps=35, guidance_scale=6.0)flow_shift=3.0,
result.video[0]) match NVIDIA's first-party Cosmos3 text-to-image reference.⚠️ A barepipe(prompt)call renders a 189-frame 720×1280 video (~8 s at 24 fps) — that is the pipeline's built-in default, not a still. It takes ~40× the compute of a single frame and is the most common reason this model "seems slow." Always passnum_frames/height/widthexplicitly.
quantize_cosmos3_super_streaming.py (included)
streams the bf16 shards directly into compressed FP8/NVFP4 form (peak memory ≈
the compressed footprint, so a single 96 GB card suffices), and
repackage_for_hf.py emits this repo's round-trippable layout via
save_pretrained + enable_huggingface_checkpointing() — note that ModelOpt's
export_hf_checkpoint() produces a deployment checkpoint that diffusers
cannot round-trip; the modelopt_state.pth from save_pretrained is what makes
drop-in loading possible. serve_cosmos3_diffusers.py is a small FastAPI server
(text→image, image→video) around the same model.cosmos_guardrail). The bundled
loader passes enable_safety_checker=False for local single-user use. If you
deploy this or publish generated media, install cosmos-guardrail, accept the
gated nvidia/Cosmos-Guardrail1
model (released under its own NVIDIA Open Model License, separate from this
repo's OpenMDW-1.1), and run with load_pipe(..., enable_safety_checker=True).nvidia/Cosmos3-Super (bf16). This repo modifies only the weight encoding of the transformer.diffusers 0.39.0.dev0 @ 2c7efb9, nvidia-modelopt 0.44.0, accelerate 1.13.0, torch 2.12.0, CUDA 13.3.LICENSE) and documents its origin above; the upstream repo ships no separate NOTICE file. OpenMDW-1.1 permits modification and redistribution and places no restrictions on generated outputs; you remain responsible for clearing any third-party rights embodied in the materials.prometheusAIR/Cosmos3-Super-fp8nvidia/Cosmos3-SuperSanDiegoDude/Cosmos3-Super-nf4 — a good choice if you are not on Blackwell-class hardware or want turnkey ComfyUI support.