Reference · Tools
Grok Image Generation
Generate images using xAI Grok Aurora model.
Grok Image Generation turns a text prompt into imagery using xAI's Grok Imagine models, producing up to four images per request as either decoded binary in the binary store or direct URLs. Use it when you want visuals generated inside a workflow — illustrating each post in a content pipeline without a manual design step.
- Node type
- Action (binary)
- Parameters
- 5
- Outputs
- Output, Error
- Credentials
- xAI
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 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 at0.imageUrl— a temporary URL for the image. Present only inimageUrlmode.
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:
{
"type": "grok_image_gen",
"parameters": {
"prompt": "A serene mountain landscape at sunrise, photorealistic"
}
}
Generate four variations under a named binary property:
{
"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:
{
"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.
Frequently asked questions
How many images does one request produce?
Up to four. Generating a set and picking from it is usually more efficient than repeatedly re-running a single prompt.
Should I take binary or a URL?
Binary when the image will be processed, attached or stored by later nodes, since it is already in the binary store. A URL is lighter when you only need to reference the image somewhere.
How does this differ from Grok Image Edit?
This creates an image from text alone. Image Edit takes an existing image plus an instruction and modifies it — different starting points, different nodes.
Which credential does it need?
An xAI credential with access to the Grok image models.
Build with the Grok Image Generation node
Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need xAI credentials first.
Open BusyBotLast updated . Spotted something wrong? Tell us.