Instructions to use nvidia/Cosmos3-Super-Image2Video-4Step with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Cosmos
How to use nvidia/Cosmos3-Super-Image2Video-4Step 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
- Notebooks
- Google Colab
- Kaggle
Add Diffusers usage section for the distilled 4-step I2V pipeline
#22
by yzhautouskay - opened
Files changed (3)
37 unmodified lines3839404137 unmodified linesassets/example_output.mp4 filter=lfs diff=lfs merge=lfs -textimages/aa-i2v-all-models-2026-07-17.png filter=lfs diff=lfs merge=lfs -textimages/aa-i2v-open-models-2026-07-17.png filter=lfs diff=lfs merge=lfs -textassets/example_output_diffusers.mp4 filter=lfs diff=lfs merge=lfs -text195 unmodified lines196197198199200201202288 unmodified lines49149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956016 unmodified lines577578579515580581582583195 unmodified lines
- [PyTorch](https://github.com/nvidia/cosmos3)- [vLLM-Omni](https://github.com/vllm-project/vllm-omni)- [Hugging Face Diffusers](https://github.com/huggingface/diffusers)
**Supported Hardware Microarchitecture Compatibility:**
288 unmodified lines
<video controls width="832" height="480" src="https://huggingface.co/nvidia/Cosmos3-Super-Image2Video-4Step/resolve/main/assets/example_output.mp4"></video>
## Usage: Run Inference with Diffusers
`Cosmos3-Super-Image2Video-4Step` is supported by the Hugging Face Diffusers **modular** pipeline. The distilled checkpoint is not compatible with `Cosmos3OmniPipeline` or `Cosmos3OmniModularPipeline`; it must be loaded with `Cosmos3DistilledModularPipeline`.
### Install
Install Diffusers from the main branch until a release containing `Cosmos3DistilledModularPipeline` is available:
```bashuv venv --python 3.13 --seed --managed-pythonsource .venv/bin/activateuv pip install \ "diffusers @ git+https://github.com/huggingface/diffusers.git" \ accelerate \ av \ cosmos_guardrail \ huggingface_hub \ imageio \ imageio-ffmpeg \ torch \ torchvision \ transformers```
The safety checker requires access to the gated [nvidia/Cosmos-1.0-Guardrail](https://huggingface.co/nvidia/Cosmos-1.0-Guardrail) repository.
### Example: Image to Video Generation
```pythonimport json
import torchfrom diffusers import Cosmos3DistilledModularPipelinefrom diffusers.utils import export_to_video, load_image
json_prompt = json.load(open("assets/example_prompt.json"))image = load_image("assets/example_first_frame.png")
pipe = Cosmos3DistilledModularPipeline.from_pretrained("nvidia/Cosmos3-Super-Image2Video-4Step")pipe.load_components(torch_dtype=torch.bfloat16)pipe.enable_safety_checker()pipe.to("cuda")
videos = pipe( prompt=json_prompt["prompt"], image=image, num_frames=189, height=480, width=832, fps=24, add_resolution_template=False, add_duration_template=False, output="videos",)export_to_video(videos, "cosmos3_i2v_4step_diffusers.mp4", fps=24, macro_block_size=1)print("Saved video to cosmos3_i2v_4step_diffusers.mp4")```
The 4-step schedule and the guidance scale come from the checkpoint: `num_inference_steps` is fixed to the length of the distilled sigma schedule and `guidance_scale` is forced to `1.0`, so passing any other value raises an error. `negative_prompt` is ignored, and unlike the base Cosmos3 models there is no scheduler to swap in and no `flow_shift` to set.
Example output generated from `assets/example_first_frame.png`:
<video controls width="832" height="480" src="https://huggingface.co/nvidia/Cosmos3-Super-Image2Video-4Step/resolve/main/assets/example_output_diffusers.mp4"></video>
### Inferencing with Custom Prompts
`Cosmos3-Super-Image2Video-4Step` supports dense natural-language prompts together with a first-frame image, and it also supports JSON-format upsampled prompts for improved quality. The recommended way to prepare an upsampled prompt is to use [Prepare Prompts with Prompt Upsampling](#usage-prepare-prompts-with-prompt-upsampling). The helper below is a simple proof-of-concept script for building a JSON-format prompt from a custom natural-language instruction and the input image. It requires an OpenAI-compatible VLM model like `claude-opus-4.7` and `gpt-5.5`.16 unmodified lines
## Inference
**Acceleration Engine:** [PyTorch](https://pytorch.org/), [vLLM-Omni](https://github.com/vllm-project/vllm-omni)**Acceleration Engine:** [PyTorch](https://pytorch.org/), [vLLM-Omni](https://github.com/vllm-project/vllm-omni), [Hugging Face Diffusers](https://github.com/huggingface/diffusers)
**Test Hardware:** RTX PRO 6000, H20, H100, H200, B200
123version https://git-lfs.github.com/spec/v1oid sha256:7337f6ae74b214bcca061c7de85e952e8cd8206d69755e8fb2fdb46784aa2641size 1135801.gitattributes+1
README.md+66-1
assets/example_output_diffusers.mp4Added+3