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

> Node: Google Imagen (`gemini_imagen`) · Action (binary) · v1
> Category: AI · Credentials: Google AI (`googleAi`)
> Updated: 2026-08-16

# Google Imagen

> Generate images using Google Imagen models

## Overview

Google Imagen uses the Imagen predict API to generate high-quality images from text prompts. Imagen models are purpose-built for image generation and expose parameters for sample count (1–4), aspect ratio, safety filter level and person generation. The API returns base64-encoded images, each of which is decoded and stored as binary data. Authentication is via a Google AI API key.

**Category:** AI  
**Tool Name:** `gemini_imagen`  
**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 Imagen model to use for image generation. 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. Imagen will generate a high-quality image based on this prompt. Supports expressions like {{ $json.description }}. |
| Options | `collection` | No | `{}` | Optional image generation settings. |
| — Sample Count | `number` | No | `1` | Number of images to generate (1-4). |
| — Aspect Ratio | `options` | No | `1:1` | The aspect ratio of the generated image. |
| | | | | Options: `1:1` (Square), `3:4` (Portrait), `4:3` (Landscape), `9:16` (Tall Portrait), `16:9` (Wide Landscape) |
| — Safety Filter Level | `options` | No | — | The safety filter level to apply. Leave empty for default. |
| | | | | Options: `BLOCK_NONE`, `BLOCK_FEW`, `BLOCK_SOME`, `BLOCK_MOST` — plus the empty default, which leaves the choice to the model |
| — Person Generation | `options` | No | `ALLOW_ADULT` | Whether to allow generation of images containing people. |
| | | | | Options: `ALLOW_ADULT`, `DONT_ALLOW` |
| — Output Binary Property | `string` | No | `data` | Name of the binary property to write the output image(s) to. Names are case-sensitive — see the upstream node's Binary Data panel for the exact names to use. |
| 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 generated image**, not per input item — a Sample Count of `4` turns one input item into four output items. Each image is written to the binary property named by **Output Binary Property** (default `data`) on its own item, so the property name is the same on every one. Binary data arriving from upstream is preserved on each.

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

| Field | Description |
|-------|-------------|
| `imageIndex` | Zero-based position of this image in the batch the model returned. |

A request that comes back with no images is treated as an item error rather than an empty result.

Reference the images downstream through the binary property name you configured, and distinguish them with `{{ $json.imageIndex }}`.

## Usage Examples

- Generate a high-quality image from a text prompt using Imagen 3
- Create multiple images with a specific aspect ratio
- Generate a 16:9 landscape image from a description
- Create images with safety filters using Imagen
- Generate portrait-oriented images with 9:16 aspect ratio

## Example Configuration

Generate one square image with the defaults:

```json
{
  "type": "gemini_imagen",
  "parameters": {
    "prompt": "A sleek stainless steel water bottle on a white studio background"
  }
}
```

A single wide banner with explicit safety and output settings:

```json
{
  "type": "gemini_imagen",
  "parameters": {
    "prompt": "A serene mountain lake at golden hour, photorealistic, wide shot",
    "maxConcurrency": 3,
    "options": {
      "sampleCount": 1,
      "aspectRatio": "16:9",
      "safetyFilterLevel": "BLOCK_SOME",
      "personGeneration": "DONT_ALLOW",
      "binaryPropertyName": "bannerImage"
    }
  }
}
```

Four square variants per item, keeping the source fields on every output item:

```json
{
  "type": "gemini_imagen",
  "parameters": {
    "prompt": "{{ $json.description }}",
    "includeInput": true,
    "maxConcurrency": 2,
    "options": {
      "sampleCount": 4,
      "aspectRatio": "1:1",
      "safetyFilterLevel": "BLOCK_FEW",
      "personGeneration": "DONT_ALLOW",
      "binaryPropertyName": "thumbnails"
    }
  }
}
```

### 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_imagen calls the Google Imagen predict API to generate high-quality images from text prompts using purpose-built image generation models. Use it when a workflow needs to synthesize original imagery from descriptive text, with control over sample count (1-4), aspect ratio (1:1, 3:4, 4:3, 9:16, 16:9), safety filters, and person generation settings. It outputs binary image data on the main channel, decoded from base64 predictions containing bytesBase64Encoded and mimeType fields, or routes failures to the error channel.