Skip to main content
Glama

nanobanana_edit_image

Edit images by describing changes with text prompts. Add, remove, or modify elements, adjust styles, lighting, colors, composition, and apply effects while maintaining the original image's context.

Instructions

Edit an existing image using text prompts with Google's Nano Banana models.

Provide an image and describe your desired changes. The model will:

  • Add, remove, or modify elements

  • Change style, lighting, or colors

  • Adjust composition

  • Apply filters or effects

The model maintains the original image's style and context while applying changes.

Args:

  • prompt (string, required): Description of the edit to make

  • image_base64 (string, required): Base64-encoded image data (no data URI prefix)

  • image_mime_type (string, required): MIME type of the image (e.g., 'image/png', 'image/jpeg')

  • model (string): Model to use. Default: Nano Banana Pro

  • aspect_ratio (string): Output aspect ratio. Options: 1:1, 2:3, 3:2, etc.

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

Returns:

  • success (boolean): Whether editing succeeded

  • imageData (string): Base64-encoded edited image

  • mimeType (string): Image MIME type

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

  • error (string): Error message if editing failed

Examples:

  • "Add a small wizard hat on the cat's head"

  • "Change the background to a sunset beach"

  • "Make this image look like a Van Gogh painting"

  • "Remove the person in the background"

Error Handling:

  • Returns error if image data is invalid

  • Returns error if MIME type is unsupported

  • Returns error if content policy violated

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesText description of the edit to make. Describe what to add, remove, or modify. Be specific about the desired changes.
image_base64YesBase64-encoded image data to edit. Do not include data URI prefix.
image_mime_typeYesMIME type of the image. Supported: image/png, image/jpeg, image/jpg, image/gif, image/webp
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

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