Skip to content

[Bugfix] Fix default sampling params for /v1/videos on main#3049

Merged
hsliuustc0106 merged 3 commits intovllm-project:mainfrom
david6666666:fix-default-video-sampling-params-main
Apr 23, 2026
Merged

[Bugfix] Fix default sampling params for /v1/videos on main#3049
hsliuustc0106 merged 3 commits intovllm-project:mainfrom
david6666666:fix-default-video-sampling-params-main

Conversation

@david6666666
Copy link
Copy Markdown
Collaborator

Summary

  • initialize /v1/videos and /v1/videos/sync sampling params from the engine stage defaults before request overrides
  • treat frame interpolation form fields as optional so omitted request fields no longer overwrite --default-sampling-params
  • add regression tests for async and sync video paths covering default propagation and explicit per-request overrides

Validation

  • pre-commit run --all-files
  • pytest -q tests/entrypoints/openai_api/test_video_server.py -k 'default_sampling_params_apply_to_video_requests or request_params_override_default_video_sampling_params or sync_default_sampling_params_apply_to_video_requests or frame_interpolation_params_pass_to_diffusion_sampling_params or sync_frame_interpolation_params_pass_to_sampling_params or sync_sampling_params_pass_through'
  • manual E2E with vllm 0.19.0 on Wan-AI/Wan2.2-I2V-A14B-Diffusers using:
    • CUDA_VISIBLE_DEVICES=5,6 vllm serve ... --omni --port 8099 --enable-diffusion-pipeline-profiler --ulysses-degree 2 --default-sampling-params '{"0":{"enable_frame_interpolation":true,"frame_interpolation_exp":1,"frame_interpolation_scale":1.0,"frame_interpolation_model_path":"/mnt/data1/huggingface/hub/models--elfgum--RIFE-4.22.lite/snapshots/99d6892a9f4c039cb37ff21c9530e79b13f0b30b"}}'
    • python curl_output/curl_w22_normal.py
    • result: request completed successfully, server logged steps=8 guidance=3.5 guidance_2=3.5 seed=42, and output MP4 had average_rate=32.0 for request fps=16, confirming default frame interpolation still applied

Fixes #3017.

Signed-off-by: david6666666 <530634352@qq.com>
@david6666666 david6666666 changed the title Fix default sampling params for /v1/videos on main [Bugfix] Fix default sampling params for /v1/videos on main Apr 23, 2026
@david6666666
Copy link
Copy Markdown
Collaborator Author

david6666666 commented Apr 23, 2026

CUDA_VISIBLE_DEVICES=5,6 vllm serve /mnt/data1/huggingface/hub/models--Wan-AI--Wan2.2-I2V-A14B-Diffusers/snapshots/596658fd9ca6b7b71d5057529bbf319ecbc61d74 --omni --port 8099 --enable-diffusion-pipeline-profiler --ulysses-degree 2 --default-sampling-params '{"0":{"enable_frame_interpolation":true,"frame_interpolation_exp":1,"frame_interpolation_scale":1.0,"frame_interpolation_model_path":"/mnt/data1/huggingface/hub/models--elfgum--RIFE-4.22.lite/snapshots/99d6892a9f4c039cb37ff21c9530e79b13f0b30b"}}'
import json, os, pathlib, time, requests, sys
base = 'http://127.0.0.1:8099'
image_path = '/mnt/data4/cwq/tmp/rabbit_real.png'
out_path = '/mnt/data4/cwq/tmp/wan22_bench_out.mp4'
prompt = '一只棕色野兔的正面特写镜头,采用低角度仰拍视角,营造亲密而庄严的视觉冲击。兔子一双圆润漆黑的大眼睛直视镜头深处,眼神中交织着野生动物的警觉与一丝难以言喻的温柔好奇,仿佛在与观者建立跨越物种的静默对话。它毛色呈现层次丰富的棕褐渐变,从浅奶油色腹部过渡到深棕背部,每根毛发纹理清晰可辨,在侧光下泛着丝绸般的光泽。细长洁白的胡须共有三对,随呼吸节奏微微颤动,偶尔因捕捉气流信息而轻轻摇摆。\n两只标志性的长耳完全竖立,耳廓外侧覆盖短密棕毛,内侧则露出粉嫩的血管网络,薄如蝉翼的皮肤下血液流动隐约可见,耳朵以细微幅度不时转动,精准定位声源方向。背景是一片澄澈的蔚蓝天空,形态蓬松的白色积云以缓慢速度横向漂移,云影在兔子头顶交替变化,光线随之明暗流转。晴朗天气的明媚阳光从画面左上方45度角倾泻而下,在兔脸右侧形成柔和的伦勃朗式阴影,强化了面部立体感和皮毛质感。\n兔子湿润的黑鼻子持续进行每秒三至四次的快速抽动,这是它们感知化学信号的本能动作,粉色三瓣嘴随之轻启,露出正在反刍的洁白门齿,下颌以稳定节奏左右研磨。摄影采用大光圈浅景深,焦点牢牢锁定在兔子双眼连线所在的焦平面,背景天空和远景绿色植被虚化成圆润的彩色光斑,前景几根嫩绿草叶闯入画面边缘,以缓慢弧线随风摇曳,暗示着和煦的春日微风。\n整个场景弥漫着宁静致远的田园诗意,色彩温暖饱和,充满生命力。兔子在持续五秒的对视后,以典型 lagomorph 特征完成一次完整的瞬膜眨眼——第三眼睑从内侧横向滑过眼球,继而缓缓歪头向右十五度,这个行为在动物行为学中代表认知加工和好奇心表达,耳朵随之向同一方向倾斜,最终恢复正视姿态,胡须舒展,完成这段短暂而珍贵的自然纪录。'
negative = '色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走'

data = {'prompt': prompt, 'negative_prompt': negative, 'size': '1280x720', 'seconds': '5', 'fps': '16', 'num_inference_steps': '8', 'guidance_scale': '3.5', 'guidance_scale_2': '3.5', 'boundary_ratio': '0.875', 'num_frames': '81', 'flow_shift': '5.0', 'seed': '42'}

with open(image_path, 'rb') as img:
    t0 = time.perf_counter()
    create = requests.post(f'{base}/v1/videos', headers={'Accept': 'application/json'}, data=data, files={'input_reference': (os.path.basename(image_path), img, 'image/png')}, timeout=1200)
    
create.raise_for_status()
video_id = create.json()['id']

while True:
    resp = requests.get(f'{base}/v1/videos/{video_id}', timeout=30)
    resp.raise_for_status()
    payload = resp.json()
    if payload.get('status') in ('completed', 'failed'):
        final_json = payload
        break
    time.sleep(1.0)

download = requests.get(f'{base}/v1/videos/{video_id}/content', timeout=1200)
download.raise_for_status()
pathlib.Path(out_path).write_bytes(download.content)
t3 = time.perf_counter()

result = {
    'artifact_ready_wall_s': round(t3 - t0, 3),
    'server_inference_time_s': final_json.get('inference_time_s'),
    'final_status': final_json.get('status'),
}
print(json.dumps(result, ensure_ascii=False, indent=2))
wan22_bench_out.mp4

@david6666666 david6666666 added the ready label to trigger buildkite CI label Apr 23, 2026
@hsliuustc0106 hsliuustc0106 merged commit f327cd1 into vllm-project:main Apr 23, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready label to trigger buildkite CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: In WAN2.2, the frame interpolation function is enabled by adding an interpolation parameter to the default sampling param, but this does not work

2 participants