-
-
Notifications
You must be signed in to change notification settings - Fork 148
Closed
Description
Problem
The Gemini image adapter currently only routes gemini-3.1-flash-image-preview (🍌 Nano Banana 2) through the generateContent API path. The other three Gemini native image models should also use this path:
gemini-3-pro-image-previewgemini-2.5-flash-imagegemini-2.0-flash-preview-image-generation
Additionally, the current implementation has several bugs:
- Wrong config property: Uses
imageGenerationConfigbut the SDK'sGenerateContentConfigexpectsimageConfig - Wrong size property: Uses
outputImageSizebut the SDK'sImageConfigexpectsimageSize - Invalid type values:
GeminiNanoBananaAspectRatioincludes ratios not in the SDK (1:4,1:8,4:1,4:5,5:4,8:1) andGeminiNanoBananaResolutionincludes512px(SDK only supports1K,2K,4K)
Expected Behavior
- All
gemini-*image models should route through thegenerateContentAPI withresponseModalities: ['IMAGE'] - Imagen models (
imagen-3.0-*,imagen-4.0-*) should continue using thegenerateImagesAPI - Config properties should match the
@google/genaiSDK types (GenerateContentConfig,ImageConfig) - Type definitions should only include values actually supported by the SDK
- Types should be renamed from
GeminiNanoBanana*toGeminiNativeImage*since they apply to all Gemini native image models, not just 🍌
References
GenerateContentConfig— hasimageConfig?: ImageConfigImageConfig— hasaspectRatio?: string,imageSize?: string- Requires
@google/genai>= 1.43.0 forImageConfigtype
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels