[feat] Streaming diffusion video generation output (#3737)

Signed-off-by: Huang, Zeyu <11222265+fhfuih@users.noreply.github.com>
Signed-off-by: Zeyu Huang | 黃澤宇 <11222265+fhfuih@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
authored and GitHub committed 2026-06-23 09:57:53 +00:00
1 parent b84c99c122
commit 3901ad8165
42 files changed
+4322 -65

No files matched your search

@@ -132,6 +132,7 @@ from vllm_omni.entrypoints.openai.serving_video import (
ReferenceImage,
ReferenceVideo,
)
from vllm_omni.entrypoints.openai.serving_video_output_stream import OmniStreamingVideoOutputHandler
from vllm_omni.entrypoints.openai.serving_video_stream import create_streaming_video_handler
from vllm_omni.entrypoints.openai.stage_params import (
build_stage_sampling_params_list,
@@ -774,6 +775,11 @@ async def omni_init_app_state(
model_name=model_name,
stage_configs=diffusion_stage_configs,
)
state.openai_streaming_video_output = OmniStreamingVideoOutputHandler(
engine_client=engine_client,
model_name=model_name,
stage_configs=diffusion_stage_configs,
)
state.openai_serving_speech = OmniOpenAIServingSpeech.for_diffusion(
diffusion_engine=engine_client,
@@ -1594,6 +1600,23 @@ async def streaming_video_chat(websocket: WebSocket):
await handler.handle_session(websocket)
@router.websocket("/v1/realtime/video")
async def streaming_video_output(websocket: WebSocket):
"""WebSocket endpoint for streaming generated video output chunks."""
handler = getattr(websocket.app.state, "openai_streaming_video_output", None)
if handler is None:
await websocket.accept()
await websocket.send_json(
{
"type": "error",
"message": "Streaming video generation is not available",
}
)
await websocket.close()
return
await handler.handle_session(websocket)
@router.websocket("/v1/realtime")
async def realtime_websocket(websocket: WebSocket):
"""WebSocket endpoint for OpenAI-style realtime interactions."""