generate_image
Create image assets from text prompts with Gemini AI, optional transparent backgrounds, reference images, and precise resize or crop control.
Instructions
Generate image assets using Gemini AI with optional transparency and reference images.
[Claude Desktop Guidance]
Prefer outputType='file' for medium or large images. base64 and combine responses can exceed Claude Desktop's context limit.
On Claude Desktop for Windows, use the FileSystem extension to choose reference-image paths and a writable absolute outputPath before calling this tool.
Use base64 only for small previews or when the client explicitly needs inline image data.
[Model Guidance]
NanoBanana2.1 (default): Google Nano Banana 2.1 (gemini-nano-banana-2.1). Best overall quality, prompt adherence, character consistency, text rendering and reference-image handling. Supports 1K/2K/4K and up to 14 reference images, plus thinking and grounding.
Flash3.1 (deprecated): gemini-3.1-flash-image. Google shuts it down on October 29, 2026; requests are rejected from that date. Please migrate to NanoBanana2.1.
Lite3.1 (Nano Banana 2 Lite): Ultra-fast, cost-effective, 1K-only, no search grounding. Ideal for quick drafting and low-latency iteration.
Pro3: Higher fidelity, but more costly and slower.
Flash2.5: Legacy, maintained for compatibility. 1K only. Aliases: 'flash' resolves to NanoBanana2.1 (the default), 'pro' to Pro3.
[Thinking] thinking_mode accepts minimal, medium, high (default: medium, matching NanoBanana2.1's model default). NanoBanana2.1 supports all three levels; Flash3.1 and Pro3 support minimal/high and fall back to their own default when given an unsupported level.
[Resolutions] output_resolution supports 1K, 2K and 4K (0.5K was removed in v1.6.0). It is auto-selected from the requested pixel size in normal mode.
[Aspect Ratios] Gemini supports the following aspect ratios (model-dependent):
Common to all models: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
Flash3.1 only: 1:4, 4:1, 1:8, 8:1
Normal mode: provide outputWidth/outputHeight and the server will choose the closest Gemini aspect ratio and source resolution, then resize to the requested pixel size. No-resize mode: set noresize=true and provide aspectRatio plus output_resolution. The server will return Gemini's native pixel dimensions for that combination without post-generation resizing.
If you intentionally want to control resizing/cropping in normal mode, use the 'resizeMode' parameter: 'crop' (default, center crop), 'letterbox' (fit with padding), 'contain' (trim transparent margins then fit), or 'stretch' (distort to fit).
[IMPORTANT] Always preserve the user's prompt as-is, including language and nuance. Do not translate or summarize.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| debug | No | Debug mode: output intermediate processing images and prompt | |
| model | No | Model tier to use for generation (default: NanoBanana2.1; see tool description for details; "flash" resolves to NanoBanana2.1, "pro" to Pro3; "Lite3.1" is the low-latency Nano Banana 2 Lite model, 1K-only, no grounding; "Flash3.1" is deprecated — Google shuts it down on October 29, 2026) | NanoBanana2.1 |
| prompt | Yes | User-provided image prompt. Preserve the original wording and detail; do not summarize or translate. Only append transparency-related hints if needed. | |
| noresize | No | Skip post-generation resizing and return Gemini native dimensions directly. When true, provide aspectRatio and output_resolution instead of outputWidth/outputHeight. | |
| fringeMode | No | Fringe reduction mode: auto (size-based), crisp (binary alpha), hd (force-clear 1px boundary for large images). | auto |
| outputPath | No | Output directory path (MUST be an absolute path when outputType is file or combine). In Claude Desktop on Windows, use the FileSystem extension to choose or prepare a writable absolute path such as C:\temp. | |
| outputType | No | Output format: file=file only, base64=base64 only, combine=both. In Claude Desktop, prefer file for medium or large images to avoid context-size limits; use base64 only for small previews. | combine |
| resizeMode | No | Resize mode: crop=center crop, stretch=distort, letterbox=fit with padding, contain=trim transparent margins then fit | crop |
| aspectRatio | No | Gemini aspect ratio to use directly when noresize=true. Ignored in normal resize mode. | |
| outputWidth | No | Output image width in pixels. Required unless noresize=true. In normal mode, the image will be generated using the closest supported Gemini aspect ratio and resolution, then resized to this width. | |
| transparent | No | Request transparent background (PNG or WebP only). Background color is selected by histogram analysis. | |
| outputHeight | No | Output image height in pixels. Required unless noresize=true. In normal mode, the image will be generated using the closest supported Gemini aspect ratio and resolution, then resized to this height. | |
| output_format | No | Output format | png |
| thinking_mode | No | Thinking level: minimal, medium, high (default: medium, matching NanoBanana2.1's model default; requires a thinking-capable model — NanoBanana2.1 accepts all three levels, Flash3.1/Pro3 accept minimal/high and fall back to their own default otherwise) | medium |
| colorTolerance | No | Tolerance for color matching (0-255). Higher values are more permissive for transparent color selection and keying. | |
| grounding_type | No | Grounding tool usage (requires a grounding-capable model; see [Model Guidance] in the tool description) | none |
| outputFileName | Yes | Output filename (extension auto-added if missing) | |
| referenceImages | No | Reference images for style guidance (max 14 files; per-model limits are enforced automatically) | |
| include_metadata | No | Include grounding and reasoning metadata in JSON output (optional, may increase payload size). | |
| include_thoughts | No | Optional (default: false). Request thought fields from Gemini (thinking-capable models only). Thought content is returned in MCP response only when include_metadata=true. | |
| transparentColor | No | Color to make transparent. Hex (e.g. #FF00FF). null defaults to #FF00FF when transparent=true. | |
| output_resolution | No | Gemini generation source resolution: 1K, 2K, and 4K (optional in normal mode, required when noresize=true; 0.5K was removed in v1.6.0). In normal mode, the final image is resized to the requested pixel size after generation. |