Skip to main content
Glama

nanobanana_generate_image

Create images from text descriptions using Google's Nano Banana models. Specify details like style, lighting, composition, and aspect ratio for customized visual outputs.

Instructions

Generate high-quality images from text descriptions using Google's Nano Banana models.

This tool creates images from natural language prompts. For best results, be descriptive about:

  • Subject and composition

  • Style (photorealistic, illustration, painting, etc.)

  • Lighting and atmosphere

  • Colors and mood

  • Camera angle and lens (for photorealistic images)

Args:

  • prompt (string, required): Text description of the image to generate

  • model (string): Model to use. Options:

    • 'gemini-3-pro-image-preview' (Nano Banana Pro) - Best quality, 4K, text rendering

    • 'gemini-2.5-flash-image' (Nano Banana) - Fast generation Default: Nano Banana Pro

  • aspect_ratio (string): Image aspect ratio. Options: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9

  • resolution (string): Image resolution (Pro only). Options: 1K, 2K, 4K

  • use_google_search (boolean): Enable real-time information grounding (Pro only)

Returns:

  • success (boolean): Whether generation succeeded

  • imageData (string): Base64-encoded image data

  • mimeType (string): Image MIME type (usually image/png)

  • text (string): Any accompanying text from the model

  • error (string): Error message if generation failed

Examples:

  • "A photorealistic portrait of an astronaut on Mars at sunset"

  • "Kawaii-style sticker of a happy corgi with a transparent background"

  • "Minimalist logo for 'TechStart' in blue and white, modern sans-serif font"

Error Handling:

  • Returns error if GEMINI_API_KEY is not set

  • Returns error if API rate limit exceeded (try again later)

  • Returns error if content policy violated

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesText description of the image to generate. Be descriptive for better results. Include details about style, lighting, composition, colors, and mood.
modelNoModel to use. 'gemini-3-pro-image-preview' (Nano Banana Pro) for best quality and features, 'gemini-2.5-flash-image' (Nano Banana) for faster generation. Default: Nano Banana Progemini-3-pro-image-preview
aspect_ratioNoAspect ratio of the generated image. Options: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9. Default: varies by prompt
resolutionNoResolution of the generated image (Nano Banana Pro only). Options: 1K, 2K, 4K. Note: Must use uppercase 'K'. Default: 1K
use_google_searchNoEnable Google Search grounding for real-time information (e.g., current weather, news). Only available with Nano Banana Pro. Default: false

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/mikeroussell/nano-banana-mcp'

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