# Text to Image

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

## Text to Image API

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

**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`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| 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. </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. </p>                                                                                                                                                                                                                                                                                                                                                            |
| num\_inference\_steps | int    | <p>-> The <code>num\_inference\_steps</code> parameter represents the number of denoising iterations to perform during the image generation process. Generally, more iterations can result in higher-quality images, but they also increase the time required for generation.</p><p>-> The valid range for the <code>num\_inference\_steps</code> parameter is between 1 and 50.</p>                                                                                                                                                |
| 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>                                                                                                                                                                                                                                                                                                                                                         |
| 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.                                                                                                                                                                                                                                                                                                                                                                      |
| 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 value is:</p><ul><li><code>a10g</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> |

**APP ids for different Text 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-n2p3fg3gsvbgnYeEEdef</td><td>Image Gen 4</td><td><p>The 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-nOpQr7stuvwxYzABcdef</td><td>SD 3.5 medium</td><td><p>For SD 3.5 Medium,the 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-mNopQ8rstuvwXYZabcde</td><td>SD 3.5</td><td><p>The API supports the following combinations of <code>height</code> and <code>width</code> parameters for SD3.5:</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-rStUv6xyzabcdPQRSefg</td><td>SD 3.5 Turbo</td><td><p>The 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-jKlMn5opqzabcXyZtUVw</td><td>Recraft V3</td><td><p>The 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-jXyZa9bcdefghijklmnopq</td><td>Flux Schnell</td><td><p>The 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-fGhKl3mfkdlpqrtsUVWcba</td><td>Flux Dev</td><td><p>For Flux Dev , the API supports the following <code>height</code> and <code>width</code> parameters:</p><ul><li>1056x1440</li><li>1024x1024</li><li>1440x1056</li></ul><p>When providing the <code>height</code> and <code>width</code> values, please ensure that the <code>height</code> and <code>width</code> matches one of the supported combinations in the list above.</p><p></p></td></tr><tr><td>ap-fGhKl3mfkdlpqrsTuvwxYz</td><td>Flux Pro</td><td><p>For Flux Pro, the API supports the following <code>height</code> and <code>width</code> parameters:</p><ul><li>1056x1440</li><li>1024x1024</li><li>1440x1056</li></ul><p>When providing the <code>height</code> and <code>width</code> values, please ensure that the <code>height</code> and <code>width</code> matches one of the supported combinations in the list above.</p></td></tr><tr><td>ap-sdSyd0idsndjnsnsndjsds</td><td>Dalle 3</td><td><p>The API supports the following <code>height</code> and <code>width</code> parameter combinations for DALL-E 3:</p><ul><li>1792x1024</li><li>1024x1024</li><li>1024x1792</li></ul><p>Please ensure that the <code>height</code> and <code>width</code> values you provide match one of these supported combinations.</p></td></tr><tr><td>ap-x7q8hj9kltmNoPqRzabc</td><td>Leonardo</td><td>The height and width parameters must be multiples of 8 pixels.</td></tr><tr><td>ap-hJkLm4nqzxybwvUTSRdca</td><td>Ideogram</td><td>For Ideogram, the API supports the following aspect ratios for the height and width parameters: 16:9 1:1 2:3 3:2 4:3 3:4 9:16 1:3 and 3:1. <br>When providing the height and width values, please ensure that the resulting aspect ratio matches one of the supported ratios in the list above.</td></tr><tr><td>ap-zuzhawbgipcrnxdtefhjbnvhc</td><td>GPT Image</td><td><p></p><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>1536x1792</strong><br>Please ensure that the height and width values you provide match one of these supported combinations.</li></ul></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/text-to-image>" %}
