Reference · Tools

Google Imagen

Generate images using Google Imagen models.

Action (binary) AI v1 Binary data

Google Imagen turns a text prompt into original imagery using Google's purpose-built image models, with real control over the output: one to four samples per call, aspect ratios from square to widescreen, and safety and person-generation settings. Images come back as binary ready to store or send on. Use it for production-grade visuals — generating four ad variants at 16:9 for review.

Node type
Action (binary)
Parameters
5
Outputs
Output, Error
Credentials
Google AI

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

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires Google AI credentials. See the Credentials Guide for setup instructions.

Parameters

ParameterTypeRequiredDefaultDescription
ModeloptionsNoThe Imagen model to use for image generation. The dropdown lists the models currently available for this node; leave it unset to use the default.
PromptstringYesA text description of the desired image. Imagen will generate a high-quality image based on this prompt. Supports expressions like {{ $json.description }}.
OptionscollectionNo{}Optional image generation settings.
— Sample CountnumberNo1Number of images to generate (1-4).
— Aspect RatiooptionsNo1:1The 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 LeveloptionsNoThe 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 GenerationoptionsNoALLOW_ADULTWhether to allow generation of images containing people.
Options: ALLOW_ADULT, DONT_ALLOW
— Output Binary PropertystringNodataName 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 InputbooleanNofalseWhether to include the original input item fields in the output alongside the generated image.
Max ConcurrencynumberNo5Maximum 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:

FieldDescription
imageIndexZero-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:

{
  "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:

{
  "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:

{
  "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

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes 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.

Frequently asked questions

How many images can one call produce?

Between one and four, set by the sample count. Generating several at once and picking the best is usually cheaper and faster than re-running the node with the same prompt.

Which aspect ratios are supported?

1:1, 3:4, 4:3, 9:16 and 16:9 — enough to cover square social posts, portrait stories and widescreen banners without cropping afterwards.

How do the images reach the workflow?

The API returns base64 predictions with a mime type; the node decodes them and writes the binary to the main output, so downstream nodes handle real image data rather than encoded strings.

When should I use this instead of Gemini Image Generation?

Use Imagen when image quality and framing control matter, since it exposes sample count, aspect ratio and safety settings. Use Gemini Image Generation when you want text and an image from a single conversational call.

Build with the Google Imagen node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Google AI credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.