[Bugfix] GLM-Image: route t2i requests through the multimodal processor (#3034) (#3189)

Signed-off-by: Piotr Tarasiewicz <ptarasiewicz@nvidia.com>
This commit is contained in:
ptarasiewiczNV authored and GitHub committed 2026-05-04 21:07:53 +08:00
1 parent bb69cbc9f1
commit 9a53703676
3 files changed
+47 -4

No files matched your search

+7 -3
View File
@@ -356,14 +356,18 @@ class OmniOpenAIServingChat(OpenAIServingChat, AudioMixin):
tprompt["modalities"] = ["image"]
if negative_prompt is not None:
tprompt["negative_prompt"] = negative_prompt
# GLM-Image's _call_hf_processor expects target_h/target_w in mm_processor_kwargs
# Always attach mm_processor_kwargs (possibly empty) so
# OmniInputPreprocessor._process_text routes through the
# multimodal processor path. Without it, the preprocessor
# falls back to plain _tokenize_prompt and AR-based image-gen
# models like GLM-Image never see their image-generation
# scaffold.
mm_processor_kwargs: dict[str, Any] = {}
if height is not None:
mm_processor_kwargs["target_h"] = height
if width is not None:
mm_processor_kwargs["target_w"] = width
if mm_processor_kwargs:
tprompt["mm_processor_kwargs"] = mm_processor_kwargs
tprompt["mm_processor_kwargs"] = mm_processor_kwargs
if engine_prompt_image is not None:
tprompt["multi_modal_data"] = engine_prompt_image
# Provide multi_modal_uuids so that newer vLLM versions