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

# Grok Imagine Image 2.0

> Use Grok Imagine Image 2.0 with the Mynth SDK or REST API. Capabilities, inputs, auto size, and magic prompt.

```text Model ID theme={"theme":"kanagawa-dragon"}
xai/grok-imagine-image-2.0
```

See pricing & more on [mynth.io](https://mynth.io/models/xai%2Fgrok-imagine-image-2.0).

## Capabilities

|                      |                                 |
| -------------------- | ------------------------------- |
| **Modes**            | Text-to-image · Image-to-image  |
| **Inputs**           | Up to 3 images (image-to-image) |
| **Native auto size** | Yes (image-to-image)            |
| **Magic prompt**     | Supported                       |

## Generate

<CodeGroup>
  ```ts Mynth SDK theme={"theme":"kanagawa-dragon"}
  import Mynth from "@mynthio/sdk";

  const mynth = new Mynth();

  const task = await mynth.image.generate({
    prompt: "Architectural photograph of a brutalist library at golden hour",
    model: "xai/grok-imagine-image-2.0",
    size: "landscape",
    count: 1,
  });

  console.log(task.urls);
  ```

  ```bash REST API theme={"theme":"kanagawa-dragon"}
  curl https://api.mynth.io/image/generate \
    -X POST \
    -H "Authorization: Bearer $MYNTH_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "prompt": "Architectural photograph of a brutalist library at golden hour",
      "model": "xai/grok-imagine-image-2.0",
      "size": "landscape",
      "count": 1
    }'
  ```
</CodeGroup>

## Use inputs

Pass up to **3** input images for image-to-image. URLs or uploaded files both work. See [Upload input images](/guides/upload-input-images).

<CodeGroup>
  ```ts Mynth SDK theme={"theme":"kanagawa-dragon"}
  const task = await mynth.image.generate({
    prompt: "Restyle this photo as a cinematic still",
    model: "xai/grok-imagine-image-2.0",
    inputs: ["https://example.com/input-image.jpg"],
    size: "landscape",
  });
  ```

  ```bash REST API theme={"theme":"kanagawa-dragon"}
  curl https://api.mynth.io/image/generate \
    -X POST \
    -H "Authorization: Bearer $MYNTH_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "prompt": "Restyle this photo as a cinematic still",
      "model": "xai/grok-imagine-image-2.0",
      "inputs": [
        {
          "type": "image",
          "source": { "type": "url", "url": "https://example.com/input-image.jpg" }
        }
      ],
      "size": "landscape"
    }'
  ```
</CodeGroup>

## Auto size

This model supports **native auto size** in image-to-image mode (preserves the input image aspect ratio).

```ts theme={"theme":"kanagawa-dragon"}
size: "auto";
// or
size: {
  type: "auto";
}
```

See [Control size](/guides/control-size).
