[Bugfix] Honor the requested output canvas in BAGEL img2img (#7287)
Signed-off-by: Ding Zuhao <e1583181@u.nus.edu> Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
86fcfe95f1
commit
154a1f25f5
8 files changed
+391
-27
No files matched your search
@@ -128,6 +128,7 @@ from vllm_omni.entrypoints.openai.images.helpers import (
|
||||
_check_max_generated_image_size,
|
||||
_choose_output_format,
|
||||
_extract_images_from_result,
|
||||
_generated_size_str,
|
||||
_get_max_edit_input_images,
|
||||
_load_input_images,
|
||||
_update_if_not_none,
|
||||
@@ -2002,8 +2003,9 @@ def _build_image_generation_response(
|
||||
peak_memory_mb=peak_memory_mb,
|
||||
),
|
||||
}
|
||||
if request.size is not None:
|
||||
response_kwargs["size"] = request.size
|
||||
size = _generated_size_str(images, request.size)
|
||||
if size is not None:
|
||||
response_kwargs["size"] = size
|
||||
response = ImageGenerationResponse(**response_kwargs)
|
||||
if request.response_format == ResponseFormat.FILE:
|
||||
return response.stream_response()
|
||||
@@ -2428,6 +2430,8 @@ async def edit_images(
|
||||
|
||||
_update_if_not_none(gen_params, "width", width)
|
||||
_update_if_not_none(gen_params, "height", height)
|
||||
gen_params.width_not_provided = size_was_auto
|
||||
gen_params.height_not_provided = size_was_auto
|
||||
|
||||
# 3.4 Add optional parameters ONLY if provided
|
||||
_update_if_not_none(gen_params, "num_inference_steps", num_inference_steps)
|
||||
@@ -2580,7 +2584,7 @@ async def edit_images(
|
||||
created=int(time.time()),
|
||||
data=image_data,
|
||||
output_format=output_format,
|
||||
size=size_str,
|
||||
size=_generated_size_str(images, size_str),
|
||||
cot_output=cot_output,
|
||||
metrics=_build_image_response_metrics(
|
||||
response_metrics=response_metrics,
|
||||
|
||||
Reference in new issue
Block a user