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

# Flux 1 Kontext Image to Image API

> Strong character consistency with good understanding of complex prompts and text.

[← Flux](https://docs.creatify.ai/api-documentation/ai-generation/models/flux.md)

**Model name:** `flux-pro/kontext/max/multi`\
**Generation type:** `image_to_image`\
**Endpoint:** [`POST /api/asset_generator/`](https://docs.creatify.ai/api-reference/ai-generation/post-ai-generation)

## Pricing

**1.0** credits per output.

Prices are per output. When a request asks for several outputs, the charge is this price times the number of outputs.

## Quick start

The example uses sample media from our CDN. Swap in publicly accessible URLs for your own files.

```bash cURL theme={null}
curl --request POST \
  --url https://api.creatify.ai/api/asset_generator/ \
  --header 'Content-Type: application/json' \
  --header 'X-API-ID: your-api-id' \
  --header 'X-API-KEY: your-api-key' \
  --data '{
    "model_name": "flux-pro/kontext/max/multi",
    "input_params": {
      "prompt": "Place her in a bright café with soft morning light.",
      "image_urls": [
        "https://d35ghwdno3nak3.cloudfront.net/tutorial/avatar-aurora/recommendation-4.jpg"
      ]
    }
  }'
```

```python Python theme={null}
import requests

response = requests.post(
    "https://api.creatify.ai/api/asset_generator/",
    headers={"X-API-ID": "your-api-id", "X-API-KEY": "your-api-key"},
    json={
        "model_name": "flux-pro/kontext/max/multi",
        "input_params": {
            "prompt": "Place her in a bright café with soft morning light.",
            "image_urls": [
                "https://d35ghwdno3nak3.cloudfront.net/tutorial/avatar-aurora/recommendation-4.jpg"
            ]
        },
    },
)
print(response.json()["id"])
```

## Input parameters

Send these fields in `input_params`.

**prompt** `string` *required*

The prompt to generate an image from.

Minimum characters: `1`.
Maximum characters: `2000`.

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

List of URLs of input images for editing.

Minimum items: `1`.
Maximum items: `4`.

**seed** `integer`

The same seed and the same prompt given to the same version of the model will output the same image every time.

**num\_images** `integer` (default: 1)

The number of images to generate.

Minimum: `1`.
Maximum: `4`.

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

The aspect ratio of the generated image.

Allowed values: `"21:9"`, `"16:9"`, `"4:3"`, `"3:2"`, `"1:1"`, `"2:3"`, `"3:4"`, `"9:16"`, `"9:21"`.

**output\_format** `string` (default: jpeg)

The format of the generated image.

Allowed values: `"jpeg"`, `"png"`.

**enhance\_prompt** `boolean` (default: false)

Whether to enhance the prompt for better results.

**guidance\_scale** `number` (default: 3.5)

The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you.

Minimum: `1`.
Maximum: `20`.
Multiple of: `0.5`.

> [accordion] Complete JSON schema
>
> ```json theme={null}
> {
>   "$schema": "http://json-schema.org/draft-07/schema#",
>   "required": [
>     "prompt",
>     "image_urls"
>   ],
>   "properties": {
>     "seed": {
>       "type": "integer",
>       "title": "Seed",
>       "description": "The same seed and the same prompt given to the same version of the model will output the same image every time.",
>       "x-advance-settings": true
>     },
>     "prompt": {
>       "type": "string",
>       "title": "Prompt",
>       "maxLength": 2000,
>       "minLength": 1,
>       "description": "The prompt to generate an image from."
>     },
>     "image_urls": {
>       "type": "array",
>       "items": {
>         "type": "string"
>       },
>       "title": "Image URLs",
>       "maxItems": 4,
>       "minItems": 1,
>       "description": "List of URLs of input images for editing."
>     },
>     "num_images": {
>       "type": "integer",
>       "title": "Num Images",
>       "default": 1,
>       "maximum": 4,
>       "minimum": 1,
>       "x-ui-name": "output_nums",
>       "description": "The number of images to generate."
>     },
>     "aspect_ratio": {
>       "enum": [
>         "21:9",
>         "16:9",
>         "4:3",
>         "3:2",
>         "1:1",
>         "2:3",
>         "3:4",
>         "9:16",
>         "9:21"
>       ],
>       "type": "string",
>       "title": "Aspect Ratio",
>       "default": "1:1",
>       "description": "The aspect ratio of the generated image."
>     },
>     "output_format": {
>       "enum": [
>         "jpeg",
>         "png"
>       ],
>       "type": "string",
>       "title": "Output Format",
>       "default": "jpeg",
>       "description": "The format of the generated image."
>     },
>     "enhance_prompt": {
>       "type": "boolean",
>       "title": "Enhance Prompt",
>       "default": false,
>       "description": "Whether to enhance the prompt for better results.",
>       "x-advance-settings": true
>     },
>     "guidance_scale": {
>       "type": "number",
>       "title": "Guidance scale (CFG)",
>       "default": 3.5,
>       "maximum": 20,
>       "minimum": 1,
>       "multipleOf": 0.5,
>       "description": "The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you.",
>       "x-advance-settings": true
>     }
>   }
> }
> ```

## Response

The request returns the task with `status: "initializing"`. Poll [GET /api/asset\_generator/\{id}/](https://docs.creatify.ai/api-reference/ai-generation/get-ai-generation-.md) until `status` is `done` or `failed`, or pass a `webhook_url` to be notified. A finished task lists its files in `assets` and the credits it charged in `credits_used`.


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