> ## Documentation Index
> Fetch the complete documentation index at: https://docs.creatify.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Grok Image 2 · Image to image

> xAI Grok Imagine Image 2.0 image editing — edit with up to 3 reference images, low/medium quality tiers at 1K/2K (via fal).

[← Grok Image](/api-documentation/ai-generation/models/grok-image)

**Model name:** `grok-imagine-image/v2.0/edit`\
**Generation type:** `image_to_image`\
**Endpoint:** [`POST /api/asset_generator/`](/api-reference/ai-generation/post-ai-generation)

## Pricing

| Quality | 1k | 2k |
| - | - | - |
| low | **0.5** | **1.0** |
| medium | **1.0** | **1.0** |

Prices are per output. When a request asks for several outputs, the charge is this price times the number of outputs.

## Quick start

The example uses sample media from our CDN. Swap in publicly accessible URLs for your own files.

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.creatify.ai/api/asset_generator/ \
    --header 'Content-Type: application/json' \
    --header 'X-API-ID: your-api-id' \
    --header 'X-API-KEY: your-api-key' \
    --data '{
      "model_name": "grok-imagine-image/v2.0/edit",
      "input_params": {
        "prompt": "Place her in a bright café with soft morning light.",
        "image_urls": [
          "https://d35ghwdno3nak3.cloudfront.net/tutorial/avatar-aurora/recommendation-4.jpg"
        ]
      }
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.creatify.ai/api/asset_generator/",
      headers={"X-API-ID": "your-api-id", "X-API-KEY": "your-api-key"},
      json={
          "model_name": "grok-imagine-image/v2.0/edit",
          "input_params": {
              "prompt": "Place her in a bright café with soft morning light.",
              "image_urls": [
                  "https://d35ghwdno3nak3.cloudfront.net/tutorial/avatar-aurora/recommendation-4.jpg"
              ]
          },
      },
  )
  print(response.json()["id"])
  ```
</CodeGroup>

## Input parameters

Send these fields in `input_params`.

<ParamField body="prompt" type="string" required>
  The text prompt describing the desired edit.

  Minimum characters: `3`.
  Maximum characters: `8000`.
</ParamField>

<ParamField body="image_urls" type="string[]" required>
  List of URLs of input images for editing. Up to 3 reference images.

  Minimum items: `1`.
  Maximum items: `3`.
</ParamField>

<ParamField body="aspect_ratio" type="string" default={"auto"}>
  Aspect ratio of the edited image. 'auto' preserves the first input image's aspect ratio.

  Allowed values: `"auto"`, `"1:1"`, `"16:9"`, `"9:16"`, `"4:3"`, `"3:4"`, `"3:2"`, `"2:3"`, `"2:1"`, `"1:2"`, `"20:9"`, `"19.5:9"`, `"9:19.5"`, `"9:20"`.
</ParamField>

<ParamField body="resolution" type="string" default={"1k"}>
  Output resolution.

  Allowed values: `"1k"`, `"2k"`.
</ParamField>

<ParamField body="quality" type="string" default={"medium"}>
  Quality level of the edited image.

  Allowed values: `"low"`, `"medium"`.
</ParamField>

<ParamField body="num_images" type="integer" default={1}>
  Number of images to generate.

  Minimum: `1`.
  Maximum: `4`.
</ParamField>

<Accordion title="Complete JSON schema">
  ```json theme={null}
  {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "required": [
      "prompt",
      "image_urls"
    ],
    "properties": {
      "prompt": {
        "type": "string",
        "title": "Prompt",
        "maxLength": 8000,
        "minLength": 3,
        "description": "The text prompt describing the desired edit."
      },
      "image_urls": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "title": "Image URLs",
        "maxItems": 3,
        "minItems": 1,
        "description": "List of URLs of input images for editing. Up to 3 reference images.",
        "max_file_size": 8388608,
        "limit_description": "Max file size: 8.0MB, Min width: 128px, Min height: 128px, Max width: 4096px, Max height: 4096px, Timeout: 20.0s"
      },
      "aspect_ratio": {
        "enum": [
          "auto",
          "1:1",
          "16:9",
          "9:16",
          "4:3",
          "3:4",
          "3:2",
          "2:3",
          "2:1",
          "1:2",
          "20:9",
          "19.5:9",
          "9:19.5",
          "9:20"
        ],
        "type": "string",
        "title": "Aspect Ratio",
        "default": "auto",
        "description": "Aspect ratio of the edited image. 'auto' preserves the first input image's aspect ratio."
      },
      "resolution": {
        "enum": [
          "1k",
          "2k"
        ],
        "type": "string",
        "title": "Resolution",
        "default": "1k",
        "description": "Output resolution.",
        "x-advance-settings": true
      },
      "quality": {
        "enum": [
          "low",
          "medium"
        ],
        "type": "string",
        "title": "Quality",
        "default": "medium",
        "description": "Quality level of the edited image.",
        "x-advance-settings": true
      },
      "num_images": {
        "type": "integer",
        "title": "Number of Images",
        "default": 1,
        "minimum": 1,
        "maximum": 4,
        "x-ui-name": "output_nums",
        "description": "Number of images to generate."
      }
    }
  }
  ```
</Accordion>

## Response

The request returns the task with `status: "initializing"`. Poll [GET /api/asset\_generator/\{id}/](/api-reference/ai-generation/get-ai-generation-) until `status` is `done` or `failed`, or pass a `webhook_url` to be notified. A finished task lists its files in `assets` and the credits it charged in `credits_used`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.