nano_banana_generate_image
Generate images from text prompts with Gemini 3 Pro Image on Vertex AI, using reference images for edits and uploading results to GCS.
Instructions
Generate images with Gemini 3 Pro Image on Vertex AI and upload results to GCS. Prefer referenceImagePaths or referenceImageUris to avoid base64. For 4K imageSize requests, the server may return a polling task (or MCP task when explicitly requested) when auto-task mode is enabled to avoid client timeouts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Override the model ID (default: gemini-3-pro-image-preview). | |
| prompt | No | Text prompt for image generation. | |
| location | No | Vertex region (default: VERTEX_LOCATION or global). | |
| gcsBucket | No | GCS bucket for reference image uploads. | |
| imageSize | No | Image size (1K, 2K, 4K) for models that support it (e.g. Gemini 3 Pro Image Preview). | |
| outputDir | No | Directory to save generated images on disk (relative paths resolve under NANO_BANANA_OUTPUT_DIR). | /root/nano-banana-outputs |
| projectId | No | Override the GCP project ID (default from env or service account). | |
| aspectRatio | No | Aspect ratio like 1:1, 16:9, 4:3. Gemini 2.5 Flash Image supports fixed ratios. | |
| includeText | No | Include text parts in the MCP response. | |
| candidateCount | No | Number of candidates to request (1-8). | |
| gcsUploadPrefix | No | GCS object prefix for uploaded reference images. | nano-banana/refs |
| outputGcsBucket | No | GCS bucket for generated image uploads. | |
| outputGcsPrefix | No | GCS object prefix for generated image uploads. | nano-banana/outputs |
| referenceImages | No | Legacy base64-encoded images (prefer referenceImagePaths or referenceImageUris). | |
| outputFilePrefix | No | Optional filename prefix used for GCS object names and local files. | |
| referenceImageUris | No | Optional GCS image URIs for editing or multi-image prompts. | |
| responseModalities | No | Override response modalities. | |
| referenceImagePaths | No | Optional local image paths to upload to GCS and use as references. |