Skip to content

Tools Reference ​

generate_image ​

Create a new image from a text prompt.

typescript
generate_image({
  prompt: "A futuristic city at night with neon lights",
  model?: "gemini-nano-banana-2.1", // optional, default
  aspectRatio?: "16:9",
  imageSize?: "2K",
  thinkingLevel?: "high"
})
ParameterRequiredDescription
promptYesText description of the image to create
modelNoModel to use, see Image options
aspectRatioNoOutput shape, see Image options
imageSizeNoOutput resolution, see Image options
useGoogleSearchNoGoogle Search grounding (Pro only), see Image options
thinkingLevelNoReasoning effort, see Image options

edit_image ​

Edit a specific image file, optionally using reference images.

typescript
edit_image({
  imagePath: "/path/to/image.png",
  prompt: "Add a rainbow in the sky",
  referenceImages?: ["/path/to/reference.jpg"],
  model?: "gemini-2.5-flash-image"
})
ParameterRequiredDescription
imagePathYesFull file path to the image to edit
promptYesText describing the modifications
referenceImagesNoArray of file paths for style transfer / guidance
modelNoModel to use, see Image options
aspectRatioNoOutput shape, see Image options
imageSizeNoOutput resolution, see Image options
useGoogleSearchNoGoogle Search grounding (Pro only), see Image options
thinkingLevelNoReasoning effort, see Image options

continue_editing ​

Continue editing the last generated/edited image in the session.

typescript
continue_editing({
  prompt: "Make it more colorful",
  referenceImages?: ["/path/to/style.jpg"],
  model?: "gemini-2.5-flash-image"
})
ParameterRequiredDescription
promptYesText describing the modifications
referenceImagesNoArray of reference image file paths
modelNoModel to use, see Image options
aspectRatioNoOutput shape, see Image options
imageSizeNoOutput resolution, see Image options
useGoogleSearchNoGoogle Search grounding (Pro only), see Image options
thinkingLevelNoReasoning effort, see Image options

Image options ​

Shared by generate_image, edit_image and continue_editing. All are optional; when one is omitted the server sends nothing for it and the model's own default applies. Not every model supports every value: Google's API rejects an unsupported combination with an explicit error, which the tool returns as-is.

OptionValuesNotes
modelgemini-nano-banana-2.1 (default), gemini-3-pro-image, gemini-3.1-flash-image, gemini-3.1-flash-lite-image, gemini-2.5-flash-imageSee Model Selection.
aspectRatio1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, and the panoramic 1:4, 4:1, 1:8, 8:1Omitted, the model picks the shape: in testing every model returned landscape output for new images (about 16:9, e.g. 1376×768), while edits kept the source image's shape. Pass "1:1" explicitly for a square image.
imageSize512px, 1K, 2K, 4KModel default is 1K. Nano Banana 2 Lite produces 1K only.
useGoogleSearchtrue / falseGrounds the image in live Google Search results (current dates, weather, events). Only gemini-3-pro-image is allowed; any other model is rejected before the API is called.
thinkingLevelminimal, medium, highHow much the model reasons before drawing. high helps complex prompts (infographics, text in images, several consistent characters) but is slower; minimal is fastest and cheapest. Model default is medium on Nano Banana 2.1. gemini-3.1-flash-image and Lite accept only minimal / high; gemini-2.5-flash-image has no thinking levels.

get_last_image_info ​

Get information about the last generated/edited image.

typescript
get_last_image_info()

No parameters.

configure_gemini_token ​

Configure your Gemini API key (saved to ~/.nano-banana-config.json).

typescript
configure_gemini_token({
  apiKey: "your-gemini-api-key"
})
ParameterRequiredDescription
apiKeyYesGemini API key from Google AI Studio

get_configuration_status ​

Check if the API key is configured and its source.

typescript
get_configuration_status()

No parameters.

Released under the MIT License.