Text-to-Image
Cosmos
Diffusers
Safetensors
cosmos3_omni
nvidia
cosmos3
vllm-omni
sglang
sglang-diffusion
image-generation
Instructions to use nvidia/Cosmos3-Super-Text2Image with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Cosmos
How to use nvidia/Cosmos3-Super-Text2Image 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-Super-Text2Image 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-Super-Text2Image", 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
Use SGLang main branch for Cosmos3 install
Browse files
README.md
CHANGED
|
@@ -385,10 +385,10 @@ print("Saved image to /tmp/cosmos3_t2i.png")
|
|
| 385 |
|
| 386 |
### SGLang
|
| 387 |
|
| 388 |
-
SGLang-Diffusion can serve `nvidia/Cosmos3-Super-Text2Image` through the OpenAI-compatible image generation endpoint. Install SGLang from
|
| 389 |
|
| 390 |
```bash
|
| 391 |
-
git clone https://github.com/sgl-project/sglang.git
|
| 392 |
cd sglang
|
| 393 |
pip install -e "python[diffusion]"
|
| 394 |
pip install "cosmos-guardrail==0.3.1"
|
|
@@ -398,6 +398,8 @@ sglang serve \
|
|
| 398 |
--num-gpus 4
|
| 399 |
```
|
| 400 |
|
|
|
|
|
|
|
| 401 |
Example text-to-image request:
|
| 402 |
|
| 403 |
```bash
|
|
|
|
| 385 |
|
| 386 |
### SGLang
|
| 387 |
|
| 388 |
+
SGLang-Diffusion can serve `nvidia/Cosmos3-Super-Text2Image` through the OpenAI-compatible image generation endpoint. Install SGLang from the main branch with diffusion dependencies, then start the server:
|
| 389 |
|
| 390 |
```bash
|
| 391 |
+
git clone --branch main https://github.com/sgl-project/sglang.git
|
| 392 |
cd sglang
|
| 393 |
pip install -e "python[diffusion]"
|
| 394 |
pip install "cosmos-guardrail==0.3.1"
|
|
|
|
| 398 |
--num-gpus 4
|
| 399 |
```
|
| 400 |
|
| 401 |
+
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.
|
| 402 |
+
|
| 403 |
Example text-to-image request:
|
| 404 |
|
| 405 |
```bash
|