generate_image
Generate an image from a text prompt and save it to disk, returning the file path for further use.
Instructions
Generate an image from a text prompt. Saves to disk and returns the file path.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | No | Output resolution | |
| model | No | Gemini image model id (default: gemini-3.1-flash-image) | |
| prompt | Yes | Image description | |
| filename | No | Base filename without extension | |
| grounding | No | Ground with Google Search for factual accuracy | |
| outputDir | No | Save directory (default: ./nano-banana) | |
| aspectRatio | No | e.g. 1:1, 16:9, 9:16, 21:9, up to 1:4 or 8:1 | |
| thinkingLevel | No | Model reasoning effort; high helps complex or text-heavy images |