## Overview

Modify an existing image based on a text prompt. This node sends your images and a text description to the Grok API, which edits the images according to your instructions and returns the result.

## Inputs

| Parameter | Description | Data Type | Required | Range |
| --- | --- | --- | --- | --- |
| `prompt` | The text prompt used to generate the image. Must be at least 1 character long after stripping whitespace. | STRING | Yes | N/A |
| `model` | The Grok image model to use. This parameter has multiple sub-options that appear after selecting a model. Available models: `grok-imagine-image-quality`<br>`grok-imagine-image-pro`<br>`grok-imagine-image`. Each model has different capabilities (see note below). | MODEL | Yes | See Description |
| `seed` | Seed to determine if node should re-run; actual results are nondeterministic regardless of seed. (default: 0) | INT | Yes | 0 to 2147483647 |

**Note on `model` parameter constraints:**
- The `model` parameter is a dynamic combo that includes sub-options for `resolution`, `number_of_images`, `images`, and `aspect_ratio`.
- **`grok-imagine-image-quality`**: Supports up to 3 input images and allows custom aspect ratio.
- **`grok-imagine-image-pro`**: Supports only 1 input image and does not allow custom aspect ratio.
- **`grok-imagine-image`**: Supports up to 3 input images and allows custom aspect ratio.
- **At least one input image is required** for editing. The node will raise an error if no images are provided.
- **Custom aspect ratio** (`aspect_ratio` sub-option) is only allowed when multiple images are connected to the image input. If only one image is provided, aspect ratio must be set to "auto".

## Outputs

| Output Name | Description | Data Type |
| --- | --- | --- |
| `IMAGE` | The edited image(s) returned by the Grok API. If a single image is generated, it is returned directly. If multiple images are generated, they are concatenated into a single batch tensor. | IMAGE |

> This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! [Edit on GitHub](https://github.com/Comfy-Org/embedded-docs/blob/main/comfyui_embedded_docs/docs/GrokImageEditNodeV2/en.md)

---
**Source fingerprint (SHA-256):** `90ace53f5f2e40da315d4940fa801d84950de6db2d8ed1cf9d715d88a2b1ebf0`
