> ## 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

> The Endpoint generates an image from an image.

<Note>
  Make sure you add your [s3 details](/enterprise-api/general/update-s3-details) for `flux` server, so you can receive image generated in your bucket.
  Images generated without s3 details being added will be delete after <b>24hours</b>
</Note>

## Request

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

```curl curl theme={null}
--request POST 'https://modelslab.com/api/v1/enterprise/flux_kontext_dev/img2img' \
```

## Body

```json json theme={null}
{
    
    "key": "enterprise_api_key",
    "prompt": "The girl from image one holding the can from image two.",
    "negative_prompt": "bad quality",
    "init_image": "https://assets.modelslab.ai/generations/4a89e381-cdd0-46fc-b13e-00d8824d8171",
    "init_image_2":"https://assets.modelslab.ai/generations/85b9944d-74c5-46b2-9be5-ec7a5e212789",
    "width": "512",
    "height": "512",
    "samples": "1",
    "temp": false,
    "safety_checker": false,
    "strength":0.7,
    "seed": null,
    "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="Text prompt">
  Text prompt with description of the things you want in the image to be generated.
</ParamField>

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

<ParamField query="init_image" type="string" placeholder="Image URL">
  Upload the reference image you want to edit.
</ParamField>

<ParamField query="init_image_2" type="string" placeholder="Image URL">
  Second image is optional. only upload second image when you want to merge 2 image.
</ParamField>

<ParamField query="width" type="number" placeholder="Width in px">
  Max Width: 1024px
</ParamField>

<ParamField query="height" type="number" placeholder="Height in px">
  Max Height: 1024px
</ParamField>

<ParamField query="samples" type="number" placeholder="1-4">
  Number of images to be returned in response. The maximum value is 4.
</ParamField>

<ParamField query="safety_checker" type="boolean">
  A checker for NSFW images. If such an image is detected, it will be replaced by a blank image.
</ParamField>

<ParamField query="base64" type="boolean" default="false">
  Get response as base64 string, <strong>default</strong>: <code>false</code>, <strong>options</strong>: <code>true</code> or <code>false</code>.
</ParamField>

<ParamField query="strength" type="number" placeholder="0.0-1.0">
  Prompt strength when using <strong>init</strong> image. 1.0 corresponds to full destruction of information in the init image.
</ParamField>

<ParamField query="instant_response" type="boolean" default="false">
  Queue response instantly before processing finishes instead of waiting a minimum amount of time <strong>default</strong>: <code>false</code>, <strong>options</strong>: <code>true</code> or <code>false</code>.
</ParamField>

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

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

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