> ## 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

> Generate and edit images with the quality-focused xAI Grok Imagine 2.0 image model: quality and resolution tiers, 15 aspect ratios. See parameters, pricing, and API examples.

Generate and edit images using Grok Imagine 2.0, the quality-focused Grok image model. Choose a quality tier and output resolution, and edit with up to 5 reference images. Every task produces exactly one image.

More on this model: [Grok Imagine 2.0 Image API page](https://unifically.com/models/grok-imagine-2.0-image).

> [!NOTE]
>
> Select this model explicitly for quality. For faster, cheaper generation, use [Grok Imagine 1.0 Image](https://docs.unifically.com/models/image/xai/grok-imagine-1.0-image.md) (`xai/grok-imagine-1.0-image`).

## Model

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

## Two channels, chosen by `enable_nsfw`

| | `enable_nsfw` off or omitted (default) | `enable_nsfw: true` |
| - | - | - |
| Channel | xAI API | grok.com |
| `quality`, `resolution` | Available | Not available (`low` / 1k) |
| `aspect_ratio` | 15 ratios plus `auto` | `1:1`, `2:3`, `3:2`, `4:3`, `9:16`, `16:9`, `21:9`, `5:2` |
| `image_urls` | Up to 5 | Up to 5 |
| `upsample_prompt` | Ignored | Honoured |
| NSFW output | No | Yes |

A request with `enable_nsfw: true` that also sets `quality`, `resolution`, or a wide aspect ratio is rejected with a `422` before any task is created.

## Pricing

Current prices for this model are on the [pricing page](https://unifically.com/pricing); the playground also quotes the exact price of a request before you submit it.

## Parameters

| Parameter | Type | Required | Default | Description |
| - | - | - | - | - |
| `prompt` | string | Yes | — | Text description or edit instruction |
| `quality` | string | No | `"low"` | `"low"` or `"medium"`. API channel only |
| `resolution` | string | No | `"1k"` | `"1k"`, `"1.5k"`, or `"2k"`. API channel only |
| `aspect_ratio` | string | No | `"auto"` | `"auto"`, `"1:1"`, `"16:9"`, `"9:16"`, `"4:3"`, `"3:4"`, `"3:2"`, `"2:3"`, `"2:1"`, `"1:2"`, `"19.5:9"`, `"9:19.5"`, `"20:9"`, `"9:20"`, `"21:9"`, `"5:2"`. With `enable_nsfw: true`, only `"1:1"`, `"2:3"`, `"3:2"`, `"4:3"`, `"9:16"`, `"16:9"`, `"21:9"`, `"5:2"` (default `"1:1"`) |
| `image_urls` | string\[] | No | `null` | 1–5 reference image URLs. Providing this field activates edit mode. Each input image carries a small per-image charge (see the pricing page) |
| `enable_nsfw` | boolean | No | `false` | `true` routes the request to the grok.com channel (see above) |
| `upsample_prompt` | boolean | No | `true` | Let AI enhance the prompt. grok.com channel only; ignored on the API channel |
| `nsfw_check` | boolean | No | `false` | Check the prompt and input images for NSFW content before generating. Off unless set to `true` |

> [!NOTE]
>
> Unknown request fields are rejected rather than ignored. Providing `image_urls` activates editing but does not change the selected model.

> [!WARNING]
>
> Before 18 October 2026 this model ran on the grok.com channel only and `enable_nsfw` defaulted to `true`. It now defaults to `false`: a request that omits the field runs on the xAI API and returns safe-for-work output. Set `enable_nsfw: true` explicitly to keep the previous behaviour.

## Example requests

### Text to image, medium quality at 2k

```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",
      "quality": "medium",
      "resolution": "2k"
    }
  }'
```

### 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"
      ]
    }
  }'
```

### NSFW on the grok.com channel

```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",
      "enable_nsfw": true
    }
  }'
```

## 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"
    }
  }
}
```

> [!NOTE]
>
> **Volume discounts** are available for almost all models. Reach out at [contact@unifically.com](mailto:contact@unifically.com) to discuss custom pricing.


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