Skip to content

[Bug]: Fix: Enforce --max-generated-image-size limit in image generation requests #2586

@sustech-lz

Description

@sustech-lz

Your current environment

None

Your code version

The commit id or version of vllm
v0.18.0
The commit id or version of vllm-omni
v0.18.0 post1

🐛 Describe the bug

When serving an image generation model (e.g., Qwen image model) using vllm serve with the --omni flag, the --max-generated-image-size parameter appears to be ignored.

Even though the limit is explicitly set in the startup command, the generated images do not respect this restriction and can exceed the specified size limit.

👣 Steps to reproduce

Start the vLLM server with the following command:

vllm serve /path/to/qwen_image/model/ \
  --omni \
  --port 8000 \
  --vae-use-tiling \
  --vae-use-slicing \
  --max-generated-image-size 4194304 \
  --log-stats \
  --default-sampling-params '{"0": {"num_inference_steps":8, "true_cfg_scale":1.0}}'

Send an API request to generate an image with a resolution/size that would normally exceed the 4194304 limit.

Observe the output. The generated image is successfully returned and its size exceeds the 4194304 limit defined by --max-generated-image-size.

📜 Expected Behavior

The server should either:

Reject the request if the requested dimensions exceed the --max-generated-image-size.

Cap/downscale the generation process so that the output strictly respects the configured size limit.

💻 Actual Behavior

The --max-generated-image-size argument has no effect, and images larger than the limit are generated successfully.

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions