Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ def edit_image(

# Build extra_body with generation parameters
extra_body = {}
if height is not None:
extra_body["height"] = height
if width is not None:
extra_body["width"] = width
Comment on lines +79 to +82

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow omitting explicit height/width in chat client

After this change, edit_image forwards height/width whenever they are non-None, but main() still sets both CLI args to default 1024, so running the documented command without --height/--width now always sends square dimensions and disables the server’s auto aspect-ratio sizing path for non-square inputs. This is a behavior regression introduced by wiring these fields; if the intent is “optional explicit dims,” the parser defaults need to be None (or equivalent flag-presence detection) so omitted flags stay omitted in extra_body.

Useful? React with 👍 / 👎.

if steps is not None:
extra_body["num_inference_steps"] = steps
if guidance_scale is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ REQUEST_JSON=$(
]
}],
extra_body: {
height: 1024,
width: 1024,
num_inference_steps: 50,
guidance_scale: 1,
seed: 42
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ def pre_process_func(
if image is not None and not (
isinstance(image, torch.Tensor) and len(image.shape) > 1 and image.shape[1] == latent_channels
):
image = image_processor.resize(image, height, width)
image = image_processor.resize(image, calculated_height, calculated_width)
prompt_image = image
image = image_processor.preprocess(image, height, width)
image = image_processor.preprocess(image, calculated_height, calculated_width)
image = image.unsqueeze(2)

# Store preprocessed image and prompt image in request
Expand Down