> ## 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](/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**.
</Warning>

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

<ParamField query="key" type="string" required placeholder="Your API key">
  Your API Key used for request authorization.
</ParamField>

<ParamField query="prompt" type="string" required placeholder="What to change">
  Text prompt describing the edit you want, or how to combine the reference images.
</ParamField>

<ParamField query="init_image" type="string | array" required placeholder="Image URL or list of URLs">
  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.
</ParamField>

<ParamField query="negative_prompt" type="string" placeholder="Items you don't want">
  Items you don't want in the image.
</ParamField>

<ParamField query="width" type="number" placeholder="max 2048">
  Width of the generated image in pixels. Maximum is `2048`. Leave out to follow the size of the reference image.
</ParamField>

<ParamField query="height" type="number" placeholder="max 2048">
  Height of the generated image in pixels. Maximum is `2048`. Leave out to follow the size of the reference image.
</ParamField>

<ParamField query="aspect_ratio" type="string">
  Shorthand for a width and height pair, used only when `width` and `height` are not both set.
</ParamField>

<ParamField query="samples" type="number" default="1" placeholder="1-4">
  Number of images to return in the response. Maximum is `4`.
</ParamField>

<ParamField query="num_inference_steps" type="number" default="40" placeholder="30-40">
  Number of denoising steps. Minimum is `30`, maximum is `40`.
</ParamField>

<ParamField query="guidance_scale" type="number" default="4" placeholder="0-10">
  How closely the image follows the prompt. Minimum is `0`, maximum is `10`.
</ParamField>

<ParamField query="seed" type="number" placeholder="Seed number or null">
  Seed is used to reproduce results. The same seed will give you the same image again. Pass <em>null</em> for a random number.
</ParamField>

<ParamField query="kv_cache" type="boolean" default="true">
  Speeds up generation at the cost of GPU memory. Turn it off if a large request runs out of memory. <strong>options</strong>: <code>true</code> or <code>false</code>.
</ParamField>

<ParamField query="transparent" type="boolean" default="false">
  Generate the image with a transparent background. <strong>options</strong>: <code>true</code> or <code>false</code>.
</ParamField>

<ParamField query="safety_checker" type="boolean" default="false">
  Check the generated image for NSFW content. <strong>options</strong>: <code>true</code> or <code>false</code>.
</ParamField>

<ParamField query="safety_checker_type" type="string" default="black">
  What to do with an image the safety checker flags. <strong>options</strong>: <code>black</code>, <code>blur</code> or <code>sensitive\_content\_text</code>.
</ParamField>

<ParamField query="watermark" type="boolean" default="false">
  Whether to watermark the generated image. <strong>options</strong>: <code>true</code> or <code>false</code>.
</ParamField>

<ParamField query="temp" type="boolean" default="false">
  If true, stores the image in temporary storage which is cleaned every 24 hours. <strong>options</strong>: <code>true</code> or <code>false</code>.
</ParamField>

<ParamField query="base64" type="boolean" default="false">
  Set to `true` when you are sending or expecting base64 rather than URLs. <strong>options</strong>: <code>true</code> or <code>false</code>.
</ParamField>

<ParamField query="webhook" type="string" placeholder="Webhook URL">
  Set a URL to get a POST API call once the image generation is complete.
</ParamField>

<ParamField query="track_id" type="string" placeholder="Tracking ID">
  This ID is returned in the response to the webhook API call. This will be used to identify the webhook request.
</ParamField>


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