Cosmos
Diffusers
Safetensors
cosmos3_omni
nvidia
cosmos3
vllm
vllm-omni
sglang
sglang-diffusion
text, image, video, audio, and action generation
omnimodel
Instructions to use nvidia/Cosmos3-Nano with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Cosmos
How to use nvidia/Cosmos3-Nano with Cosmos:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Diffusers
How to use nvidia/Cosmos3-Nano with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("nvidia/Cosmos3-Nano", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Add SGLang serving instructions
#14
by MickJ - opened
9 unmodified lines10111213141516171819202122232425262728293031323334353637383940414243148 unmodified lines192193194195196197743 unmodified lines9419429439449459462 unmodified lines9499509519529539549559 unmodified lines- cosmos3- vllm- vllm-omni- diffusers- text, image, video, audio, and action generation- omnimodelcountDownloads:- checkpoint.json- config.json- generation_config.json- model.safetensors.index.json- model_index.json- tokenizer.json- tokenizer_config.json- sound_tokenizer/config.json- sound_tokenizer/diffusion_pytorch_model.safetensors- text_tokenizer/tokenizer.json- text_tokenizer/tokenizer_config.json- transformer/config.json- transformer/diffusion_pytorch_model-00001-of-00007.safetensors- transformer/diffusion_pytorch_model-00002-of-00007.safetensors- transformer/diffusion_pytorch_model-00003-of-00007.safetensors- transformer/diffusion_pytorch_model-00004-of-00007.safetensors- transformer/diffusion_pytorch_model-00005-of-00007.safetensors- transformer/diffusion_pytorch_model-00006-of-00007.safetensors- transformer/diffusion_pytorch_model-00007-of-00007.safetensors- transformer/diffusion_pytorch_model.safetensors.index.json- vae/config.json- vae/diffusion_pytorch_model.safetensors- vision_encoder/config.json- vision_encoder/model.safetensors---# **Cosmos 3: Omnimodal World Models for Physical AI**148 unmodified lines- [PyTorch](https://github.com/nvidia/cosmos3)- [vLLM-Omni](https://github.com/vllm-project/vllm-omni)- [Hugging Face Diffusers](https://huggingface.co/docs/diffusers/en/index)**Supported Hardware Microarchitecture Compatibility:**743 unmodified lines<video controls width="1280" height="720" src="https://huggingface.co/nvidia/Cosmos3-Nano/resolve/main/assets/example_t2v_diffusers_output.mp4"></video>## LimitationsCosmos3 may produce imperfect outputs in challenging scenarios. Generation artifacts include temporal inconsistency, unstable camera or object motion, imprecise physical interactions, inaccurate audio-video synchronization, and action-state drift — especially in long-horizon or high-resolution outputs. Reasoning may also be incorrect: object states, causal relationships, spatial geometry, temporal ordering, agent intent, and future outcomes can be misinferred, and complex or long-context inputs may yield hallucinated entities, inconsistent interpretations, or implausible predictions. Because the model lacks an explicit physics simulator, 3D geometry, 4D space-time evolution, object permanence, contact dynamics, and physical laws are only approximated — producing artifacts such as disappearing or morphing objects, unrealistic collisions, and physically implausible motions. Quality further degrades in out-of-distribution environments, safety-critical edge cases, and domains underrepresented in training.2 unmodified lines## Inference**Acceleration Engine:** [PyTorch](https://pytorch.org/), [vLLM](https://github.com/vllm-project/vllm), [vLLM-Omni](https://github.com/vllm-project/vllm-omni), [Hugging Face Diffusers](https://github.com/huggingface/diffusers)**Test Hardware:** GB200 and H1009 unmodified lines1011121314151617181920148 unmodified lines169170171172173174175743 unmodified lines9199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869872 unmodified lines9909919929939949959969 unmodified lines- cosmos3- vllm- vllm-omni- sglang- sglang-diffusion- diffusers- text, image, video, audio, and action generation- omnimodel---# **Cosmos 3: Omnimodal World Models for Physical AI**148 unmodified lines- [PyTorch](https://github.com/nvidia/cosmos3)- [vLLM-Omni](https://github.com/vllm-project/vllm-omni)- [Hugging Face Diffusers](https://huggingface.co/docs/diffusers/en/index)- [SGLang](https://github.com/sgl-project/sglang)**Supported Hardware Microarchitecture Compatibility:**743 unmodified lines<video controls width="1280" height="720" src="https://huggingface.co/nvidia/Cosmos3-Nano/resolve/main/assets/example_t2v_diffusers_output.mp4"></video>### SGLang[SGLang Diffusion](https://docs.sglang.io/docs/sglang-diffusion/index) can serve `nvidia/Cosmos3-Nano` through OpenAI-compatible image and video generation endpoints. Install SGLang from the main branch with diffusion dependencies, then start a server:```shellgit clone --branch main https://github.com/sgl-project/sglang.gitcd sglangpip install -e "python[diffusion]"pip install "cosmos-guardrail==0.3.1"sglang serve --model-path nvidia/Cosmos3-Nano```Cosmos 3 support in SGLang Diffusion currently requires the SGLang main branch. Switch to a stable SGLang release once Cosmos 3 support is included there.For a video-specialized checkpoint, use `Cosmos3-Super-Image2Video` with multiple GPUs:```shellsglang serve \--model-path nvidia/Cosmos3-Super-Image2Video \--num-gpus 4```Supported SGLang endpoints:| Mode | Endpoint | Notes || --- | --- | --- || Text to image | `POST /v1/images/generations` | Returns base64 image data by default || Text to video | `POST /v1/videos` | Creates an async job; poll `GET /v1/videos/{id}` and download `/content` || Image to video | `POST /v1/videos` | Upload the conditioning image with `input_reference` |Example text-to-video request:```shelljob_id=$(curl -sS -X POST http://localhost:30000/v1/videos \--form-string "prompt=A small warehouse robot moves a blue box across a clean floor." \--form-string "negative_prompt=blurry, distorted, low quality" \--form-string "size=1280x720" \--form-string "num_frames=81" \--form-string "fps=24" \--form-string "num_inference_steps=35" \--form-string "guidance_scale=4.0" \--form-string "flow_shift=10.0" \--form-string "seed=42" \--form-string 'extra_params={"guardrails":true,"use_resolution_template":false,"use_duration_template":false}' \| python -c 'import json, sys; print(json.load(sys.stdin)["id"])')while true; dostatus=$(curl -sS "http://localhost:30000/v1/videos/${job_id}" \| python -c 'import json, sys; print(json.load(sys.stdin)["status"])')[ "$status" = "completed" ] && break[ "$status" = "failed" ] && exit 1sleep 1donecurl -sS -L "http://localhost:30000/v1/videos/${job_id}/content" \-o cosmos3_t2v_output.mp4```SGLang accepts Cosmos 3 request options including `max_sequence_length`, `flow_shift`, `extra_params.guardrails`, `extra_params.use_resolution_template`, and `extra_params.use_duration_template`. Video-to-video, video-with-sound, and action generation are not supported by SGLang yet.For complete serving instructions and request examples, see the [Cosmos3 SGLang cookbook](https://docs.sglang.io/cookbook/diffusion/Cosmos/Cosmos3).## LimitationsCosmos3 may produce imperfect outputs in challenging scenarios. Generation artifacts include temporal inconsistency, unstable camera or object motion, imprecise physical interactions, inaccurate audio-video synchronization, and action-state drift — especially in long-horizon or high-resolution outputs. Reasoning may also be incorrect: object states, causal relationships, spatial geometry, temporal ordering, agent intent, and future outcomes can be misinferred, and complex or long-context inputs may yield hallucinated entities, inconsistent interpretations, or implausible predictions. Because the model lacks an explicit physics simulator, 3D geometry, 4D space-time evolution, object permanence, contact dynamics, and physical laws are only approximated — producing artifacts such as disappearing or morphing objects, unrealistic collisions, and physically implausible motions. Quality further degrades in out-of-distribution environments, safety-critical edge cases, and domains underrepresented in training.2 unmodified lines## Inference**Acceleration Engine:** [PyTorch](https://pytorch.org/), [vLLM](https://github.com/vllm-project/vllm), [vLLM-Omni](https://github.com/vllm-project/vllm-omni), [Hugging Face Diffusers](https://github.com/huggingface/diffusers), [SGLang](https://github.com/sgl-project/sglang), [SGLang Diffusion](https://docs.sglang.io/docs/sglang-diffusion/index)**Test Hardware:** GB200 and H100
README.md+67-26