Skip to content

fix: forward --aspect-ratio to Google language-image models#72

Merged
ctate merged 1 commit into
mainfrom
issue-61
Jul 2, 2026
Merged

fix: forward --aspect-ratio to Google language-image models#72
ctate merged 1 commit into
mainfrom
issue-61

Conversation

@ctate

@ctate ctate commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Previously, --aspect-ratio was silently ignored when generating images with Gemini language-image models (e.g. google/gemini-2.5-flash-image), which always defaulted to 1:1.

  • Extracted provider-options logic into a new exported languageImageProviderOptions() helper that passes aspectRatio through Google's imageConfig alongside the existing responseModalities setting
  • Added a stderr warning when --size is used with language image models, since Gemini image models don't support it — pointing users to --aspect-ratio instead
  • Added unit tests covering non-Google creators, Google without aspect ratio, and Google with aspect ratio
  • Updated CLI README and web docs to note that --size isn't supported by Gemini image models

Closes #61

Models like google/gemini-2.5-flash-image generate images through
generateText(), where size/aspectRatio were never forwarded, so
--aspect-ratio was silently ignored and output was always 1:1.

Forward the flag via providerOptions.google.imageConfig.aspectRatio
(the AI SDK's documented mechanism). --size stays unforwarded since
Gemini image models don't support it; warn when it's passed to a
language-image model instead of ignoring it silently.

Fixes #61
@vercel

vercel Bot commented Jul 2, 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 2:02am

@ctate ctate merged commit 8332ade into main Jul 2, 2026
10 checks passed
@ctate ctate mentioned this pull request Jul 2, 2026
ctate added a commit that referenced this pull request Jul 2, 2026
- Bump ai-cli package metadata to v0.4.1.
- Add v0.4.1 release notes covering the --aspect-ratio fix for Google
  language-image models (#72).

Co-authored-by: Chris Tate <366502+ctate@users.noreply.github.com>
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