Skip to main content
Glama

nanobanana_generate_image

Generate images from text prompts using Gemini AI models, saving them to specified file paths with configurable aspect ratios and quality options.

Instructions

Generate an image using Gemini's native image generation (Nano Banana).

This tool calls the Gemini API to generate an image based on your text prompt and saves it to the specified path.

Models:

  • gemini-2.5-flash-image: Fast, efficient (~$0.039/image)

  • gemini-3-pro-image-preview: Higher quality, supports 4K (~$0.134-0.24/image)

Supported Aspect Ratios: 1:1, 16:9, 9:16, 4:3, 3:4

Example:

prompt: "A modern flat illustration of a workflow diagram with three connected nodes, purple and blue gradient colors, minimal style"
output_path: "assets/generated/workflow-hero.png"
model: "gemini-2.5-flash-image"
aspect_ratio: "16:9"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesImage generation prompt describing the desired image
output_pathYesRelative or absolute path to save the generated image (e.g., 'assets/generated/hero.png')
modelNoGemini model to use. Flash for speed, Pro for qualitygemini-2.5-flash-image
aspect_ratioNoAspect ratio of the generated image
overwriteNoIf true, overwrite existing file. If false, skip if file exists

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/keeponfirst/kof-nanobanana-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server