| Default model | Use gemini-2.5-flash-image (~$0.039/image) unless the user explicitly requires another supported path. Note: gemini-2.5-flash-image is scheduled for deprecation 2026-10-02 [Source: ai.google.dev/gemini-api/docs, 2026-06] |
| Model landscape 2026 | Nano Banana (gemini-2.5-flash-image, $0.039, deprecation 2026-10-02), Nano Banana 2 (gemini-3.1-flash-image, 0.5K-4K, $0.045 @1K; gemini-3.1-flash-image-preview variant deprecated), Nano Banana Pro (gemini-3-pro-image, $0.134 @1K-2K / $0.24 @4K; gemini-3-pro-image-preview variant deprecated), Imagen 4 Fast/Standard/Ultra ($0.02-$0.06, text-to-image only, max 2K) [Source: ai.google.dev/gemini-api/docs, 2026-06] |
| Imagen 4 constraints | Text-to-image only — cannot edit existing images; max native resolution 2K (2048×2048); improved text rendering over Gemini-native models |
| Google AI vs Vertex AI | imagen-3.0-* is Vertex AI only; on Google AI API it returns 404 |
| SDK compatibility | v1.38+ supports GenerateContentConfig(response_modalities=["TEXT", "IMAGE"]); v1.50+ additionally supports ImageGenerationConfig and person_generation param |
| Resolution parameter | Gemini 3 image models accept resolution: "1K" | "2K" | "4K" (Nano Banana 2 also accepts "0.5K"). Default is 1K. Set explicitly for ≥2K work — do not rely on aspect_ratio alone to control output size |
| 4K latency | Nano Banana Pro 4K takes ~60-65s per image vs <10s at 1K. Factor into batch timeouts and Batch API preference; avoid 4K for interactive UX unless streaming is acceptable |
| responseModalities | Must be ["TEXT", "IMAGE"] — using ["IMAGE"] alone returns HTTP 200 with empty parts (silent failure) |
| Endpoint | Must use /v1beta/ — image generation is not available on /v1 |
| Prompt architecture | Use Subject + Style + Composition + Technical; use photographic/cinematic language (lens type, camera angle, lighting setup) for realism |
| Prompt phrasing | Put the subject first, keep style internally consistent, prefer positive phrasing, and avoid conflicting mixes |
| Prompt language | Output the final generation prompt in English even when the request is Japanese |
| Prompt length | Target 50-200 words; reduce above 200; avoid >500 |
| Quality keywords | Keep to 3-5 strong keywords |
| Extended thinking | Set thinking_level: high for complex scenes, text rendering, or multi-element compositions |
| Batch preview | Preview 1-3 images before large batches; recommend Batch API (50% cost reduction) for ≥50 images |
| Reference images | Maximum 14 images/request; keep each under 4MB when possible; use for style consistency across series |
| Aspect ratios | Supported: 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9; Nano Banana 2 adds 1:4, 4:1, 1:8, 8:1 |
| Person generation param | In v1.50+, prefer DONT_ALLOW by default and ALLOW_ADULT only on explicit request |
| Silent failure handling | Classify into 4 states: prompt-side blocking, output-side blocking (IMAGE_SAFETY), no image (text-only response), non-policy failure. For no-image: (1) response_modalities includes "TEXT", (2) /v1beta/ endpoint, (3) billing enabled (FAILED_PRECONDITION = not active), (4) inlineData not fileData, (5) retry with explicit prefix |
| Thought Signatures | Nano Banana 2 multi-turn editing preserves visual context via Thought Signatures — do not re-send the full image each turn unless changing the base image |
| Grounding | Nano Banana 2 supports grounding with Google Image Search for reference-aware generation; enable via google_search tool config |
| Reproducibility | Always include seed parameter; document seed in metadata.json for regeneration |
| Free tier | Google AI API offers up to 500 images/day free; note this in cost estimates |