Skip to content

fix: forward --aspect-ratio to google language-image models#71

Closed
ctate wants to merge 1 commit into
mainfrom
issue-61
Closed

fix: forward --aspect-ratio to google language-image models#71
ctate wants to merge 1 commit into
mainfrom
issue-61

Conversation

@ctate

@ctate ctate commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Google language-image models (e.g. Gemini image models) were ignoring the --aspect-ratio option. This change forwards the aspect ratio via imageConfig.aspectRatio so users can control output dimensions.

Changes

  • Extract provider options construction into a new buildLanguageImageProviderOptions helper.
  • Forward --aspect-ratio to Google models through imageConfig.aspectRatio (defaults to 1:1 when unset).
  • Warn when --size is used with language-image models, since it is ignored; users should use --aspect-ratio instead.
  • Add unit tests covering non-google creators, the default Google response modalities, and aspect ratio forwarding.

Why

Previously there was no way to control the aspect ratio for Gemini image models, and --size (which these models don't support) silently had no effect. This makes the behavior explicit and gives users a working option.

Closes #61

@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai-cli Ready Ready Preview, Comment Jul 2, 2026 12:04am

gemini-2.5-flash-image and other language-image models go through the
generateText path, which only passed responseModalities and dropped
size/aspectRatio. Forward the aspect ratio via
providerOptions.google.imageConfig.aspectRatio so --aspect-ratio takes
effect, and warn that --size is ignored for these models (Gemini image
models don't support size).

Fixes #61
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--aspect-ratio is silently ignored for language-image models (e.g. google/gemini-2.5-flash-image)

1 participant