# Image to Image

For more detailed information on the available image-to-image models, please refer to [image-to-image](https://docs.qolaba.ai/image-to-image "mention") section.

## Image to Image API

<mark style="color:green;">`POST`</mark> `/getImagetoImage`

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

| Name             | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ---------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| app\_id          | string | -> Each model is uniquely characterized by its own `app_id`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| image            | string | <p>-> The <code>image</code> parameter specifies the URL of an existing image that will be used as a reference for the generation process. </p><p>-> If the original image dimensions exceed 1536x1536 pixels, the image will be adjusted to fit within this size while preserving the original aspect ratio.</p>                                                                                                                                                                                                                                                                         |
| prompt           | string | -> The `prompt` parameter is the textual input that guides the image generation process. This prompt serves as an artistic compass, shaping the visual output.                                                                                                                                                                                                                                                                                                                                                                                                                            |
| file\_urls       | string | List of additional image URLs that can be used as context, support files, or references in the generation process.                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| guidance\_scale  | float  | <p>-> The <code>guidance\_scale</code> parameter determines how closely the generated image adheres to the provided prompt. Higher values result in the model following the prompt more closely, while lower values allow for more creative deviation.</p><p>-> The valid range for the <code>guidance\_scale</code> parameter is between 1 and 30.</p>                                                                                                                                                                                                                                   |
| batch            | int    | <p>-> The <code>batch</code> parameter allows you to specify the number of images to generate at once. </p><p>-> The valid range for this parameter is between 1 and 8.</p>                                                                                                                                                                                                                                                                                                                                                                                                               |
| strength         | float  | <p>-> The <code>strength</code> parameter specifies the degree of transformation applied to the reference image. </p><p>-> A higher <code>strength</code> value (up to 1) results in the generated image deviating more from the initial reference image, as more noise is introduced. A <code>strength</code> of 1 completely disregards the initial image.</p>                                                                                                                                                                                                                          |
| height           | int    | <p>-> The <code>height</code> parameter represents the vertical dimension of an image. </p><p>-> The valid range for the parameter is between 256 and 1536 pixels. <br>-> This parameter is only applicable for the SDXL API, as it requires specific <code>height</code> and <code>width</code> values.</p>                                                                                                                                                                                                                                                                              |
| width            | int    | <p>-> The <code>width</code> parameter represents the horizontal dimension of an image. </p><p>-> The valid range for the parameter is between 256 and 1536 pixels. <br>-> This parameter is only applicable for the SDXL API, as it requires specific <code>height</code> and <code>width</code> values.</p>                                                                                                                                                                                                                                                                             |
| negative\_prompt | string | -> The `negative_prompt` parameter allows you to specify content that you want the image generation model to avoid or minimize in the output. This can be useful for excluding certain visual elements or styles that you do not want to be present in the generated image.                                                                                                                                                                                                                                                                                                               |
| celery           | bool   | -> The `celery` parameter is used for queuing tasks that require extended processing time. When you enqueue a task, you receive a unique `task_id`. This `task_id` allows you to check the task's status later using the task status API, which is useful for managing and tracking long-running tasks.                                                                                                                                                                                                                                                                                   |
| inference\_type  | string | <p>-> The <code>inference\_type</code> parameter allows you to specify the GPU to be used for the image generation task. The supported values are:</p><ul><li><code>a10g</code></li><li><code>a100</code></li><li><code>h100</code></li></ul><p>This parameter is only applicable for Qolaba-deployed models, including Turbo Vision, Qolaba Style, Cartoon, Realistic, and Anime Style.</p><p>The different GPU options provide varying levels of performance and capabilities, allowing you to choose the most suitable GPU based on your requirements and the demand for the task.</p> |

To upload multiple images, consider using `file_urls`, ensuring that `celery` is set to `true.`

When uploading multiple images, a `task_iD` will be returned. You can use this `task_iD` with the Task Status endpoint to retrieve the current status or result of the uploaded process.

**APP ids for different Image to Image styles**

<table><thead><tr><th width="312">App ID</th><th width="174">Model Name</th><th>Height and Width Constraints </th></tr></thead><tbody><tr><td>ap-fGhKl3mfkdlpqrshuwwabc</td><td>Flux Dev</td><td>The API automatically takes the dimension of input image.</td></tr><tr><td>ap-hTjXy7qplkzvnmwqrsdabc</td><td>Ideogram Remix</td><td><p>The Ideogram Remix API supports the following combinations of <code>height</code> and <code>width</code> parameters:</p><ul><li>720x1280</li><li>960x1280</li><li>1024x1024</li><li>1280x960</li><li>1280x720</li></ul><p>Please ensure that the values you provide for <code>height</code> and <code>width</code> match one of these supported combinations.</p></td></tr><tr><td>ap-gFhLq9zvbnmopxkytswabc</td><td>Flux Redux</td><td><p>The Flux Redux API supports the following combinations of <code>height</code> and <code>width</code> parameters:</p><ul><li>720x1280</li><li>800x1000</li><li>1024x1024</li><li>1280x720</li><li>1600x676</li></ul><p>Please ensure that the values you provide for <code>height</code> and <code>width</code> match one of these supported combinations.</p></td></tr><tr><td>ap-mNqZx4rtyjvbcfghwklpde</td><td>Flux Canny</td><td>The API automatically takes the dimension of input image.</td></tr><tr><td>ap-gWfZx8rjvtyqopmnbcdehij</td><td>Flux Depth</td><td>The API automatically takes the dimension of input image.</td></tr><tr><td>ap-hJkLm8nqwertyuiopasdfg</td><td>Flux PulID</td><td><p>The Flux PulID API supports the following combinations of <code>height</code> and <code>width</code> parameters:</p><ul><li>1024x1024</li><li>800x1000</li><li>720x1280</li><li>1280x720</li><li>1600x676</li></ul><p>Please ensure that the values you provide for <code>height</code> and <code>width</code> match one of these supported combinations.</p></td></tr><tr><td>ap-zuzhawbgipcrnxdtefhjbnvhc</td><td>GPT Image</td><td><p>The API supports the following height and width parameter combinations for GPT Image:</p><ul><li><strong>1024x1536</strong></li><li><strong>1024x1024</strong></li><li><strong>1536x1024</strong><br>Please ensure that the height and width values you provide match one of these supported combinations.</li></ul></td></tr><tr><td>ap-tK7gR4jP9sWbC1mNfE8uVzH2</td><td>Flux Kontext Max</td><td><p>The Flux Kontext Max API supports the following combinations of <code>height</code> and <code>width</code> parameters:</p><ul><li>630x1470</li><li>900x1200</li><li>1024x1024</li><li>1280x720</li><li>1470x630</li></ul><p>Please ensure that the values you provide for <code>height</code> and <code>width</code> match one of these supported combinations.</p></td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "time_required": "",
  "error": "",
  "error_data": "",
  "input": "",
  "output": "",
  "app_id": "",
  "task_id": "",
  "status": ""
}
```

{% endtab %}

{% tab title="500" %}

```json
{
  "time_required": "",
  "error": "",
  "error_data": "",
  "input": "",
  "output": "",
  "app_id": "",
  "task_id": "",
  "status": ""
}
```

{% endtab %}
{% endtabs %}

## Run the API

To test this API, please use the following link:

{% embed url="<https://app.theneo.io/api-runner/qolaba/ml-apis/api-reference/image-to-image>" %}
