<!-- BusyBot node reference — https://busybot.net/tools/gemini-image-gen/ -->

> Node: Gemini Image Generation (`gemini_image_gen`) · Action (binary) · v1
> Category: AI · Credentials: Google AI (`googleAi`)
> Updated: 2026-08-16

# Gemini Image Generation

> Generate images using Gemini native image generation

## Overview

Gemini Image Generation calls the Gemini generateContent API with an image response modality, so the picture is produced natively inside a Gemini model rather than by a separate image service. The model returns inline image data, which is decoded and written to a binary property on the output item; any text the model returns alongside it is collected into a response field. Authentication is via a Google AI API key.

**Category:** AI  
**Tool Name:** `gemini_image_gen`  
**Version:** 1

**Appearance:** Icon: `gemini` | Color: `#ffffff`

## Node Type

**Action (Binary)** — handles file/binary data operations

## Input / Output

| Direction | Port(s) |
|-----------|--------|
| Input | `Input` |
| Output | `Output`, `Error` |

## Credentials

This tool requires **Google AI** credentials.
See the [Credentials Guide](https://busybot.net/credentials/google-ai/) for setup instructions.

### Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Model | `options` | No | — | The Gemini image model — the Nano Banana family, which accepts the same generateContent + responseModalities request shape. The dropdown lists the models currently available for this node; leave it unset to use the default. |
| Prompt | `string` | Yes | — | A text description of the desired image. Gemini will generate an image (and optionally text) based on this prompt. Supports expressions like {{ $json.description }}. |
| Options | `collection` | No | `{}` | Optional output settings. |
| — Output Binary Property | `string` | No | `data` | Name of the binary property to write the output image to. Names are case-sensitive — see the upstream node's Binary Data panel for the exact names to use. |
| — Response Field Name | `string` | No | `response` | JSON field name where the text response from the model will be stored. |
| Include Input | `boolean` | No | `false` | Whether to include the original input item fields in the output alongside the generated image. |
| Max Concurrency | `number` | No | `5` | Maximum number of items to process concurrently. Keep low to respect Google AI rate limits. |

## Output Data

One output item per input item. The generated image is written to the binary property named by **Output Binary Property** (default `data`); if the model returns more than one image, the extras are written alongside it under the same name with an index suffix — `data_1`, `data_2`, and so on. Binary data arriving from upstream is preserved.

The output item's JSON contains only the fields below. The input item's JSON is merged in **only** when Include Input is on:

| Field | Description |
|-------|-------------|
| `response` | Any text the model returned alongside the image. Renamed by **Response Field Name**. |
| `model` | The model that produced the image. |
| `imageCount` | How many images were returned — `0` when the model produced none. |
| `finishReason` | Why generation stopped, when the model reports one. |
| `promptFeedback` | Prompt-level feedback (for example a block reason), when the model reports it. |
| `usage` | Token usage metadata, when the model reports it. |
| `partTypes` | Present only when no image came back — the shapes the model returned instead, which explains an empty result. |

Reference the result downstream by expression, e.g. `{{ $json.imageCount }}`, and the image itself through the binary property name you configured.

## Usage Examples

- Generate an image from a text prompt using Gemini
- Create an image with accompanying text description
- Draw a watercolor painting from a description
- Generate AI artwork using Gemini multimodal capabilities

## Example Configuration

Generate a single image with the defaults:

```json
{
  "type": "gemini_image_gen",
  "parameters": {
    "prompt": "A photorealistic golden retriever puppy playing in autumn leaves"
  }
}
```

Build the prompt from an upstream field and keep the source data on the item:

```json
{
  "type": "gemini_image_gen",
  "parameters": {
    "prompt": "{{ $json.description }}",
    "includeInput": true,
    "maxConcurrency": 3,
    "options": {
      "binaryPropertyName": "generatedImage",
      "responseFieldName": "modelResponse"
    }
  }
}
```

Batch thumbnails one at a time to stay inside rate limits:

```json
{
  "type": "gemini_image_gen",
  "parameters": {
    "prompt": "{{ $json.thumbnailPrompt }}",
    "includeInput": true,
    "maxConcurrency": 1,
    "options": {
      "binaryPropertyName": "thumbnail",
      "responseFieldName": "caption"
    }
  }
}
```

### Error Handling

| Mode | Behavior |
|------|----------|
| **stop** | Halts workflow on first error |
| **continue** | Skips failed items, passes successful ones through |
| **errorPort** | Routes failed items to Error output port |

## Tips

Gemini Image Generation calls the Gemini generateContent API with multimodal response modalities to produce images natively within Gemini models. Use this tool when you need AI-generated visuals alongside explanatory text in a single model call, authenticated via a Google AI API key. It outputs a response field containing collected text parts and decoded inline image data (base64-encoded PNG or JPEG) stored in the binary store, with errors routed to a dedicated error output.