Skip to content

fix: nano-banana not compatible imageSize - #2330

Merged
seefs001 merged 1 commit into
QuantumNous:mainfrom
feitianbubu:pr/fix-nano-banana-err
Nov 30, 2025
Merged

fix: nano-banana not compatible imageSize#2330
seefs001 merged 1 commit into
QuantumNous:mainfrom
feitianbubu:pr/fix-nano-banana-err

Conversation

@feitianbubu

@feitianbubu feitianbubu commented Nov 28, 2025

Copy link
Copy Markdown
Member

nano-banana不支持gemini3新参数imageSize
请求会报错:An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting
但使用标准oai接口请求quality参数会转换为imageSize
需要删除该参数才请求正常
image

Summary by CodeRabbit

Bug Fixes

  • Enhanced image generation compatibility for specific Gemini models by optimizing request configuration handling to ensure proper processing.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Nov 28, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

A compatibility workaround is added to the Gemini adaptor that clears the ImageSize field in ImageConfig for specific upstream models ("nano-banana" and "gemini-2.5-flash-image"). The slices package is imported to support model name containment checks.

Changes

Cohort / File(s) Change Summary
Gemini adaptor image compatibility
relay/channel/gemini/adaptor.go
Add conditional logic to clear ImageSize in ImageConfig for specific upstream models; import slices package for model name filtering

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Specific attention areas:
    • Verify that the hardcoded model names ("nano-banana" and "gemini-2.5-flash-image") are correct and comprehensive
    • Confirm that clearing ImageSize is the appropriate fix for these models and doesn't break downstream behavior
    • Check if similar models may also require this workaround

Possibly related PRs

Poem

🐰 A rabbit hops through code so fine,
Clearing sizes, all in line,
For nano-bananas, bright and true,
And flash images shiny new! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the specific issue: nano-banana model's incompatibility with the imageSize parameter, which is the main focus of the code change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@seefs001
seefs001 merged commit 2b54e5f into QuantumNous:main Nov 30, 2025
1 check passed
ennnnny pushed a commit to ennnnny/new-api that referenced this pull request Mar 17, 2026
…na-err

fix: nano-banana not compatible imageSize
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.

2 participants