diff --git a/docs/.nav.yml b/docs/.nav.yml index dfc21218b..ad8545524 100644 --- a/docs/.nav.yml +++ b/docs/.nav.yml @@ -11,6 +11,7 @@ nav: - examples/README.md - Offline Inference: - Image-To-Image: user_guide/examples/offline_inference/image_to_image.md + - Image-To-Video: user_guide/examples/offline_inference/image_to_video.md - Qwen2.5-Omni: user_guide/examples/offline_inference/qwen2_5_omni.md - Qwen3-Omni: user_guide/examples/offline_inference/qwen3_omni.md - Text-To-Image: user_guide/examples/offline_inference/text_to_image.md diff --git a/docs/user_guide/examples/offline_inference/image_to_video.md b/docs/user_guide/examples/offline_inference/image_to_video.md new file mode 100644 index 000000000..32c655ffd --- /dev/null +++ b/docs/user_guide/examples/offline_inference/image_to_video.md @@ -0,0 +1,66 @@ +# Image-To-Video + +Source . + + +This example demonstrates how to generate videos from images using Wan2.2 Image-to-Video models with vLLM-Omni's offline inference API. + +## Local CLI Usage + +### Wan2.2-I2V-A14B-Diffusers (MoE) +```bash +python image_to_video.py \ + --model Wan-AI/Wan2.2-I2V-A14B-Diffusers \ + --image input.png \ + --prompt "A cat playing with yarn, smooth motion" \ + --negative_prompt "" \ + --height 480 \ + --width 832 \ + --num_frames 48 \ + --guidance_scale 5.0 \ + --guidance_scale_high 6.0 \ + --num_inference_steps 40 \ + --boundary_ratio 0.875 \ + --flow_shift 12.0 \ + --fps 16 \ + --output i2v_output.mp4 +``` + +### Wan2.2-TI2V-5B-Diffusers (Unified) +```bash +python image_to_video.py \ + --model Wan-AI/Wan2.2-TI2V-5B-Diffusers \ + --image input.png \ + --prompt "A cat playing with yarn, smooth motion" \ + --negative_prompt "" \ + --height 480 \ + --width 832 \ + --num_frames 48 \ + --guidance_scale 4.0 \ + --num_inference_steps 40 \ + --flow_shift 12.0 \ + --fps 16 \ + --output i2v_output.mp4 +``` + +Key arguments: + +- `--model`: Model ID (I2V-A14B for MoE, TI2V-5B for unified T2V+I2V). +- `--image`: Path to input image (required). +- `--prompt`: Text description of desired motion/animation. +- `--height/--width`: Output resolution (auto-calculated from image if not set). Dimensions should be multiples of 16. +- `--num_frames`: Number of frames (default 81). +- `--guidance_scale` and `--guidance_scale_high`: CFG scale (applied to low/high-noise stages for MoE). +- `--negative_prompt`: Optional list of artifacts to suppress. +- `--boundary_ratio`: Boundary split ratio for two-stage MoE models. +- `--flow_shift`: Scheduler flow shift (5.0 for 720p, 12.0 for 480p). +- `--num_inference_steps`: Number of denoising steps (default 50). +- `--fps`: Frames per second for the saved MP4 (requires `diffusers` export_to_video). +- `--output`: Path to save the generated video. + +## Example materials + +??? abstract "image_to_video.py" + ``````py + --8<-- "examples/offline_inference/image_to_video/image_to_video.py" + `````` diff --git a/docs/user_guide/examples/offline_inference/qwen2_5_omni.md b/docs/user_guide/examples/offline_inference/qwen2_5_omni.md index f26cc4e62..07a56cf9a 100644 --- a/docs/user_guide/examples/offline_inference/qwen2_5_omni.md +++ b/docs/user_guide/examples/offline_inference/qwen2_5_omni.md @@ -2,6 +2,7 @@ Source . + ## Setup Please refer to the [stage configuration documentation](https://docs.vllm.ai/projects/vllm-omni/en/latest/configuration/stage_configs/) to configure memory allocation appropriately for your hardware setup. diff --git a/docs/user_guide/examples/offline_inference/qwen3_omni.md b/docs/user_guide/examples/offline_inference/qwen3_omni.md index ffbcb6b1a..2e28f7dea 100644 --- a/docs/user_guide/examples/offline_inference/qwen3_omni.md +++ b/docs/user_guide/examples/offline_inference/qwen3_omni.md @@ -2,6 +2,7 @@ Source . + ## Setup Please refer to the [stage configuration documentation](https://docs.vllm.ai/projects/vllm-omni/en/latest/configuration/stage_configs/) to configure memory allocation appropriately for your hardware setup. diff --git a/docs/user_guide/examples/online_serving/image_to_image.md b/docs/user_guide/examples/online_serving/image_to_image.md index 0cf6339c4..b89f0fe82 100644 --- a/docs/user_guide/examples/online_serving/image_to_image.md +++ b/docs/user_guide/examples/online_serving/image_to_image.md @@ -230,6 +230,10 @@ Provide multiple images in `content` (order matters): ``````py --8<-- "examples/online_serving/image_to_image/openai_chat_client.py" `````` +??? abstract "run_curl_image_edit.sh" + ``````sh + --8<-- "examples/online_serving/image_to_image/run_curl_image_edit.sh" + `````` ??? abstract "run_server.sh" ``````sh --8<-- "examples/online_serving/image_to_image/run_server.sh" diff --git a/docs/user_guide/examples/online_serving/qwen2_5_omni.md b/docs/user_guide/examples/online_serving/qwen2_5_omni.md index c59306d1f..361044ed8 100644 --- a/docs/user_guide/examples/online_serving/qwen2_5_omni.md +++ b/docs/user_guide/examples/online_serving/qwen2_5_omni.md @@ -137,6 +137,7 @@ response = client.chat.completions.create( # Response contains two choices: one with text, one with audio print(response.choices[0].message.content) # Text response print(response.choices[1].message.audio) # Audio response +``` ## Streaming Output If you want to enable streaming output, please set the argument as below. The final output will be obtained just after generated by corresponding stage. Now we only support text streaming output. Other modalities can output normally. diff --git a/docs/user_guide/examples/online_serving/qwen3_omni.md b/docs/user_guide/examples/online_serving/qwen3_omni.md index 5ea4818a6..cd9198228 100644 --- a/docs/user_guide/examples/online_serving/qwen3_omni.md +++ b/docs/user_guide/examples/online_serving/qwen3_omni.md @@ -145,6 +145,7 @@ response = client.chat.completions.create( # Response contains two choices: one with text, one with audio print(response.choices[0].message.content) # Text response print(response.choices[1].message.audio) # Audio response +``` ## Streaming Output If you want to enable streaming output, please set the argument as below. The final output will be obtained just after generated by corresponding stage. Now we only support text streaming output. Other modalities can output normally. diff --git a/examples/online_serving/qwen2_5_omni/README.md b/examples/online_serving/qwen2_5_omni/README.md index 5fcf69df3..1fac9805a 100644 --- a/examples/online_serving/qwen2_5_omni/README.md +++ b/examples/online_serving/qwen2_5_omni/README.md @@ -134,6 +134,7 @@ response = client.chat.completions.create( # Response contains two choices: one with text, one with audio print(response.choices[0].message.content) # Text response print(response.choices[1].message.audio) # Audio response +``` ## Streaming Output If you want to enable streaming output, please set the argument as below. The final output will be obtained just after generated by corresponding stage. Now we only support text streaming output. Other modalities can output normally. diff --git a/examples/online_serving/qwen3_omni/README.md b/examples/online_serving/qwen3_omni/README.md index 0a57738b4..9c1f411f8 100644 --- a/examples/online_serving/qwen3_omni/README.md +++ b/examples/online_serving/qwen3_omni/README.md @@ -142,6 +142,7 @@ response = client.chat.completions.create( # Response contains two choices: one with text, one with audio print(response.choices[0].message.content) # Text response print(response.choices[1].message.audio) # Audio response +``` ## Streaming Output If you want to enable streaming output, please set the argument as below. The final output will be obtained just after generated by corresponding stage. Now we only support text streaming output. Other modalities can output normally.