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

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

# Grok Image Edit

> Edit images using xAI Grok.

## Overview

Grok Image Edit reads a source image from the input item's binary data, sends it with a text prompt describing the desired edit, and returns the edited image(s) as binary data or as temporary URLs. Supports up to four output variations per request and a choice of response format.

**Category:** AI  
**Tool Name:** `grok_image_edit`  
**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 editing (img2img). |
| | | | | 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 | — | Text description of the desired image edit. If empty, falls back to the input item's "prompt" field. Supports expressions. |
| Input Binary Property Name | `string` | No | `data` | The name of the binary property containing the source image to edit. Names are case-sensitive — see the upstream node's Binary Data panel for the exact names to use. |
| Output Binary Property Name | `string` | No | `data` | The name of the binary property where the edited image will be stored. |
| Options | `collection` | No | `{}` | Optional generation and output settings — add only the fields you want to override. |
| — Number of Images (n) | `number` | No | `1` | Number of edited image variations to generate. Range: 1-4. |
| — Response Format | `options` | No | `binaryData` | Whether to return the edited image as binary data or as a temporary URL. |
| | | | | Options: `binaryData` (return the edited image as binary data), `imageUrl` (return a temporary URL to the edited image) |
| Include Input | `boolean` | No | `false` | Whether to include the original input item fields in the output alongside the edited image. |
| Max Concurrency | `number` | No | `5` | Maximum number of items to process concurrently. |

## Output Data

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

- `imageIndex` — the position of this variation within the request, starting at `0`.
- `edited` — always `true`, a marker that this item came out of an edit.
- `model` — the model used for the edit.
- `prompt` — the edit prompt as resolved for this item, after expressions were evaluated.
- `imageUrl` — a temporary URL for the edited image. Present only in `imageUrl` mode.

In `binaryData` mode the edited image is attached to the output item as binary data under the name given by Output Binary Property Name (`data` by default), merged alongside the binary the input item already carried. Leaving the output name equal to the input name replaces the source image in place; giving it a different name keeps both. 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

- Edit a photo to add a sunset background
- Remove an object from an image using a text prompt
- Apply a style change to an uploaded image
- Generate multiple edit variations of a source image
- Modify image content based on dynamic text instructions

## Example Configuration

Edit the incoming image in place:

```json
{
  "type": "grok_image_edit",
  "parameters": {
    "prompt": "Replace the background with a golden-hour beach scene",
    "inputBinaryPropertyName": "data",
    "outputBinaryPropertyName": "data"
  }
}
```

Produce four variations and keep the original image alongside them:

```json
{
  "type": "grok_image_edit",
  "parameters": {
    "prompt": "{{ $json.editInstruction }}",
    "inputBinaryPropertyName": "data",
    "outputBinaryPropertyName": "edited",
    "includeInput": true,
    "maxConcurrency": 2,
    "options": {
      "n": 4,
      "responseFormat": "binaryData"
    }
  }
}
```

Return a temporary URL for handing to another HTTP service:

```json
{
  "type": "grok_image_edit",
  "parameters": {
    "prompt": "Increase contrast and sharpen the subject",
    "inputBinaryPropertyName": "data",
    "options": {
      "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 Edit sends a source image and a text prompt to the xAI image editing API to apply visual modifications using Grok vision models. Use it when a workflow requires AI-driven image transformation based on natural language instructions, such as changing backgrounds, adding objects, or altering styles. It outputs up to four edited images as binary data or URLs, stored in the binary store and referenced in the main output item.