generate_image
Generate images from text prompts using Gemini models. Supports aspect ratios, resolutions up to 4K, and optional search grounding for real-time data.
Instructions
Generate a single image with Nano Banana (Gemini image models). Models: nano=fast/1K, flash=best all-around/up to 4K (default), pro=professional/4K/thinking/grounding. Use cases: illustrations, product photography, logos, posters, photorealistic scenes, stickers, mockups. Output format follows the file extension: .png (default) or .jpg (flash/pro only — nano always returns PNG). Set use_search to ground in real-time data (weather, news, scores). Returns interaction_id — pass it to edit_image to iterate. Prompt tip: describe subject + setting + lighting + camera/lens + mood in full sentences; narrative beats keyword soup.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Output resolution; 0.5K flash only | 1K |
| model | No | nano=1K fast, flash=default/4K, pro=professional/4K/thinking | flash |
| ratio | No | Aspect ratio, e.g. 16:9, 1:1, 9:16, 4:3; 21:9/1:4/4:1/1:8/8:1 flash only | 1:1 |
| output | Yes | Output file path; extension picks the format (.png or .jpg; jpg needs flash/pro), e.g. generated/hero.jpg | |
| prompt | Yes | Image generation prompt | |
| preview | No | Return a small preview image so the client can see the result | |
| use_search | No | Ground with Google Search for real-time info (flash/pro) | |
| show_thinking | No | Include the model's thought summaries in the response (pro) | |
| use_image_search | No | Also ground with Google Image Search as visual context (flash only) |