> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-docs-partner-nodes-consolidate.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# GrokImageEditNodeV2 - ComfyUI Built-in Node Documentation

> Modify one or more existing images based on a text prompt.

Modify one or more existing images based on a text prompt. The node sends the connected reference image(s) and the prompt to the Grok image editing API using the selected model, then returns the edited image(s).

## Inputs

### Common Inputs

| Parameter | Description                                                                                                   | Data Type      | Required | Range                                                                                                              |
| --------- | ------------------------------------------------------------------------------------------------------------- | -------------- | -------- | ------------------------------------------------------------------------------------------------------------------ |
| `model`   | The Grok image model to use. The sub-parameters shown below change depending on the selected model.           | DYNAMIC\_COMBO | Yes      | "grok-imagine-image-2.0"<br />"grok-imagine-image-quality"<br />"grok-imagine-image-pro"<br />"grok-imagine-image" |
| `prompt`  | The text prompt used to generate the image. (default: "")                                                     | STRING         | Yes      | N/A                                                                                                                |
| `seed`    | Seed to determine if node should re-run; actual results are nondeterministic regardless of seed. (default: 0) | INT            | Yes      | 0 to 2147483647                                                                                                    |

### grok-imagine-image-2.0 Inputs

| Parameter          | Description                                         | Data Type | Required | Range                                                                                                                                                           |
| ------------------ | --------------------------------------------------- | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `resolution`       | Output resolution of the edited images.             | COMBO     | Yes      | "1K"<br />"2K"                                                                                                                                                  |
| `number_of_images` | Number of edited images to generate. (default: 1)   | INT       | Yes      | 1 to 10                                                                                                                                                         |
| `quality`          | Quality level of the generated images.              | COMBO     | Yes      | "medium"<br />"low"                                                                                                                                             |
| `aspect_ratio`     | Aspect ratio of the edited image. (default: "auto") | COMBO     | Yes      | "auto"<br />"1:1"<br />"2:3"<br />"3:2"<br />"3:4"<br />"4:3"<br />"9:16"<br />"16:9"<br />"9:19.5"<br />"19.5:9"<br />"9:20"<br />"20:9"<br />"1:2"<br />"2:1" |

### grok-imagine-image-quality and grok-imagine-image Inputs

Shared by grok-imagine-image-quality and grok-imagine-image.

| Parameter          | Description                                                        | Data Type | Required | Range                                                                                                                                                           |
| ------------------ | ------------------------------------------------------------------ | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `resolution`       | Output resolution of the edited images.                            | COMBO     | Yes      | "1K"<br />"2K"                                                                                                                                                  |
| `number_of_images` | Number of edited images to generate. (default: 1)                  | INT       | Yes      | 1 to 10                                                                                                                                                         |
| `aspect_ratio`     | Only allowed when multiple images are connected. (default: "auto") | COMBO     | Yes      | "auto"<br />"1:1"<br />"2:3"<br />"3:2"<br />"3:4"<br />"4:3"<br />"9:16"<br />"16:9"<br />"9:19.5"<br />"19.5:9"<br />"9:20"<br />"20:9"<br />"1:2"<br />"2:1" |

### grok-imagine-image-pro Inputs

| Parameter          | Description                                       | Data Type | Required | Range          |
| ------------------ | ------------------------------------------------- | --------- | -------- | -------------- |
| `resolution`       | Output resolution of the edited images.           | COMBO     | Yes      | "1K"<br />"2K" |
| `number_of_images` | Number of edited images to generate. (default: 1) | INT       | Yes      | 1 to 10        |

### Reference Inputs

| Parameter | Description                                                                                                                                                                                       | Data Type | Required | Range                                                                                                                                        |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `images`  | Growable slot: connect 1 or more reference images to edit. The first slot is `image`, additional slots are `image_1`, `image_2`, etc. The maximum number of images depends on the selected model. | IMAGE     | Yes      | 1 image for `grok-imagine-image-pro`<br />1 to 3 images for `grok-imagine-image-2.0`, `grok-imagine-image-quality`, and `grok-imagine-image` |

**Note on constraints:**

* `prompt` must contain at least 1 non-whitespace character.
* At least one reference image is required for editing; the node raises an error if no image is connected.
* The maximum number of input images is 1 for `grok-imagine-image-pro` and 3 for `grok-imagine-image-2.0`, `grok-imagine-image-quality`, and `grok-imagine-image`. Connecting more images than the model supports raises an error.
* For `grok-imagine-image-quality` and `grok-imagine-image`, a custom `aspect_ratio` (anything other than "auto") is only allowed when multiple images are connected. With a single image, `aspect_ratio` must be "auto".
* For `grok-imagine-image-2.0`, `aspect_ratio` can be set freely even with a single image.
* The `quality` sub-parameter is only available with `grok-imagine-image-2.0`.

## 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):** `7d75b1cb8405c5024567b1119bcbd5e4b318152605f74b62bdd5173dda75949f`
