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

> Node: Grok Image Generation (`grok_image_gen`) · Action (binary) · v1
> Category: AI · Credentials: xAI (`xai`)
> Updated: 2026-08-16

# Grok Image Generation

> Generate images using xAI Grok Aurora model

## Overview

Grok Image Generation creates images from text prompts using xAI's Grok Imagine image models. When Response Format is "Binary Data", the generated image is decoded and attached to the output item as binary data. When it is "Image URL", the tool returns a temporary image URL in the JSON output instead. Generates 1-4 images per request.

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

**Appearance:** Icon: `brain` | Color: `#000000`

## Node Type

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

## Input / Output

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

## Credentials

This tool requires **xAI** credentials.
See the [Credentials Guide](https://busybot.net/credentials/xai/) for setup instructions.

### Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| Model | `options` | No | Platform default | The xAI Grok Imagine image model to use for generation. |
| | | | | Options: the Grok Imagine image models currently available — the dropdown tracks the model catalog, so it changes as xAI's line-up changes. |
| Prompt | `string` | Yes | — | A text description of the desired image. Falls back to the input item's "prompt" field when left empty. Supports expressions like {{ $json.description }}. |
| Options | `collection` | No | `{}` | Optional generation and output settings — add only the fields you want to override. |
| — Number of Images | `number` | No | `1` | Number of images to generate (1-4). |
| — Response Format | `options` | No | `binaryData` | How to return the generated image(s). Binary Data decodes and stores the image as binary. Image URL returns a temporary URL. |
| | | | | Options: `binaryData`, `imageUrl` |
| — 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 xAI rate limits. |

## Output Data

**One output item per generated image** — an input item asking for four images produces four output items, not one. The rest of the input JSON is carried over only when Include Input is on.

- `imageIndex` — the position of this image within the request, starting at `0`.
- `imageUrl` — a temporary URL for the image. Present only in `imageUrl` mode.

In `binaryData` mode the image itself is attached to the output item as binary data under the name given by Output Binary Property (`data` by default), merged alongside any binary the input item already carried. In `imageUrl` mode no new binary is produced and the input item's binary is forwarded unchanged.

Reference the result downstream by expression, e.g. `{{ $json.imageUrl }}`, or connect the output straight to a node that consumes binary data.

## Usage Examples

- Generate an image from a text prompt using Grok Aurora
- Create multiple images from a single prompt
- Generate an image and get back a URL instead of binary data
- Create AI-generated artwork from a description

## Example Configuration

Generate one image and pass it downstream as binary:

```json
{
  "type": "grok_image_gen",
  "parameters": {
    "prompt": "A serene mountain landscape at sunrise, photorealistic"
  }
}
```

Generate four variations under a named binary property:

```json
{
  "type": "grok_image_gen",
  "parameters": {
    "prompt": "{{ $json.description }}",
    "includeInput": true,
    "maxConcurrency": 2,
    "options": {
      "n": 4,
      "responseFormat": "binaryData",
      "binaryPropertyName": "artwork"
    }
  }
}
```

Return a temporary URL instead of binary data:

```json
{
  "type": "grok_image_gen",
  "parameters": {
    "prompt": "A cozy coffee shop interior with warm lighting",
    "maxConcurrency": 1,
    "options": {
      "n": 1,
      "responseFormat": "imageUrl"
    }
  }
}
```

### 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

Grok Image Generation creates images from text prompts using xAI's Grok Imagine image models. Use it when a workflow needs AI-synthesized visuals from descriptive text and requires either a returnable URL or stored binary data for downstream processing. It outputs up to 4 images per request as either a decoded binary image written to the binary store or a direct image URL in the JSON response.