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

# Grok Imagine 2.0 Image (Quality)

> Generate and edit images with the quality-focused xAI Grok Imagine 2.0 image model.

Generate and edit images using Grok Imagine 2.0, the quality-focused Grok image model. The API produces exactly one output image per task.

<Warning>
  The `enable_pro` parameter has been removed. Select this model explicitly for quality. For faster generation, use [`xai/grok-imagine-image`](/models/image/xai/grok-imagine-image).
</Warning>

## Model

```
xai/grok-imagine-2.0-image
```

## Parameters

| Parameter         | Type      | Required | Default | Description                                                        |
| ----------------- | --------- | -------- | ------- | ------------------------------------------------------------------ |
| `prompt`          | string    | Yes      | —       | Text description or edit instruction                               |
| `aspect_ratio`    | string    | No       | `"1:1"` | `"1:1"`, `"2:3"`, `"3:2"`, `"9:16"`, or `"16:9"`                   |
| `image_urls`      | string\[] | No       | `null`  | 1–5 reference image URLs. Providing this field activates edit mode |
| `upsample_prompt` | boolean   | No       | `true`  | Let AI enhance the prompt                                          |
| `enable_nsfw`     | boolean   | No       | `true`  | Allow NSFW content generation                                      |

<Note>
  Text-to-image and image-edit requests each generate exactly **one image**. Providing `image_urls` activates editing but does not change the selected model.
</Note>

## Example requests

### Text to image

```bash theme={null}
curl -X POST https://api.unifically.com/v1/tasks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "xai/grok-imagine-2.0-image",
    "input": {
      "prompt": "A cinematic portrait with natural skin texture and detailed lighting",
      "aspect_ratio": "2:3"
    }
  }'
```

### Image editing

```bash theme={null}
curl -X POST https://api.unifically.com/v1/tasks \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "xai/grok-imagine-2.0-image",
    "input": {
      "prompt": "Merge these images into one photorealistic scene",
      "image_urls": [
        "https://example.com/img1.jpg",
        "https://example.com/img2.jpg"
      ]
    }
  }'
```

## Response

```json theme={null}
{
  "code": 200,
  "success": true,
  "data": {
    "task_id": "abc123def456",
    "status": "completed",
    "output": {
      "image_url": "https://files.unifically.com/image/92116e95-8dd4-4cbb-b53f-ee643e1045d8.jpg"
    }
  }
}
```
