Cosmos
Diffusers
Safetensors
cosmos3_omni
nvidia
cosmos3
vllm
vllm-omni
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
MickJ commited on
Commit ·
d4a7e99
1
Parent(s): b5f2fbe
Simplify SGLang Cosmos3 serve examples
Browse files
README.md
CHANGED
|
@@ -935,13 +935,15 @@ cd sglang
|
|
| 935 |
pip install -e "python[diffusion]"
|
| 936 |
pip install "cosmos-guardrail==0.3.1"
|
| 937 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 938 |
sglang serve \
|
| 939 |
-
--model-
|
| 940 |
-
--
|
| 941 |
-
--num-gpus 1 \
|
| 942 |
-
--host 0.0.0.0 \
|
| 943 |
-
--port 8000 \
|
| 944 |
-
--output-path /tmp/cosmos3-sglang
|
| 945 |
```
|
| 946 |
|
| 947 |
Supported SGLang endpoints:
|
|
@@ -955,7 +957,7 @@ Supported SGLang endpoints:
|
|
| 955 |
Example text-to-video request:
|
| 956 |
|
| 957 |
```shell
|
| 958 |
-
job_id=$(curl -sS -X POST http://localhost:
|
| 959 |
--form-string "prompt=A small warehouse robot moves a blue box across a clean floor." \
|
| 960 |
--form-string "negative_prompt=blurry, distorted, low quality" \
|
| 961 |
--form-string "size=1280x720" \
|
|
@@ -969,14 +971,14 @@ job_id=$(curl -sS -X POST http://localhost:8000/v1/videos \
|
|
| 969 |
| python -c 'import json, sys; print(json.load(sys.stdin)["id"])')
|
| 970 |
|
| 971 |
while true; do
|
| 972 |
-
status=$(curl -sS "http://localhost:
|
| 973 |
| python -c 'import json, sys; print(json.load(sys.stdin)["status"])')
|
| 974 |
[ "$status" = "completed" ] && break
|
| 975 |
[ "$status" = "failed" ] && exit 1
|
| 976 |
sleep 1
|
| 977 |
done
|
| 978 |
|
| 979 |
-
curl -sS -L "http://localhost:
|
| 980 |
-o cosmos3_t2v_output.mp4
|
| 981 |
```
|
| 982 |
|
|
|
|
| 935 |
pip install -e "python[diffusion]"
|
| 936 |
pip install "cosmos-guardrail==0.3.1"
|
| 937 |
|
| 938 |
+
sglang serve --model-path nvidia/Cosmos3-Nano
|
| 939 |
+
```
|
| 940 |
+
|
| 941 |
+
For a video-specialized checkpoint, use `Cosmos3-Super-Image2Video` with multiple GPUs:
|
| 942 |
+
|
| 943 |
+
```shell
|
| 944 |
sglang serve \
|
| 945 |
+
--model-path nvidia/Cosmos3-Super-Image2Video \
|
| 946 |
+
--num-gpus 4
|
|
|
|
|
|
|
|
|
|
|
|
|
| 947 |
```
|
| 948 |
|
| 949 |
Supported SGLang endpoints:
|
|
|
|
| 957 |
Example text-to-video request:
|
| 958 |
|
| 959 |
```shell
|
| 960 |
+
job_id=$(curl -sS -X POST http://localhost:30000/v1/videos \
|
| 961 |
--form-string "prompt=A small warehouse robot moves a blue box across a clean floor." \
|
| 962 |
--form-string "negative_prompt=blurry, distorted, low quality" \
|
| 963 |
--form-string "size=1280x720" \
|
|
|
|
| 971 |
| python -c 'import json, sys; print(json.load(sys.stdin)["id"])')
|
| 972 |
|
| 973 |
while true; do
|
| 974 |
+
status=$(curl -sS "http://localhost:30000/v1/videos/${job_id}" \
|
| 975 |
| python -c 'import json, sys; print(json.load(sys.stdin)["status"])')
|
| 976 |
[ "$status" = "completed" ] && break
|
| 977 |
[ "$status" = "failed" ] && exit 1
|
| 978 |
sleep 1
|
| 979 |
done
|
| 980 |
|
| 981 |
+
curl -sS -L "http://localhost:30000/v1/videos/${job_id}/content" \
|
| 982 |
-o cosmos3_t2v_output.mp4
|
| 983 |
```
|
| 984 |
|