gemini-nano-banana-2.1 with the native Gemini GenerateContent endpoint.
Google released
gemini-nano-banana-2.1 as a generally available model on October 6, 2026. Google recommends it for new projects that previously used gemini-3.1-flash-image.Model specifications
Key capabilities
- Generate an image from a text prompt.
- Edit an existing image through a conversational instruction.
- Combine up to 14 reference images in one request.
- Preserve character and object appearance across iterative edits.
- Generate wide and panoramic layouts, including
1:4,4:1,1:8, and8:1. - Produce text-heavy visuals such as infographics, menus, and diagrams.
Request examples
- Text to image
- Image editing
- Thinking level
Use
responseModalities to request an image, then set the aspect ratio and resolution under responseFormat.image.cURL
Read the generated image
The response can contain text parts and image parts. DecodeinlineData.data from Base64 and save it using the MIME type returned in inlineData.mimeType.
Python
Image configuration
Input guidance
- Put text instructions and reference images in the same
partsarray. - Use
inline_datafor Base64 content andfile_datafor an uploaded file URI. - Supported image MIME types include PNG, JPEG, WebP, HEIC, and HEIF.
- The model accepts up to 14 reference images, but character consistency is optimized for up to 4 characters and object fidelity for up to 10 objects.
- Video and PDF inputs consume the same 131,072-token context window.
Gemini Nano Banana 2.1 API Reference
View the request and response schema for native Gemini image generation.