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

# Image to Image

> This endpoint edits or combines up to 10 reference images using a text prompt with the Qwen Edit 2.1 model.

> [!WARNING]
>
> Make sure you add your [s3 details](https://docs.modelslab.com/enterprise-api/general/update-s3-details.mdx) for the `qwen_edit_2_1` server, so you can receive the image generated in your bucket.
> Images generated without s3 details being added will be deleted after **24 hours**.

Send one image as a string, or up to **10** as a list. Describe in the prompt what to change, or how to
combine the images.

## Request

Make a `POST` request to below endpoint and pass the required parameters as a request body.

```curl curl theme={"theme":{"light":"github-light","dark":"github-dark"}}
--request POST 'https://modelslab.com/api/v1/enterprise/qwen_edit_2_1/img2img' \
```

## Body

```json json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "key": "enterprise_api_key",
  "prompt": "put the woman from the first image in the jacket from the second image",
  "init_image": [
    "https://assets.modelslab.ai/generations/a56df09f-4c7f-4172-8390-29a22b17877a.avif",
    "https://example.com/jacket.png"
  ],
  "samples": 1,
  "num_inference_steps": 40,
  "guidance_scale": 4,
  "seed": null,
  "safety_checker": false,
  "watermark": false,
  "temp": false,
  "base64": false,
  "webhook": null,
  "track_id": null
}
```

## Body Attributes

**key** `string` *required*

Your API Key used for request authorization.

**prompt** `string` *required*

Text prompt describing the edit you want, or how to combine the reference images.

**init\_image** `string | array` *required*

The reference image, as a single URL or a list of up to `10` URLs. With `base64` set to `true`, send base64 strings instead of URLs.

**negative\_prompt** `string`

Items you don't want in the image.

**width** `number`

Width of the generated image in pixels. Maximum is `2048`. Leave out to follow the size of the reference image.

**height** `number`

Height of the generated image in pixels. Maximum is `2048`. Leave out to follow the size of the reference image.

**aspect\_ratio** `string`

Shorthand for a width and height pair, used only when `width` and `height` are not both set.

**samples** `number` (default: 1)

Number of images to return in the response. Maximum is `4`.

**num\_inference\_steps** `number` (default: 40)

Number of denoising steps. Minimum is `30`, maximum is `40`.

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

How closely the image follows the prompt. Minimum is `0`, maximum is `10`.

**seed** `number`

Seed is used to reproduce results. The same seed will give you the same image again. Pass *null* for a random number.

**kv\_cache** `boolean` (default: true)

Speeds up generation at the cost of GPU memory. Turn it off if a large request runs out of memory. **options**: `true` or `false`.

**transparent** `boolean` (default: false)

Generate the image with a transparent background. **options**: `true` or `false`.

**safety\_checker** `boolean` (default: false)

Check the generated image for NSFW content. **options**: `true` or `false`.

**safety\_checker\_type** `string` (default: black)

What to do with an image the safety checker flags. **options**: `black`, `blur` or `sensitive_content_text`.

**watermark** `boolean` (default: false)

Whether to watermark the generated image. **options**: `true` or `false`.

**temp** `boolean` (default: false)

If true, stores the image in temporary storage which is cleaned every 24 hours. **options**: `true` or `false`.

**base64** `boolean` (default: false)

Set to `true` when you are sending or expecting base64 rather than URLs. **options**: `true` or `false`.

**webhook** `string`

Set a URL to get a POST API call once the image generation is complete.

**track\_id** `string`

This ID is returned in the response to the webhook API call. This will be used to identify the webhook request.


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