mirror of
https://github.com/HanaokaYuzu/Gemini-API.git
synced 2026-04-12 12:23:03 -06:00
[PR #209] [CLOSED] feat: add ImageMode for image quality selection(Nano Banana Pro Support) #218
Labels
No labels
advanced
advanced
bug
dependencies
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
model
pull-request
question
unreproducible
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mirrors/Gemini-API#218
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/HanaokaYuzu/Gemini-API/pull/209
Author: @seolcoding
Created: 1/10/2026
Status: ❌ Closed
Base:
master← Head:feat/image-mode-api📝 Commits (1)
aa33ef4feat: add ImageMode API for image quality selection📊 Changes
3 files changed (+76 additions, -23 deletions)
View changed files
📝
src/gemini_webapi/__init__.py(+1 -0)📝
src/gemini_webapi/client.py(+63 -23)📝
src/gemini_webapi/constants.py(+12 -0)📄 Description
Summary
Enable Nano Banana Pro mode for high-quality image generation via new
ImageModeparameter.This PR unlocks the Nano Banana Pro model (Google's higher quality image generation) which was previously not accessible through the API.
ImageMode.PRO(default): High quality image generation using Nano Banana Pro modelImageMode.FAST: Standard quality, faster response (previous default behavior)How Nano Banana Pro is Triggered
Through reverse engineering the Gemini web interface, I discovered the following parameters:
x-goog-ext-525001261-jspbwith model signature9d8ca3786ebdfbeaidx17=[[1]](quality marker) +idx49=14(Pro flag)These parameters activate the Nano Banana Pro model, resulting in significantly higher quality generated images.
Usage
Changes
constants.py: AddImageModeenum__init__.py: ExportImageModeclient.py: Implementimage_modeparameter ingenerate_content()🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.