---
title: Grok Imagine Image | Runware Docs
url: https://runware.ai/docs/models/xai-grok-imagine-image
description: AI image generation from text and images
---
# Grok Imagine Image

![Grok Imagine Image](https://assets.runware.ai/covers/xai-grok-imagine-image.jpg)

Grok Imagine Image is a multimodal generative image model that creates high-quality still images from text prompts or image inputs. It supports flexible visual synthesis across a range of styles, enabling developers to generate creative imagery directly from structured prompts or to expand on existing visuals with coherent, detailed outputs.

- **Status**: live
- **ID**: `xai:grok-imagine@image`
- Try in Playground
- **Creator**: xAI
- **Release Date**: January 29, 2026
- **Zero Data Retention**: Yes
- **Capabilities**: Text to Image, Image to Image, Checkpoint

## Pricing

$0.02 per run · ~14s per request

**Rates**

- Per run · per run: `$0.02`
- Input image · per input image: `$0.002`

**4 example generations**

- [text-to-image](https://runware.ai/docs/models/xai-grok-imagine-image/examples#example-oyster-restoration-panoramic-masthead) · 1408×768: `$0.02` (~8s)
- [text-to-image](https://runware.ai/docs/models/xai-grok-imagine-image/examples#example-arctic-airlift-strategy-key-art) · 1408×768: `$0.02` (~9s)
- [reference-to-image](https://runware.ai/docs/models/xai-grok-imagine-image/examples#example-heritage-hotel-facade-cleanup) · 1K: `$0.022` (~18s)
- [reference-to-image](https://runware.ai/docs/models/xai-grok-imagine-image/examples#example-period-telephone-thriller-poster) · 1K: `$0.022` (~20s)

times vary, measured end to end · [How pricing works](https://runware.ai/docs/models-api/pricing)

## Compatibility & Validation

Either provide `inputs.referenceImages`, or specify `width/height`.

---

`resolution` cannot be used with `width/height`.

---

When `resolution` is provided, `inputs.referenceImages` is required.

---

`width` and `height` must be used together.

---

The following dimension combinations are supported:

| Configuration | Dimensions |
| --- | --- |
| `1K (1:1)` | `1024x1024` |
| `1K (3:4)` | `896x1280` |
| `1K (4:3)` | `1280x896` |
| `1K (9:16)` | `768x1408` |
| `1K (16:9)` | `1408x768` |
| `1K (2:3)` | `864x1296` |
| `1K (3:2)` | `1296x864` |
| `1K (9:19.5)` | `576x1248` |
| `1K (19.5:9)` | `1248x576` |
| `1K (9:20)` | `576x1280` |
| `1K (20:9)` | `1280x576` |
| `1K (1:2)` | `704x1408` |
| `1K (2:1)` | `1408x704` |

## Request Parameters

**API Options**

Platform-level options for task execution and delivery.

### [taskType](https://runware.ai/docs/models/xai-grok-imagine-image#request-tasktype)

- **Type**: `string`
- **Required**: true
- **Value**: `imageInference`

Identifier for the type of task being performed.

### [taskUUID](https://runware.ai/docs/models/xai-grok-imagine-image#request-taskuuid)

- **Type**: `string`
- **Required**: true
- **Format**: `UUID v4`

UUID v4 identifier for tracking tasks and matching async responses. Must be unique per task.

### [outputType](https://runware.ai/docs/models/xai-grok-imagine-image#request-outputtype)

- **Type**: `string`
- **Default**: `URL`

Image output type.

**Allowed values**: `URL` `base64Data` `dataURI`

### [outputFormat](https://runware.ai/docs/models/xai-grok-imagine-image#request-outputformat)

- **Type**: `string`
- **Default**: `JPG`

Specifies the file format of the generated output. The available values depend on the task type and the specific model's capabilities.

- \`JPG\`: Best for photorealistic images with smaller file sizes (no transparency).
- \`PNG\`: Lossless compression, supports high quality and transparency (alpha channel).
- \`WEBP\`: Modern format providing superior compression and transparency support.

> [!NOTE]
> \*\*Transparency\*\*: If you are using features like background removal or LayerDiffuse that require transparency, you must select a format that supports an alpha channel (e.g., \`PNG\`, \`WEBP\`, \`TIFF\`). \`JPG\` does not support transparency.

**Allowed values**: `JPG` `PNG` `WEBP`

### [outputQuality](https://runware.ai/docs/models/xai-grok-imagine-image#request-outputquality)

- **Type**: `integer`
- **Min**: `20`
- **Max**: `99`
- **Default**: `95`

Compression quality of the output. Higher values preserve quality but increase file size.

### [webhookURL](https://runware.ai/docs/models/xai-grok-imagine-image#request-webhookurl)

- **Type**: `string`
- **Format**: `uri`

Webhook URL that receives JSON responses via HTTP POST when generation tasks complete. For batch requests with multiple results, each completed item triggers a separate webhook call as it becomes available.

**Learn more** (1 resource):

- [Webhooks](https://runware.ai/docs/models-api/webhooks) (platform)

### [deliveryMethod](https://runware.ai/docs/models/xai-grok-imagine-image#request-deliverymethod)

- **Type**: `string`
- **Default**: `sync`

Determines how the API delivers task results.

**Allowed values**:

- `sync` Returns results directly in the API response. Over HTTP, a task still running after 120 seconds continues as an async task and comes back with status 'processing'. Poll for its results using getResponse.
- `async` Returns an immediate acknowledgment with the task UUID. Poll for results using getResponse.

**Learn more** (1 resource):

- [Task Polling](https://runware.ai/docs/models-api/task-polling) (platform)

### [uploadEndpoint](https://runware.ai/docs/models/xai-grok-imagine-image#request-uploadendpoint)

- **Type**: `string`
- **Format**: `uri`

Specifies a URL where the generated content will be automatically uploaded using the HTTP PUT method. The raw binary data of the media file is sent directly as the request body. For secure uploads to cloud storage, use presigned URLs that include temporary authentication credentials.

**Common use cases:**

- **Cloud storage**: Upload directly to S3 buckets, Google Cloud Storage, or Azure Blob Storage using presigned URLs.
- **CDN integration**: Upload to content delivery networks for immediate distribution.

```text
// S3 presigned URL for secure upload
https://your-bucket.s3.amazonaws.com/generated/content.mp4?X-Amz-Signature=abc123&X-Amz-Expires=3600

// Google Cloud Storage presigned URL
https://storage.googleapis.com/your-bucket/content.jpg?X-Goog-Signature=xyz789

// Custom storage endpoint
https://storage.example.com/uploads/generated-image.jpg
```

The content data will be sent as the request body to the specified URL when generation is complete.

### [safety](https://runware.ai/docs/models/xai-grok-imagine-image#request-safety)

- **Path**: `safety.checkContent`
- **Type**: `object (1 property)`

Content safety checking configuration for image generation.

#### [checkContent](https://runware.ai/docs/models/xai-grok-imagine-image#request-safety-checkcontent)

- **Path**: `safety.checkContent`
- **Type**: `boolean`

Enable or disable content safety checking. Increases total generation time and adds a small charge on top of the generation cost.

### [ttl](https://runware.ai/docs/models/xai-grok-imagine-image#request-ttl)

- **Type**: `integer`
- **Min**: `60`

Time-to-live (TTL) in seconds for generated content. Only applies when `outputType` is `URL`.

### [includeCost](https://runware.ai/docs/models/xai-grok-imagine-image#request-includecost)

- **Type**: `boolean`

Include task cost in the response.

### [numberResults](https://runware.ai/docs/models/xai-grok-imagine-image#request-numberresults)

- **Type**: `integer`
- **Min**: `1`
- **Max**: `20`
- **Default**: `1`

Number of results to generate. Each result uses a different seed, producing variations of the same parameters.

**Inputs**

Input resources for the task (images, audio, etc). These must be nested inside the \`inputs\` object.

### [referenceImages](https://runware.ai/docs/models/xai-grok-imagine-image#request-inputs-referenceimages)

- **Path**: `inputs.referenceImages`
- **Type**: `array of strings`
- **Min items**: `1`
- **Max items**: `3`

List of reference images (UUID, URL, Data URI, or Base64).

**Core Parameters**

Primary parameters that define the task output.

### [model](https://runware.ai/docs/models/xai-grok-imagine-image#request-model)

- **Type**: `string`
- **Required**: true
- **Value**: `xai:grok-imagine@image`

Send `auto` instead of an AIR identifier to have the model router choose the model for this task. The rest of the request is unchanged, every value you send is kept, and only the parameters you leave out are filled in. See [Model Router](https://runware.ai/docs/models-api/model-router).

**Learn more** (3 resources):

- [Text To Image: Model Selection](https://runware.ai/docs/learn/text-to-image#model-selection) (learn)
- [Image Inpainting: Model Specialized Inpainting Models](https://runware.ai/docs/learn/image-inpainting#model-specialized-inpainting-models) (learn)
- [Image Outpainting: Other Critical Parameters](https://runware.ai/docs/learn/image-outpainting#other-critical-parameters) (learn)

### [positivePrompt](https://runware.ai/docs/models/xai-grok-imagine-image#request-positiveprompt)

- **Type**: `string`
- **Required**: true
- **Min**: `1`

Text prompt describing elements to include in the generated output.

**Learn more** (1 resource):

- [Prompts](https://runware.ai/docs/learn/prompts) (learn)

### [width](https://runware.ai/docs/models/xai-grok-imagine-image#request-width)

- **Type**: `integer`
- **Required**: conditional — Required when inputs.referenceImages is not provided
- **Paired with**: height

Width of the generated media in pixels.

**Learn more** (2 resources):

- [Dimensions](https://runware.ai/docs/learn/dimensions) (learn)
- [Image Outpainting: Dimensions Critical For Outpainting](https://runware.ai/docs/learn/image-outpainting#dimensions-critical-for-outpainting) (learn)

### [height](https://runware.ai/docs/models/xai-grok-imagine-image#request-height)

- **Type**: `integer`
- **Required**: conditional — Required when inputs.referenceImages is not provided
- **Paired with**: width

Height of the generated media in pixels.

**Learn more** (2 resources):

- [Dimensions](https://runware.ai/docs/learn/dimensions) (learn)
- [Image Outpainting: Dimensions Critical For Outpainting](https://runware.ai/docs/learn/image-outpainting#dimensions-critical-for-outpainting) (learn)

### [resolution](https://runware.ai/docs/models/xai-grok-imagine-image#request-resolution)

- **Type**: `string`
- **Default**: `1K`

Resolution preset for the output. When used with input media, automatically matches the aspect ratio from the input.

**Allowed values**: `1K`

**Features**

Standalone addons and post-processing features.

### [watermark](https://runware.ai/docs/models/xai-grok-imagine-image#request-advancedfeatures-watermark)

- **Path**: `advancedFeatures.watermark`
- **Type**: `object (6 properties)`

Configuration object for adding watermarks to generated videos. Watermarks can be applied using either text or image content with customizable positioning and appearance. You must provide either `text` or `image` content for the watermark, but not both.

**Text watermark**:

```json
"advancedFeatures": {
  "watermark": {
    "text": "© 2025 Company",
    "displayPosition": "bottom-right",
    "opacity": 0.6,
    "fontColor": "#ffffff",
    "bgColor": "#000000"
  }
}
```

**Image watermark**:

```json
"advancedFeatures": {
  "watermark": {
    "image": "c64351d5-4c59-42f7-95e1-eace013eddab",
    "displayPosition": "top-left",
    "opacity": 0.6
  }
}
```

**Tiled watermark**:

```json
"advancedFeatures": {
  "watermark": {
    "text": "PREVIEW",
    "tiled": true,
    "opacity": 0.4,
    "fontColor": "#cccccc"
  }
}
```

#### [text](https://runware.ai/docs/models/xai-grok-imagine-image#request-advancedfeatures-watermark-text)

- **Path**: `advancedFeatures.watermark.text`
- **Type**: `string`
- **Min**: `2`
- **Max**: `32`

Watermark text.

#### [image](https://runware.ai/docs/models/xai-grok-imagine-image#request-advancedfeatures-watermark-image)

- **Path**: `advancedFeatures.watermark.image`
- **Type**: `string`

Watermark image (UUID, URL, Data URI, or Base64).

#### [displayPosition](https://runware.ai/docs/models/xai-grok-imagine-image#request-advancedfeatures-watermark-displayposition)

- **Path**: `advancedFeatures.watermark.displayPosition`
- **Type**: `string`

Watermark position.

**Allowed values**: `top-left` `top-center` `top-right` `center-left` `center-center` `center-right` `bottom-left` `bottom-center` `bottom-right` `tiled`

#### [opacity](https://runware.ai/docs/models/xai-grok-imagine-image#request-advancedfeatures-watermark-opacity)

- **Path**: `advancedFeatures.watermark.opacity`
- **Type**: `float`
- **Min**: `0.1`
- **Max**: `1`
- **Step**: `0.01`

Watermark opacity.

#### [fontColor](https://runware.ai/docs/models/xai-grok-imagine-image#request-advancedfeatures-watermark-fontcolor)

- **Path**: `advancedFeatures.watermark.fontColor`
- **Type**: `string`

Text color in hex format.

#### [bgColor](https://runware.ai/docs/models/xai-grok-imagine-image#request-advancedfeatures-watermark-bgcolor)

- **Path**: `advancedFeatures.watermark.bgColor`
- **Type**: `string`

Background color in hex format.

## Response Parameters

### [taskType](https://runware.ai/docs/models/xai-grok-imagine-image#response-tasktype)

- **Type**: `string`
- **Required**: true
- **Value**: `imageInference`

Identifier for the type of task this response belongs to.

### [taskUUID](https://runware.ai/docs/models/xai-grok-imagine-image#response-taskuuid)

- **Type**: `string`
- **Required**: true
- **Format**: `UUID v4`

UUID v4 identifier echoed from the original request, used to match async responses to their tasks.

### [imageUUID](https://runware.ai/docs/models/xai-grok-imagine-image#response-imageuuid)

- **Type**: `string`
- **Required**: true
- **Format**: `UUID v4`

UUID of the output image.

### [imageURL](https://runware.ai/docs/models/xai-grok-imagine-image#response-imageurl)

- **Type**: `string`
- **Format**: `uri`

URL of the output image.

### [imageBase64Data](https://runware.ai/docs/models/xai-grok-imagine-image#response-imagebase64data)

- **Type**: `string`

Base64-encoded image data.

### [imageDataURI](https://runware.ai/docs/models/xai-grok-imagine-image#response-imagedatauri)

- **Type**: `string`
- **Format**: `uri`

Data URI of the output image.

### [NSFWContent](https://runware.ai/docs/models/xai-grok-imagine-image#response-nsfwcontent)

- **Type**: `boolean`

Flag indicating if NSFW content was detected.

### [cost](https://runware.ai/docs/models/xai-grok-imagine-image#response-cost)

- **Type**: `float`

Task cost in USD. Present when `includeCost` is set to `true` in the request.

## Examples

### text-to-image (text-to-image)

![Oyster Restoration Panoramic Masthead](https://assets.runware.ai/examples/xai-grok-imagine-image/be5b9e12-ab8b-43e4-aebf-ae77582691eb.jpg)

```json
{
  "taskType": "imageInference",
  "taskUUID": "e8f184df-b99e-428f-b0d9-efcd21b0c237",
  "model": "xai:grok-imagine@image",
  "positivePrompt": "Create a finished 1408x768 panoramic editorial photograph for a coastal conservation feature about oyster reef restoration. At the center, a marine ecologist in weathered chest waders and faded coral work gloves kneels in a shallow tidal creek, inspecting a wire reef cage filled with rough oyster shells. Expand the scene naturally across the wide frame: on the left, long rows of shell-filled restoration cages recede through reflective water toward a small aluminum work skiff; on the right, ochre salt-marsh grass, muddy tidal channels, white egrets, and two distant crew members carrying baskets create layered environmental context. Low dawn light beneath an overcast sky, oyster-gray water, muted sage and straw palette, subtle coral accents, soft atmospheric haze, realistic wet textures, restrained documentary color grading, calm purposeful mood. The central action must remain immediately readable while both extended sides contain coherent landscape detail suitable for a wide magazine or nonprofit website masthead. Authentic photojournalism, natural proportions, eye-level 35mm composition, no lettering, no logos, no border, no interface.",
  "width": 1408,
  "height": 768
}
```

---

### text-to-image (text-to-image)

![Arctic Airlift Strategy Key Art](https://assets.runware.ai/examples/xai-grok-imagine-image/f6110377-fbb2-4d24-80dd-1f3e1ebc49aa.jpg)

```json
{
  "taskType": "imageInference",
  "taskUUID": "57dbc1d3-ff98-40e7-ae35-496c1bc58623",
  "model": "xai:grok-imagine@image",
  "positivePrompt": "Finished cinematic key art for a premium survival logistics strategy game set in the 1970s high Arctic. A weathered orange-and-cream four-engine propeller cargo plane sits diagonally across a windswept ice runway, its rear hold open as a bundled ground crew unloads wooden crates, fuel drums, a compact tracked snow vehicle, and a portable radio mast. In the foreground, the station leader in a red parka braces against the gale while holding a paper manifest; behind her, technicians pull a supply sled toward a small cluster of utilitarian research huts half-buried in snow. A vast approaching wall of spindrift and slate-gray storm clouds dominates the right side, while low amber polar sunlight breaks beneath the clouds on the left, catching the aircraft, blowing snow, and long runway markers. Strong readable silhouettes, purposeful human activity, sweeping diagonal composition, immense sense of scale and isolation. Sophisticated hand-painted editorial realism with subtle screen-printed texture, restrained palette of glacier blue, warm ivory, safety orange, rust red, and charcoal, grounded period-authentic equipment, tense but determined mood, polished commercial game key art, clear visual hierarchy, no lettering, no logo, no interface, no border",
  "width": 1408,
  "height": 768
}
```

---

### reference-to-image (reference-to-image)

![Heritage Hotel Facade Cleanup](https://assets.runware.ai/examples/xai-grok-imagine-image/71d3101a-53b5-4640-b2bd-a1f67ea86763.jpg)

```json
{
  "taskType": "imageInference",
  "taskUUID": "47cb2152-420e-44bb-859f-a785a6fae34e",
  "model": "xai:grok-imagine@image",
  "positivePrompt": "Produce one finished, photorealistic landscape architectural marketing photograph. Treat reference image 1 as the base image and preserve its exact building proportions, camera position, perspective, crop, upper floors, window arrangement, overcast illumination, and restrained neutral color. Remove the blue construction lift, fencing, orange barriers, protective sheeting, loose cables, debris, and all other temporary renovation clutter. Use reference image 2 as the authoritative visual guide to reconstruct only the areas that were hidden: matching carved limestone pilasters, dark bronze entrance doors, patterned transom glass, rust-red awnings, brass lanterns, facade joints, and pale stone pavement. Blend the generative fill seamlessly with consistent texture, weathering, reflections, shadows, and lens perspective. Keep the street calm and empty, with no workers, vehicles, added signage, invented lettering, or redesign of the architecture. Premium but natural hospitality property photography with meticulous invisible retouching.",
  "resolution": "1K",
  "inputs": {
    "referenceImages": [
      "https://assets.runware.ai/assets/inputs/219a77e0-fd68-4b91-9c91-bdbc45a2cc6c.jpg",
      "https://assets.runware.ai/assets/inputs/6ea2d67a-b217-449c-9af6-2f95fb47a5f1.jpg"
    ]
  }
}
```

---

### reference-to-image (reference-to-image)

![Period Telephone Thriller Poster](https://assets.runware.ai/examples/xai-grok-imagine-image/d652f847-628f-41e1-a8c1-ac5b5f03fc6d.jpg)

```json
{
  "taskType": "imageInference",
  "taskUUID": "ed1c603b-f404-46ac-b407-a1f0cdc3ae64",
  "model": "xai:grok-imagine@image",
  "positivePrompt": "Create a finished vertical one-sheet poster for a prestige 1960s conspiracy streaming series titled \"PARTY LINE\". Use reference image 1 to establish the lead character’s recognizable face, dark bobbed hair, mustard blouse, brown vest, guarded expression, and period headset. Use reference image 2 to inform the authentic switchboard architecture, brass sockets, indicator lights, desks, and tangled patch cords. Do not simply reproduce either reference: combine them into a bold, coherent mid-century editorial poster composition. Place the operator as a large centered bust, staring just past the viewer as if she has overheard something dangerous. Merge the switchboard into the shadow behind her; its patch cords radiate around her head and converge into a taut web across the lower half, with one vivid red cord subtly forming a noose-like loop. Render the scene as sophisticated 1960s offset-lithograph key art with simplified geometric shapes, coarse halftone grain, slightly imperfect ink registration, crisp facial planes, and restrained screen-printed texture. Limited palette of aged cream, tobacco brown, mustard yellow, oxblood red, and dense charcoal black. Flat dramatic lighting, high contrast, tense and intelligent mood, no neon, no futuristic technology, no photorealistic collage edges. Reserve clean negative space at the top. Set the exact title \"PARTY LINE\" prominently at the top in large condensed cream sans-serif lettering with subtle letterpress distress. Add only the small line \"A LIMITED SERIES\" beneath it; no other legible text, no logos, no interface, no poster mockup, no border. Polished award-season streaming key art composed for a vertical 1K poster.",
  "resolution": "1K",
  "inputs": {
    "referenceImages": [
      "https://assets.runware.ai/assets/inputs/c89b145c-4868-4622-9310-d01067e526e5.jpg",
      "https://assets.runware.ai/assets/inputs/1b914216-7157-49bb-87a4-49cfae60a79c.jpg"
    ]
  }
}
```