[Bugfix][cherry-pick]: /images/edits endpoint fails pipeline data format check (#1173)

Signed-off-by: Huang, Zeyu <11222265+fhfuih@users.noreply.github.com>
Co-authored-by: Huang, Zeyu <11222265+fhfuih@users.noreply.github.com>
This commit is contained in:
dengyunyangandHuang, Zeyu authored and GitHub committed 2026-02-03 13:55:19 +08:00
1 parent ed89c8b043
commit 9505ba30ab
3 files changed
+27 -15

No files matched your search

@@ -72,11 +72,15 @@ def get_longcat_image_edit_pre_process_func(
if "additional_information" not in prompt:
prompt["additional_information"] = {}
if raw_image is None or isinstance(raw_image, list):
raise ValueError(
"""Received no image or a list of image. Only a single image is supported by this model."""
"""Please correctly set `"multi_modal_data": {"image": <an image object or file path>, …}`"""
)
if not raw_image: # None or empty list
raise ValueError("""Received no input image. This model requires one input image to run.""")
elif isinstance(raw_image, list):
if len(raw_image) > 1:
raise ValueError(
"""Received multiple input images. Only a single image is supported by this model."""
)
else:
raw_image = raw_image[0]
if isinstance(raw_image, str):
image = PIL.Image.open(raw_image)
@@ -75,11 +75,15 @@ def get_qwen_image_edit_pre_process_func(
prompt["additional_information"] = {}
# Only handles single image
if raw_image is None or isinstance(raw_image, list):
raise ValueError(
"""Received no image or a list of image. Only a single image is supported by this model."""
"""Please correctly set `"multi_modal_data": {"image": <an image object or file path>, …}`"""
)
if not raw_image: # None or empty list
raise ValueError("""Received no input image. This model requires one input image to run.""")
elif isinstance(raw_image, list):
if len(raw_image) > 1:
raise ValueError(
"""Received multiple input images. Only a single image is supported by this model."""
)
else:
raw_image = raw_image[0]
if isinstance(raw_image, str):
image = PIL.Image.open(raw_image)
@@ -79,11 +79,15 @@ def get_qwen_image_layered_pre_process_func(
if "additional_information" not in prompt:
prompt["additional_information"] = {}
if raw_image is None or isinstance(raw_image, list):
raise ValueError(
"""Received no image or a list of image. Only a single image is supported by this model."""
"""Please correctly set `"multi_modal_data": {"image": <an image object or file path>, …}`"""
)
if not raw_image: # None or empty list
raise ValueError("""Received no input image. This model requires one input image to run.""")
elif isinstance(raw_image, list):
if len(raw_image) > 1:
raise ValueError(
"""Received multiple input images. Only a single image is supported by this model."""
)
else:
raw_image = raw_image[0]
if isinstance(raw_image, str):
image = PIL.Image.open(raw_image)