[fix bug] add default limit for image generation (#3381)

Signed-off-by: Junhong Liu <98734602+LJH-LBJ@users.noreply.github.com>
Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
Co-authored-by: lishunyang <lishunyang12@163.com>
Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2026-06-16 22:54:26 +08:00
1 parent e3621ec633
commit f200e988a6
3 files changed
+59 -5

No files matched your search

+4 -2
View File
@@ -2333,7 +2333,8 @@ def _check_max_generated_image_size(
raise HTTPException(
status_code=HTTPStatus.BAD_REQUEST.value,
detail=f"Requested image size {width}x{height} exceeds the maximum allowed "
f"size of {max_generated_image_size} pixels.",
f"size of {max_generated_image_size} pixels. You can reduce the requested size "
f"or increase the server's --max-generated-image-size limit.",
)
elif resolution is not None:
# When resolution is set, the output size is resolution * resolution
@@ -2341,7 +2342,8 @@ def _check_max_generated_image_size(
raise HTTPException(
status_code=HTTPStatus.BAD_REQUEST.value,
detail=f"Requested resolution {resolution} (max {resolution}x{resolution} pixels) "
f"exceeds the maximum allowed size of {max_generated_image_size} pixels.",
f"exceeds the maximum allowed size of {max_generated_image_size} pixels. "
f"You can reduce the requested size or increase the server's --max-generated-image-size limit.",
)