Edit images based on text prompts using the Google Nano Banana 2 model. Supports up to 14 reference images (10 object images + 4 character images).
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Image to image edit request body
Text prompt for image editing. Describe the desired change conversationally.
For adding/removing elements: "Add a wizard hat on the cat's head" For inpainting: "Change only the blue sofa to a brown leather chesterfield" For style transfer: "Transform this photo into Van Gogh's Starry Night style"
List of reference images for editing. Supports both image URLs and base64-encoded images.
Base64 format: data:image/png;base64,{base64_data}
Supported formats: JPEG, JPG, PNG, BMP, WEBP Max file size per image: 20MB
Nano Banana 2 supports up to 14 reference images:
1 - 14 elementsAspect ratio of the edited image (width:height).
1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9 Output resolution preset.
Note: Must use uppercase K (e.g. 1K, 2K, 4K). Lowercase will be rejected.
1K, 2K, 4K Enable Google Search grounding for image editing. When enabled, the model can use Google Search (including Web Search and Image Search) to verify facts and generate imagery based on real-time data such as current weather, stock charts, recent events, or accurate depictions of real-world subjects.
Accepted - Task created successfully