kediwu0331 mingyuliutw MickJ commited on
Commit
e1fb671
·
1 Parent(s): 0b900a0

Add SGLang serving instructions (#11)

Browse files

- Super-squash branch 'main' using huggingface_hub (4f702f12a4166ddba0ff32fd4e128d390a625753)
- Add SGLang serving instructions (1ea4ae8c2d6ea184502a05834ec7bca234731957)
- Use SGLang main branch for Cosmos3 install (63e165c6d6e8cd4d9656c4b00f8e1a97686482af)
- change sglang serve section position (81166f28310d8ae96887523d1490aab2948bd804)
- add sglang to more sections (bc962f19ba1bddd410a0b03aa2d79dc7fd51137d)
- consolidate sglang serve section (2a579442c5df007ca48beff54d7a6fa56b9c97e3)
- Remove unrelated sound tokenizer files (41171bca665613c043f497d605969333c94f0013)
- Fix SGLang documentation links (1892515dd2c0db61066b7d9b4916c76ffb8c6091)


Co-authored-by: Ming-Yu Liu <mingyuliutw@users.noreply.huggingface.co>
Co-authored-by: mickqian <MickJ@users.noreply.huggingface.co>

Files changed (1) hide show
  1. README.md +69 -46
README.md CHANGED
@@ -10,54 +10,11 @@ tags:
10
  - cosmos3
11
  - vllm
12
  - vllm-omni
 
 
13
  - diffusers
14
  - text, image, video, audio, and action generation
15
  - omnimodel
16
- countDownloads:
17
- - checkpoint.json
18
- - config.json
19
- - generation_config.json
20
- - model.safetensors.index.json
21
- - model_index.json
22
- - tokenizer.json
23
- - tokenizer_config.json
24
- - sound_tokenizer/config.json
25
- - sound_tokenizer/diffusion_pytorch_model.safetensors
26
- - text_tokenizer/tokenizer.json
27
- - text_tokenizer/tokenizer_config.json
28
- - transformer/config.json
29
- - transformer/diffusion_pytorch_model-00001-of-00027.safetensors
30
- - transformer/diffusion_pytorch_model-00002-of-00027.safetensors
31
- - transformer/diffusion_pytorch_model-00003-of-00027.safetensors
32
- - transformer/diffusion_pytorch_model-00004-of-00027.safetensors
33
- - transformer/diffusion_pytorch_model-00005-of-00027.safetensors
34
- - transformer/diffusion_pytorch_model-00006-of-00027.safetensors
35
- - transformer/diffusion_pytorch_model-00007-of-00027.safetensors
36
- - transformer/diffusion_pytorch_model-00008-of-00027.safetensors
37
- - transformer/diffusion_pytorch_model-00009-of-00027.safetensors
38
- - transformer/diffusion_pytorch_model-00010-of-00027.safetensors
39
- - transformer/diffusion_pytorch_model-00011-of-00027.safetensors
40
- - transformer/diffusion_pytorch_model-00012-of-00027.safetensors
41
- - transformer/diffusion_pytorch_model-00013-of-00027.safetensors
42
- - transformer/diffusion_pytorch_model-00014-of-00027.safetensors
43
- - transformer/diffusion_pytorch_model-00015-of-00027.safetensors
44
- - transformer/diffusion_pytorch_model-00016-of-00027.safetensors
45
- - transformer/diffusion_pytorch_model-00017-of-00027.safetensors
46
- - transformer/diffusion_pytorch_model-00018-of-00027.safetensors
47
- - transformer/diffusion_pytorch_model-00019-of-00027.safetensors
48
- - transformer/diffusion_pytorch_model-00020-of-00027.safetensors
49
- - transformer/diffusion_pytorch_model-00021-of-00027.safetensors
50
- - transformer/diffusion_pytorch_model-00022-of-00027.safetensors
51
- - transformer/diffusion_pytorch_model-00023-of-00027.safetensors
52
- - transformer/diffusion_pytorch_model-00024-of-00027.safetensors
53
- - transformer/diffusion_pytorch_model-00025-of-00027.safetensors
54
- - transformer/diffusion_pytorch_model-00026-of-00027.safetensors
55
- - transformer/diffusion_pytorch_model-00027-of-00027.safetensors
56
- - transformer/diffusion_pytorch_model.safetensors.index.json
57
- - vae/config.json
58
- - vae/diffusion_pytorch_model.safetensors
59
- - vision_encoder/config.json
60
- - vision_encoder/model.safetensors
61
  ---
62
 
63
  # **Cosmos 3: Omnimodal World Models for Physical AI**
@@ -212,6 +169,7 @@ Our AI models are designed and/or optimized to run on NVIDIA GPU-accelerated sys
212
  - [PyTorch](https://github.com/nvidia/cosmos3)
213
  - [vLLM-Omni](https://github.com/vllm-project/vllm-omni)
214
  - [Hugging Face Diffusers](https://huggingface.co/docs/diffusers/en/index)
 
215
 
216
  **Supported Hardware Microarchitecture Compatibility:**
217
 
@@ -966,6 +924,71 @@ Example output:
966
 
967
  <video controls width="1280" height="720" src="https://huggingface.co/nvidia/Cosmos3-Super/resolve/main/assets/example_t2v_diffusers_output.mp4"></video>
968
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
969
  ## Limitations
970
 
971
  Cosmos3 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.
@@ -974,7 +997,7 @@ Cosmos3 outputs should not be treated as physically accurate simulation, reliabl
974
 
975
  ## Inference
976
 
977
- **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)
978
 
979
  **Test Hardware:** GB200 and H100
980
 
 
10
  - cosmos3
11
  - vllm
12
  - vllm-omni
13
+ - sglang
14
+ - sglang-diffusion
15
  - diffusers
16
  - text, image, video, audio, and action generation
17
  - omnimodel
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  ---
19
 
20
  # **Cosmos 3: Omnimodal World Models for Physical AI**
 
169
  - [PyTorch](https://github.com/nvidia/cosmos3)
170
  - [vLLM-Omni](https://github.com/vllm-project/vllm-omni)
171
  - [Hugging Face Diffusers](https://huggingface.co/docs/diffusers/en/index)
172
+ - [SGLang](https://github.com/sgl-project/sglang)
173
 
174
  **Supported Hardware Microarchitecture Compatibility:**
175
 
 
924
 
925
  <video controls width="1280" height="720" src="https://huggingface.co/nvidia/Cosmos3-Super/resolve/main/assets/example_t2v_diffusers_output.mp4"></video>
926
 
927
+ ### SGLang
928
+
929
+ [SGLang Diffusion](https://docs.sglang.io/docs/sglang-diffusion/index) can serve `nvidia/Cosmos3-Super` through OpenAI-compatible image and video generation endpoints. Install SGLang from the main branch with diffusion dependencies, then start the server:
930
+
931
+ ```bash
932
+ git clone --branch main https://github.com/sgl-project/sglang.git
933
+ cd sglang
934
+ pip install -e "python[diffusion]"
935
+ pip install "cosmos-guardrail==0.3.1"
936
+
937
+ sglang serve \
938
+ --model-path nvidia/Cosmos3-Super \
939
+ --num-gpus 4
940
+ ```
941
+
942
+ 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.
943
+
944
+ For the video-specialized checkpoint:
945
+
946
+ ```bash
947
+ sglang serve \
948
+ --model-path nvidia/Cosmos3-Super-Image2Video \
949
+ --num-gpus 4
950
+ ```
951
+
952
+ Supported SGLang endpoints:
953
+
954
+ | Mode | Endpoint | Notes |
955
+ | --- | --- | --- |
956
+ | Text to image | `POST /v1/images/generations` | Returns base64 image data by default |
957
+ | Text to video | `POST /v1/videos` | Creates an async job; poll `GET /v1/videos/{id}` and download `/content` |
958
+ | Image to video | `POST /v1/videos` | Upload the conditioning image with `input_reference` |
959
+
960
+ Example text-to-video request:
961
+
962
+ ```bash
963
+ job_id=$(curl -sS -X POST http://localhost:30000/v1/videos \
964
+ --form-string "prompt=A small warehouse robot moves a blue box across a clean floor." \
965
+ --form-string "negative_prompt=blurry, distorted, low quality" \
966
+ --form-string "size=1280x720" \
967
+ --form-string "num_frames=81" \
968
+ --form-string "fps=24" \
969
+ --form-string "num_inference_steps=35" \
970
+ --form-string "guidance_scale=4.0" \
971
+ --form-string "flow_shift=10.0" \
972
+ --form-string "seed=42" \
973
+ --form-string 'extra_params={"guardrails":true,"use_resolution_template":false,"use_duration_template":false}' \
974
+ | python -c 'import json, sys; print(json.load(sys.stdin)["id"])')
975
+
976
+ while true; do
977
+ status=$(curl -sS "http://localhost:30000/v1/videos/${job_id}" \
978
+ | python -c 'import json, sys; print(json.load(sys.stdin)["status"])')
979
+ [ "$status" = "completed" ] && break
980
+ [ "$status" = "failed" ] && exit 1
981
+ sleep 1
982
+ done
983
+
984
+ curl -sS -L "http://localhost:30000/v1/videos/${job_id}/content" \
985
+ -o cosmos3_super_t2v_output.mp4
986
+ ```
987
+
988
+ Video-to-video, video-with-sound, and action generation are not supported by SGLang yet.
989
+
990
+ For complete serving instructions and request examples, see the [Cosmos3 SGLang cookbook](https://docs.sglang.io/cookbook/diffusion/Cosmos/Cosmos3).
991
+
992
  ## Limitations
993
 
994
  Cosmos3 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.
 
997
 
998
  ## Inference
999
 
1000
+ **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)
1001
 
1002
  **Test Hardware:** GB200 and H100
1003