diff --git a/components/src/dynamo/vllm/omni/omni_handler.py b/components/src/dynamo/vllm/omni/omni_handler.py index e7dbee1b1bc8..a55266950a63 100644 --- a/components/src/dynamo/vllm/omni/omni_handler.py +++ b/components/src/dynamo/vllm/omni/omni_handler.py @@ -810,5 +810,6 @@ def _engine_inputs_from_video( sampling_params_list=sampling_params_list, request_type=RequestType.VIDEO_GENERATION, fps=fps, + response_format=req.response_format, lora_request=lora_request, ) diff --git a/components/src/dynamo/vllm/tests/omni/test_omni_handler.py b/components/src/dynamo/vllm/tests/omni/test_omni_handler.py index f82000e003d2..d6dcf00d41f4 100644 --- a/components/src/dynamo/vllm/tests/omni/test_omni_handler.py +++ b/components/src/dynamo/vllm/tests/omni/test_omni_handler.py @@ -203,6 +203,27 @@ async def test_video_generation(self): assert inputs.request_type == RequestType.VIDEO_GENERATION assert inputs.prompt["prompt"] == "a drone" assert inputs.fps > 0 + assert inputs.response_format is None + + @pytest.mark.parametrize("response_format", ["b64_json", "url"]) + @pytest.mark.asyncio + async def test_video_and_i2v_forward_response_format(self, response_format): + """T2V and I2V share _engine_inputs_from_video; b64_json must not be dropped.""" + handler = _make_handler() + req = NvCreateVideoRequest( + prompt="a drone", + model="test-model", + size="832x480", + response_format=response_format, + ) + t2v = await handler.build_engine_inputs(req, RequestType.VIDEO_GENERATION) + assert t2v.response_format == response_format + + img = Image.new("RGB", (64, 64), color="red") + i2v = await handler.build_engine_inputs( + req, RequestType.VIDEO_GENERATION, image=img + ) + assert i2v.response_format == response_format @pytest.mark.asyncio async def test_audio_generation_delegates_toaudio(self):