Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
1cc4059
Added Cosmos3 model
MaciejBalaNV May 14, 2026
ee77c61
Small qol improvements
MaciejBalaNV May 14, 2026
0d0542f
Updated docs for Cosmos3
MaciejBalaNV May 14, 2026
bd4ecb3
Cleared up docs
MaciejBalaNV May 14, 2026
921cc4b
Fixed sound quality issues
MaciejBalaNV May 14, 2026
75d9888
Linter fixes
MaciejBalaNV May 14, 2026
9e9e453
extra cleanup
MaciejBalaNV May 14, 2026
3c7cd31
Updated examples to refer to HF repo
MaciejBalaNV May 15, 2026
c36b23c
Improved guardrails
MaciejBalaNV May 15, 2026
095f6b5
Linter fixes
MaciejBalaNV May 15, 2026
0585095
Reworked guardrail error
MaciejBalaNV May 18, 2026
144ffdf
Simplify sound tokenizer and bring parity with diffusers
MaciejBalaNV May 18, 2026
6775a91
Rename _layerwise_offload_blocks_attr
MaciejBalaNV May 18, 2026
1c7f785
Merge branch 'main' into mbala/cosmos3_model
MaciejBalaNV May 18, 2026
ab3c262
Added yaml example without guardrails
MaciejBalaNV May 18, 2026
8948494
Updated examples; improved action generation
MaciejBalaNV May 19, 2026
1a93c89
Merge branch 'main' into mbala/cosmos3_model
MaciejBalaNV May 19, 2026
4fa8f65
Doc cleanup
MaciejBalaNV May 19, 2026
3ac4c71
Doc cleanup v2
MaciejBalaNV May 19, 2026
b16e4c7
Updated deploy config
MaciejBalaNV May 19, 2026
149700e
Removed examples for now
MaciejBalaNV May 20, 2026
a063830
Simplify tests
MaciejBalaNV May 20, 2026
386d40f
Scope Cosmos3 to core generation
MaciejBalaNV May 20, 2026
84dc378
Merge branch 'vllm-project:main' into mbala/cosmos3_model
MaciejBalaNV May 20, 2026
c3500c0
Add back some of the unnecessarily deleted code
MaciejBalaNV May 20, 2026
8536f5b
Linter fixes
MaciejBalaNV May 20, 2026
bcf609e
Simplified the guardrails with cosmos-guardrail package
MaciejBalaNV May 22, 2026
3bf5f73
Remove the Cosmos3 model from pipeline due to loading issues
MaciejBalaNV May 22, 2026
c4b8886
Removed introduced guardrail error
MaciejBalaNV May 22, 2026
0d325bf
Improved error message
MaciejBalaNV May 22, 2026
397d2fe
Remove custom RMSNorm
MaciejBalaNV May 22, 2026
82b8a2c
Added Cosmos3 as a pipeline
MaciejBalaNV May 22, 2026
3c7305a
Merge branch 'main' into mbala/cosmos3_model
MaciejBalaNV May 22, 2026
2e88a23
Cleanup
MaciejBalaNV May 22, 2026
bd12fd4
Adapted to new checkpoint format
MaciejBalaNV May 25, 2026
49fb11a
Merge branch 'main' into mbala/cosmos3_model
MaciejBalaNV May 25, 2026
2c8ec84
Linter fixes
MaciejBalaNV May 25, 2026
6d16f65
Cleaned up the code
MaciejBalaNV May 25, 2026
85dfeb2
Fixed a test
MaciejBalaNV May 25, 2026
c6185a1
Fixed multi-GPU with deploy configs
MaciejBalaNV May 26, 2026
64bfa80
Merge branch 'main' into mbala/cosmos3_model
MaciejBalaNV May 28, 2026
ed5e391
Linter fix
MaciejBalaNV May 28, 2026
5a4eb97
Reverted c6185a1324397b3729b1c67f4b59b8438d317957
MaciejBalaNV May 28, 2026
d9a35ab
Fix CUDNN_ATTN for GQA
MaciejBalaNV May 28, 2026
7c91b3c
Answered review comments
MaciejBalaNV May 28, 2026
276b785
Some cleanup after review
MaciejBalaNV May 28, 2026
a92fb56
Cleaned up test
MaciejBalaNV May 28, 2026
e83299c
Bugfix
MaciejBalaNV May 28, 2026
0036cd3
Unregistered Cosmos3 as a multi-stage pipeline; added a CLI flag to d…
MaciejBalaNV May 28, 2026
1a60f85
Merge branch 'main' into mbala/cosmos3_model
MaciejBalaNV May 29, 2026
2074758
Deleted cosmos3 conftest.py
MaciejBalaNV May 29, 2026
5b0ba8f
Small review improvements
MaciejBalaNV May 29, 2026
491c85a
Postprocess Cosmos3 output to be tensor-only; Update ipc.py to handle…
MaciejBalaNV May 29, 2026
21a1322
Improved dit cache for t2i
MaciejBalaNV May 29, 2026
e826f62
Fixed flow_shift for images; Updated max_sequence_length for Cosmos3 …
MaciejBalaNV May 29, 2026
65b83d8
Pass extra_args to image endpoint
MaciejBalaNV May 29, 2026
9efb5fe
Small review cleanup
MaciejBalaNV Jun 1, 2026
65e24cf
Simplified cosmos3 attention
MaciejBalaNV Jun 1, 2026
30c5a98
Pass extra_params for image endpoint
MaciejBalaNV Jun 1, 2026
63770f8
Removed self.sdpa_backend from Cosmos3
MaciejBalaNV Jun 1, 2026
ce45394
Added extra type checking
MaciejBalaNV Jun 1, 2026
0861791
Reintroduce some empty dict checks
MaciejBalaNV Jun 1, 2026
453bd09
Change resolution and duration templates to off by default
MaciejBalaNV Jun 1, 2026
a985f16
Merge branch 'main' into mbala/cosmos3_model
lishunyang12 Jun 1, 2026
361e20b
Add Cosmos3-Nano recipe and fix stale prompt-template test
lishunyang12 Jun 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/.nav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ nav:
- Offline Inference:
- BAGEL-7B-MoT: user_guide/examples/offline_inference/bagel.md
- GLM-Image Multistage End-to-End Inference: user_guide/examples/offline_inference/glm_image.md
- Cosmos3: user_guide/examples/offline_inference/cosmos3.md
- Helios Video Generation: user_guide/examples/offline_inference/helios.md
- HunyuanImage-3.0 Image-to-Text Inference: user_guide/examples/offline_inference/hunyuan_image3.md
- Image-To-Image: user_guide/examples/offline_inference/image_to_image.md
Expand All @@ -34,6 +35,7 @@ nav:
- Online Serving:
- BAGEL-7B-MoT: user_guide/examples/online_serving/bagel.md
- vLLM-Omni Helm Chart: user_guide/examples/online_serving/chart-helm.md
- Cosmos3: user_guide/examples/online_serving/cosmos3.md
- Diffusers Backend Adapter: user_guide/examples/online_serving/diffusers_pipeline_adapter.md
- GLM-Image Online Serving: user_guide/examples/online_serving/glm_image.md
- Image-To-Image: user_guide/examples/online_serving/image_to_image.md
Expand Down
1 change: 1 addition & 0 deletions docs/models/supported_models.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ th {
| `ZImagePipeline` | Z-Image | `Tongyi-MAI/Z-Image-Turbo` | ✅︎ | ✅︎ | ✅︎ | ✅︎ |
| `WanPipeline` | Wan2.1-T2V, Wan2.2-T2V, Wan2.2-TI2V | `Wan-AI/Wan2.1-T2V-1.3B-Diffusers`, `Wan-AI/Wan2.1-T2V-14B-Diffusers`, `Wan-AI/Wan2.2-T2V-A14B-Diffusers`, `Wan-AI/Wan2.2-TI2V-5B-Diffusers` | ✅︎ | ✅︎ | ✅︎ | ✅︎ |
| `WanImageToVideoPipeline` | Wan2.2-I2V | `Wan-AI/Wan2.2-I2V-A14B-Diffusers` | ✅︎ | ✅︎ | ✅︎ | ✅︎ |
| `Cosmos3OmniDiffusersPipeline` | Cosmos3 T2I, T2V, I2V, T2V with sound, action policy | `nvidia/Cosmos3-Nano` | ✅︎ | | | |
| `WanSpeechToVideoPipeline` | Wan2.2-S2V | `Wan-AI/Wan2.2-S2V-14B` | ✅︎ | ✅︎ | ✅︎ | ✅︎ |
| `Wan22VACEPipeline` | Wan2.1-VACE | `Wan-AI/Wan2.1-VACE-1.3B-diffusers`, `Wan-AI/Wan2.1-VACE-14B-diffusers` | ✅︎ | ✅︎ | ✅︎ | ✅︎ |
| `LTX2Pipeline` | LTX-2-T2V | `Lightricks/LTX-2` | ✅︎ | ✅︎ | | |
Expand Down
20 changes: 20 additions & 0 deletions docs/user_guide/diffusion/cache_acceleration/cache_dit.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,21 @@ python image_edit.py \

See the [image_edit.py](https://github.com/vllm-project/vllm-omni/blob/main/examples/offline_inference/image_to_image/image_edit.py) for detailed configuration options.

For Cosmos3 text-to-video or image-to-video, use the video examples with the Cosmos3 pipeline class:

```bash
cd examples/offline_inference/text_to_video

python text_to_video.py \
--model nvidia/Cosmos3-Nano \
--model-class-name Cosmos3OmniDiffusersPipeline \
--prompt "A small warehouse robot moves a blue box across a clean floor." \
--cache-backend cache_dit \
--num-inference-steps 35
```

Cosmos3 Cache-DiT wraps the GEN denoising path. TeaCache is not implemented for Cosmos3.

### Online Serving

```bash
Expand All @@ -138,6 +153,11 @@ vllm serve Qwen/Qwen-Image --omni --port 8091 --cache-backend cache_dit
vllm serve Qwen/Qwen-Image --omni --port 8091 \
--cache-backend cache_dit \
--cache-config '{"Fn_compute_blocks": 1, "residual_diff_threshold": 0.12}'

# Cosmos3
vllm serve nvidia/Cosmos3-Nano --omni --port 8091 \
--model-class-name Cosmos3OmniDiffusersPipeline \
--cache-backend cache_dit
```

---
Expand Down
2 changes: 2 additions & 0 deletions docs/user_guide/diffusion/cpu_offload_diffusion.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,12 @@ Factory function `get_offload_backend()` selects the appropriate backend based o
| OvisImagePipeline | `AIDC-AI/Ovis-Image-7B` | `OvisImageTransformer2DModel` | - | ✓ | `"transformer"` |
| QwenImagePipeline | `Qwen/Qwen-Image` | `QwenImageTransformer2DModel` | ✓ | ✓ | `"transformer_blocks"` |
| StableDiffusion3Pipeline | `stabilityai/stable-diffusion-3.5-medium` | `SD3Transformer2DModel` | - | ✓ | `"transformer_blocks"` |
| Cosmos3OmniDiffusersPipeline | `nvidia/Cosmos3-Nano` | `Cosmos3VFMTransformer` | - | ✓ | `"gen_layers"` |
| Wan22I2VPipeline | `Wan-AI/Wan2.2-I2V-A14B-Diffusers` | `WanTransformer3DModel` | ✓ | ✓ | `"blocks"` |
| Wan22Pipeline | `Wan-AI/Wan2.2-T2V-A14B-Diffusers` | `WanTransformer3DModel` | ✓ | ✓ | `"blocks"` |
| BagelPipeline | `ByteDance-Seed/BAGEL-7B-MoT` | `Qwen2MoTModel` | - | ✓ | `"layers"`, `"customized modules"` |

**Notes:**
- Model-Level Offloading is expected to be supported by all common diffusion models (DiT and encoders) naturally
- Layerwise Offloading requires DiT class to define `_layerwise_offload_blocks_attrs` pointing to transformer blocks
- Cosmos3 uses the singular `_layerwise_offload_blocks_attr` compatibility path and offloads GEN decoder layers.
9 changes: 9 additions & 0 deletions docs/user_guide/diffusion/parallelism/cfg_parallel.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,15 @@ sampling_params = OmniDiffusionSamplingParams(
)
```

For Cosmos3, use `guidance_scale` rather than `true_cfg_scale`:

```python
sampling_params = OmniDiffusionSamplingParams(
num_inference_steps=35,
guidance_scale=4.0,
)
```

2. **Add negative prompt:**
```python
outputs = omni.generate(
Expand Down
6 changes: 6 additions & 0 deletions docs/user_guide/diffusion_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ The following tables show which models support each feature:
| Model | ⚡TeaCache | ⚡Cache-DiT | 🔀SP (Ulysses & Ring) | 🔀CFG-Parallel | 🔀Tensor-Parallel | 🔀HSDP | 💾CPU Offload (Layerwise) | 💾VAE-Patch-Parallel | 💾Quantization | 🔄Step Execution |
|-------|:----------:|:-----------:|:---------------------:|:--------------:|:-----------------:|:------:|:------------------------:|:--------------------:|:--------------:|:----------------:|
| **Bagel** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
| **Cosmos3 (T2I)** | ❌ | ✅ | ✅ (Ulysses) | ✅ | ✅ | ✅ | ✅ | ✅ (decode) | ✅ | ❌ |
| **FLUX.1-dev** | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ❌ |
| **FLUX.1-schnell** | ❌ | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ❌ |
| **FLUX.2-klein** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ❌ |
Expand Down Expand Up @@ -135,19 +136,24 @@ The following tables show which models support each feature:
> Notes:
> 1. Nextstep_1(T2I) does not support cache acceleration methods such as TeaCache or Cache-DiT.
> 2. `Tongyi-MAI/Z-Image-Turbo` and `SII-GAIR/daVinci-MagiHuman-Base-1080p` are distilled models with minimal NFEs; CFG-Parallel is not necessary.
> 3. Cosmos3 T2I uses `Cosmos3OmniDiffusersPipeline` with `modalities=["image"]`. Model-level CPU offload is not supported; use layerwise offload.

### VideoGen

| Model | ⚡TeaCache | ⚡Cache-DiT | 🔀SP (Ulysses & Ring) | 🔀CFG-Parallel | 🔀Tensor-Parallel | 🔀HSDP | 💾CPU Offload (Layerwise) | 💾VAE-Patch-Parallel | 💾Quantization | 🔄Step Execution |
|-------|:----------:|:-----------:|:---------------------:|:--------------:|:-----------------:|:------:|:------------------------:|:--------------------:|:--------------:|:----------------:|
| **Wan2.2** | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ (encode/decode) | ❌ | ❌ |
| **Cosmos3 (T2V/I2V)** | ❌ | ✅ | ✅ (Ulysses) | ✅ | ✅ | ✅ | ✅ | ✅ (encode/decode) | ✅ | ❌ |
| **Wan2.1-VACE** | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ (decode) | ❌ | ❌ |
| **LTX-2** | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
| **LTX-2.3** | ❌ | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
| **Helios** | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
| **HunyuanVideo-1.5 T2V I2V** | ❌ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ (decode) | ✅ | ❌ |
| **DreamID-Omni** | ❌ | ❌ | ❌ | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |

> Notes:
> 1. Cosmos3 T2V and I2V use `Cosmos3OmniDiffusersPipeline` with video output. I2V is selected when the request includes an input image. Model-level CPU offload is not supported; use layerwise offload.

**Frame Interpolation Support**

- **Supported**: Wan2.2 text-to-video, image-to-video, and TI2V pipelines
Expand Down
90 changes: 90 additions & 0 deletions docs/user_guide/examples/offline_inference/cosmos3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Cosmos3

Source <https://github.com/vllm-project/vllm-omni/tree/main/examples/offline_inference/cosmos3>.


Cosmos3 uses `Cosmos3OmniDiffusersPipeline` for text-to-image, text-to-video, image-to-video, video-with-sound, and action generation. Examples default to the `nvidia/Cosmos3-Nano` Hugging Face repo, but you can override the checkpoint with `--model` or by exporting `COSMOS3_MODEL` to a local Diffusers-format checkpoint.

```bash
cd examples/offline_inference/cosmos3
```

## Text-to-Image

```bash
python end2end.py \
--task t2i \
--prompt "A small warehouse robot carrying a blue box, clean product photography" \
--negative-prompt "blurry, distorted, low quality" \
--output cosmos3_t2i.png
```

## Text-to-Video

```bash
python end2end.py \
--task t2v \
--prompt "A small warehouse robot moves a blue box across a clean floor." \
--negative-prompt "blurry, distorted, low quality" \
--output cosmos3_t2v.mp4
```

## Image-to-Video

Download an example image or provide your own image path.

```bash
wget https://vllm-public-assets.s3.us-west-2.amazonaws.com/vision_model_images/cherry_blossom.jpg

python end2end.py \
--task i2v \
--image cherry_blossom.jpg \
--prompt "Cherry blossoms swaying gently in the breeze, petals falling, smooth motion" \
--negative-prompt "blurry, distorted, low quality" \
--output cosmos3_i2v.mp4
```

## Video With Sound

This path requires a sound-capable Cosmos3 checkpoint with `sound_gen` weights.

```bash
python end2end.py \
--task t2v_sound \
--prompt "A small warehouse robot rolls across the floor with soft motor sounds." \
--negative-prompt "blurry, distorted, low quality" \
--sound-duration 3.4 \
--output cosmos3_t2v_sound.mp4
```

## Action Policy

This path requires an action-capable Cosmos3 checkpoint with `action_gen` weights. The example returns a video plus an action JSON payload. Pass either `--domain-name` or `--domain-id`.

```bash
python end2end.py \
--task action_policy \
--image cherry_blossom.jpg \
--prompt "Predict the robot action for moving toward the target." \
--domain-name bridge_orig_lerobot \
--raw-action-dim 2 \
--action-chunk-size 16 \
--output cosmos3_action_policy.mp4 \
--action-output cosmos3_action_policy_action.json
```

## Common Options

- `--enable-layerwise-offload`: use layerwise offload for memory-constrained runs.
- `--cache-backend cache_dit`: enable Cache-DiT where supported.
- `--cfg-parallel-size 2`, `--ulysses-degree`, `--tensor-parallel-size`, `--use-hsdp`: enable parallel execution options.
- `--height`, `--width`, `--num-frames`, `--num-inference-steps`, `--guidance-scale`, `--fps`: override task defaults.

Do not use model-level `--enable-cpu-offload` for Cosmos3. Use `--enable-layerwise-offload` instead.

## Example materials

??? abstract "end2end.py"
``````py
--8<-- "examples/offline_inference/cosmos3/end2end.py"
``````
92 changes: 92 additions & 0 deletions docs/user_guide/examples/online_serving/cosmos3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Cosmos3

Source <https://github.com/vllm-project/vllm-omni/tree/main/examples/online_serving/cosmos3>.


This example shows Cosmos3 online serving with `Cosmos3OmniDiffusersPipeline`.

The server defaults to the `nvidia/Cosmos3-Nano` Hugging Face repo. Override the checkpoint by exporting `MODEL` or `COSMOS3_MODEL` to a local Diffusers-format checkpoint.

```bash
cd examples/online_serving/cosmos3
bash run_server.sh
```

`run_server.sh` accepts these environment overrides:

- `MODEL`: checkpoint path or Hugging Face repo, defaults to `nvidia/Cosmos3-Nano` (or `COSMOS3_MODEL` if set)
- `PORT`: server port, defaults to `8091`
- `CACHE_BACKEND`: set to `cache_dit` to enable Cache-DiT
- `ENABLE_LAYERWISE_OFFLOAD`: set to `1` to enable layerwise offload
- `CFG_PARALLEL_SIZE`, `TENSOR_PARALLEL_SIZE`, `ULYSSES_DEGREE`, `USE_HSDP`: parallel execution controls
- `ALLOWED_LOCAL_MEDIA_PATH`: local media access path, defaults to `/`

## Text-to-Image

```bash
bash run_curl_t2i.sh
```

The script calls `POST /v1/images/generations`, which selects Cosmos3 text-to-image through `modalities=["image"]` internally.

## Text-to-Video

```bash
bash run_curl_t2v.sh
```

## Image-to-Video

Download an example image or set `IMAGE_PATH` to your own image:

```bash
wget https://vllm-public-assets.s3.us-west-2.amazonaws.com/vision_model_images/cherry_blossom.jpg
IMAGE_PATH=cherry_blossom.jpg bash run_curl_i2v.sh
```

## Video With Sound

This path requires a sound-capable Cosmos3 checkpoint with `sound_gen` weights.

```bash
bash run_curl_t2v_sound.sh
```

The script passes `generate_sound=true` and `sound_duration` to the video endpoint.

## Action Policy

This path requires an action-capable Cosmos3 checkpoint with `action_gen` weights. Pass either `domain_name` or `domain_id` through `extra_params`.

```bash
IMAGE_PATH=cherry_blossom.jpg bash run_curl_action_policy.sh
```

The script uses the asynchronous `POST /v1/videos` job endpoint so it can download the MP4 and save the returned action metadata JSON.

## Example materials

??? abstract "run_curl_action_policy.sh"
``````sh
--8<-- "examples/online_serving/cosmos3/run_curl_action_policy.sh"
``````
??? abstract "run_curl_i2v.sh"
``````sh
--8<-- "examples/online_serving/cosmos3/run_curl_i2v.sh"
``````
??? abstract "run_curl_t2i.sh"
``````sh
--8<-- "examples/online_serving/cosmos3/run_curl_t2i.sh"
``````
??? abstract "run_curl_t2v.sh"
``````sh
--8<-- "examples/online_serving/cosmos3/run_curl_t2v.sh"
``````
??? abstract "run_curl_t2v_sound.sh"
``````sh
--8<-- "examples/online_serving/cosmos3/run_curl_t2v_sound.sh"
``````
??? abstract "run_server.sh"
``````sh
--8<-- "examples/online_serving/cosmos3/run_server.sh"
``````
80 changes: 80 additions & 0 deletions examples/offline_inference/cosmos3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Cosmos3

Cosmos3 uses `Cosmos3OmniDiffusersPipeline` for text-to-image, text-to-video, image-to-video, video-with-sound, and action generation. Examples default to the `nvidia/Cosmos3-Nano` Hugging Face repo, but you can override the checkpoint with `--model` or by exporting `COSMOS3_MODEL` to a local Diffusers-format checkpoint.

```bash
cd examples/offline_inference/cosmos3
```

## Text-to-Image

```bash
python end2end.py \
--task t2i \
--prompt "A small warehouse robot carrying a blue box, clean product photography" \
--negative-prompt "blurry, distorted, low quality" \
--output cosmos3_t2i.png
```

## Text-to-Video

```bash
python end2end.py \
--task t2v \
--prompt "A small warehouse robot moves a blue box across a clean floor." \
--negative-prompt "blurry, distorted, low quality" \
--output cosmos3_t2v.mp4
```

## Image-to-Video

Download an example image or provide your own image path.

```bash
wget https://vllm-public-assets.s3.us-west-2.amazonaws.com/vision_model_images/cherry_blossom.jpg

python end2end.py \
--task i2v \
--image cherry_blossom.jpg \
--prompt "Cherry blossoms swaying gently in the breeze, petals falling, smooth motion" \
--negative-prompt "blurry, distorted, low quality" \
--output cosmos3_i2v.mp4
```

## Video With Sound

This path requires a sound-capable Cosmos3 checkpoint with `sound_gen` weights.

```bash
python end2end.py \
--task t2v_sound \
--prompt "A small warehouse robot rolls across the floor with soft motor sounds." \
--negative-prompt "blurry, distorted, low quality" \
--sound-duration 3.4 \
--output cosmos3_t2v_sound.mp4
```

## Action Policy

This path requires an action-capable Cosmos3 checkpoint with `action_gen` weights. The example returns a video plus an action JSON payload. Pass either `--domain-name` or `--domain-id`.

```bash
python end2end.py \
--task action_policy \
--image cherry_blossom.jpg \
--prompt "Predict the robot action for moving toward the target." \
--domain-name bridge_orig_lerobot \
--raw-action-dim 2 \
--action-chunk-size 16 \
--output cosmos3_action_policy.mp4 \
--action-output cosmos3_action_policy_action.json
```

## Common Options

- `--enable-layerwise-offload`: use layerwise offload for memory-constrained runs.
- `--cache-backend cache_dit`: enable Cache-DiT where supported.
- `--cfg-parallel-size 2`, `--ulysses-degree`, `--tensor-parallel-size`, `--use-hsdp`: enable parallel execution options.
- `--height`, `--width`, `--num-frames`, `--num-inference-steps`, `--guidance-scale`, `--fps`: override task defaults.

Do not use model-level `--enable-cpu-offload` for Cosmos3. Use `--enable-layerwise-offload` instead.
Loading
Loading