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

# Image to Image

> Generate images from reference images and reusable elements with Kling Image 4.0, up to 8K.

## Models

| Model | Resolutions | References | Images per task |
| - | - | - | - |
| `kling-4-0/image` — Kling Image 4.0 | 2K, 4K, 8K | up to 10 images and elements combined | 1–9 (series: 2–10) |

> [!NOTE]
>
> This endpoint only accepts `kling-4-0/image`. Mention every reference in the prompt: images as `@image_1`, `@image_2` …
> in the order of `image_urls`, and elements by their name as `@name`. Mentioning a reference that was not provided
> is rejected and no task is created.

## Pricing

Billed per generated image at the official price, plus \$0.003 per task for every reference image or element:

| Resolution | Price per image |
| - | - |
| `2K` | \$0.063 |
| `4K` | \$0.094 |
| `8K` | \$0.157 |

For example, 2 images at `2K` with 1 reference image cost 2 × \$0.063 + \$0.003 = \$0.129.

## Body Parameters

**model** `string` *required*

Model to use: `kling-4-0/image`.

**input** `object` *required*

Input parameters for the generation.

**properties**

**prompt** `string` *required*

Text description of the image to generate, mentioning references as `@image_1`, `@image_2` … and elements as `@name`.
Maximum length: 20000 characters. To render text in the image, put the text inside quotation marks.

**image\_urls** `string[]`

Reference images, up to 10. Publicly accessible JPG/PNG URLs, max 20 MB each.
`image_urls` and `elements` together cannot exceed 10 items.

**elements** `object[]`

Subjects defined for this task only, up to 10. Mention each one in the prompt as `@name`.

**element properties**

**name** `string` *required*

Name used in the prompt. 1–20 characters: Chinese characters, letters, digits and underscores.
Must be unique (case-insensitive) and cannot be `image_N` or `object_N`.

**image\_urls** `string[]` *required*

2–4 publicly accessible JPG/PNG images of the same subject from different angles. The first image is the main view.

**tag** `string`

Subject category: `character`, `animal`, `prop`, `costume`, `scene`, `effect` or `others`. Inferred when omitted.

**description** `string`

Optional subject description, up to 100 characters.

**resolution** `string` (default: 2K)

Output resolution: `2K`, `4K` or `8K` (case-insensitive). `2K` / `4K` usually return PNG, `8K` returns JPEG.

**aspect\_ratio** `string` (default: auto)

Output aspect ratio: `auto`, `9:16`, `2:3`, `3:4`, `1:1`, `4:3`, `3:2`, `16:9`, `21:9`.
`auto` lets the model choose from the prompt and references.

**mode** `string` (default: default)

`default` for independent images (`count` `1`–`9`), or `series` for a coherent set (`count` required, `2`–`10`).

**count** `integer` (default: 1)

Number of images to generate. The task result contains one URL per image.

**webhookUrl** `string`

URL to receive a webhook when the task completes.

**metadata** `object`

Custom key-value metadata to attach to the task.

```bash cURL theme={null}
curl -X POST https://api.modelhunter.ai/api/v1/kling/image-to-image \
  -H "Authorization: Bearer $MODELHUNTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kling-4-0/image",
    "input": {
      "prompt": "@Hero walks across the bridge from @image_1 at sunset, cinematic lighting",
      "image_urls": ["https://example.com/garden.jpg"],
      "elements": [
        {
          "name": "Hero",
          "image_urls": ["https://example.com/hero-front.jpg", "https://example.com/hero-side.jpg"],
          "tag": "character"
        }
      ],
      "resolution": "2K",
      "aspect_ratio": "16:9"
    }
  }'
```

```json 202 theme={null}
{
  "success": true,
  "data": {
    "id": "task_abc123",
    "status": "pending",
    "type": "image-to-image",
    "provider": "kling",
    "model": "kling-4-0/image",
    "created_at": "2026-11-24T10:00:00Z",
    "estimated_seconds": 60
  }
}
```

```json 400 theme={null}
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "input.image_urls and input.elements together must not exceed 10 items"
  }
}
```


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