# Welcome!

Deep-image.ai API documentation

## Overview

Welcome to Deep-image.ai API documentation!&#x20;

Deep-image.ai is a powerful AI-based image editing app. It allows you to enhance and upscale images. It contains an advanced background removal tool, sharpen, noise reduction, and automatically adjusting color features. Here you'll find all the documentation you need to get up and running with the API integration.&#x20;

In this docs guide for developers, you will find a comprehensive description of all the API features and image-processing operations with some examples.

<figure><img src="/files/XsDC4XDCo2y7fBIAbl8p" alt=""><figcaption></figcaption></figure>


# Quick Start

Rapid integration and API access.

We've developed a seamless transition process for the deployment of the product that will allow you to onboard without stress or delay. Our internal team will work with you to establish a specific timeline for complete deployment and will support you throughout the process.

## Get your API keys

Your API requests are authenticated using API key. Any request that doesn't include an API key will return an error.

You need to replace API\_KEY variable with your real API KEY from <https://deep-image.ai/app/my-profile/api>

You can get your API key in your profile after creating an account in [Deep-image.ai](https://deep-image.ai/).

## Python library

We also provide python library which simplifies usage of the deep-image.ai API. You can get it here: &#x20;

<https://github.com/deep-image-ai/python-client>

## Make your first request

The API comes in two flavours: form-data and json.

{% hint style="info" %}
When sending the image in json request, image can be put into url field and has to be base64 encoded.
{% endhint %}

Let's see example for denoising, deblurring, enhancing lighting and upscaling to width equals 2000px.

{% tabs %}
{% tab title="curl json" %}

```bash
curl --request POST \
     --url https://deep-image.ai/rest_api/process_result \
     --header 'content-type: application/json' \
     --header 'x-api-key: API_KEY' \
     --data '{
         "url": "https://deep-image.ai/api-example.png",
         "enhancements": ["denoise", "deblur", "light"],
         "width": 2000
      }'

curl --request POST
    --url https://deep-image.ai/rest_api/process_result \
    --header 'content-type: application/json' \
    --header 'x-api-key: API_KEY' \
    --data '{
        "url": "base64,UklGRl4UAABXRUJQVlA4WAoAAAAsAAAAPwAAPwAASUNDUKACAAAAAAKgbGNtcwRAAABtbnRyUkdCIFhZWiAH6AADAAwADgAdADVhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1kZXNjAAABIAAAAEBjcHJ0AAABYAAAADZ3dHB0AAABmAAAABRjaGFkAAABrAAAACxyWFlaAAAB2AAAABRiWFlaAAAB7AAAABRnWFlaAAACAAAAABRyVFJDAAACFAAAACBnVFJDAAACFAAAACBiVFJDAAACFAAAACBjaHJtAAACNAAAACRkbW5kAAACWAAAACRkbWRkAAACfAAAACRtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACQAAAAcAEcASQBNAFAAIABiAHUAaQBsAHQALQBpAG4AIABzAFIARwBCbWx1YwAAAAAAAAABAAAADGVuVVMAAAAaAAAAHABQAHUAYgBsAGkAYwAgAEQAbwBtAGEAaQBuAABYWVogAAAAAAAA9tYAAQAAAADTLXNmMzIAAAAAAAEMQgAABd7///MlAAAHkwAA/ZD///uh///9ogAAA9wAAMBuWFlaIAAAAAAAAG+gAAA49QAAA5BYWVogAAAAAAAAJJ8AAA+EAAC2xFhZWiAAAAAAAABilwAAt4cAABjZcGFyYQAAAAAAAwAAAAJmZgAA8qcAAA1ZAAAT0AAACltjaHJtAAAAAAADAAAAAKPXAABUfAAATM0AAJmaAAAmZwAAD1xtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAEcASQBNAFBtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJWUDggyAMAAFARAJ0BKkAAQAA+aSiSRaQioZYNVsxABoSzAE6c4GmvGnNPyRb6vDRpdvdztfQ5dVdz7ntE2esgv+jTDiaX5IwB1thDDuxe9KBtbIBuxX1KJUk2XKs3Doc520JoxFG5VpDR/o1yke00Q75hGRK5gDrw+LB4eE7P09GvCSASNw8N8HIiilpEXJODVJDg3RutLbhTwAD+/mcz8QDFeHXYwy3iTGkgOqmWK+xZPjjshTMEichq6gTQOYkYbACXRC+I9zR1MfTtuwVb/Y/AmyN7JVxkG8J8IgB12zRtuF/WGgH3PuZhjIBlPgEUJAKO2W4z/uf0UgO+Pp2E/3FCBWG9P7nyMC7v0G6pLImw1RHOVDhln2Z2PiLl3/mxSgPzUUsknd9GMO9MC2n2v4rPeKci3lBm/d0pK04KmUB7HI5wmGHtUcY00Ya7lqMWIyycoXQWWL6PKzaEULdH35icsmqIbxMtTvTpg5aHQBfAyzJfZlrU6FcA5B9pUHMQ7J9xWuDwBK8WnApKK4HopkO5GHdt0zCEsgwIPAODUglxnZWRnAaqJzmdVeBU2nJq6vpPBAOSW88CkBFsxYmdUfXVyjD6nKEitPjuEy2sMv6YIzkJHn7t1222bPoB1NSeeirHYLZ7zvBjklv9rGa4p+pkaVUt3jwOAzZ+5Pa9Q9E5nJKRkiX5n+nfDOGu5qdzjFglcG/PshuvtVjjmIpKSBQbRsJYmFd5Kc7orOfOcQbxDz+yv2LRiWj/ZhiapeIAW3XJ4LWGiK1Os9Nq35ZYpw7L51lvN55mlbejBtIIx7PaHXwAIceq+k92IYdLsu15ir4Tj1ot2oL6vO1ykut5tXFxll+4/q65MYfF1iCIN2or92LZKO2UfeDs1oNCKkue2wMvaLgnl/GH8MzI8jVX7n2MUyqPZdnMjB4rdvNKSz/qlN6a5neQ7kq/m65SFSWpG9Jwj6sP8/vzadZG5KHiRm4dMSOVqqO+OBP6VbLiBqXvvAtGDA6prwKFOHVBCHZOuZlQbe6frR6eBQ7Ugl4r/f9ggT7dqs3S/ichiIlvOysK6reZ+Fq6tcKNeG/tsqCTxOaLvNEVH9ye/E3T1x6/zuAt+nNATuRaUrg2gQc+gONxUuWcGy7Ne3y6zRIW3dXC5BuAWEVBHSNKYTSLUmlJppF8glTHwTQcX1F1yFg8SkBbRH1tTtzShCFvzxoYc98UiL2zPO+hZLwu3L5IgHo+wE1mMt6XS1aJbzXEMhBzGK+SYyw0xny45X0Bnl06k2JFvkJ67GztdQiyiF0BkcAARVhJRtAAAABJSSoACAAAAAoAAAEEAAEAAABAAAAAAQEEAAEAAABAAAAAAgEDAAMAAACGAAAAEgEDAAEAAAABAAAAGgEFAAEAAACMAAAAGwEFAAEAAACUAAAAKAEDAAEAAAACAAAAMQECAA0AAACcAAAAMgECABQAAACqAAAAaYcEAAEAAAC+AAAAAAAAAAgACAAIACwBAAABAAAALAEAAAEAAABHSU1QIDIuMTAuMzQAADIwMjQ6MDM6MTMgMTQ6MTY6MjMAAQABoAMAAQAAAAEAAAAAAAAAWE1QIPAMAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA0LjQuMC1FeGl2MiI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOkdJTVA9Imh0dHA6Ly93d3cuZ2ltcC5vcmcveG1wLyIgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1wTU06RG9jdW1lbnRJRD0iZ2ltcDpkb2NpZDpnaW1wOjdiYzdlY2IwLWMyODUtNDcxZS04NDVkLTA4NmI2MWU4MjEzNCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDphMTkxNGYwNC1mZjg1LTQ4ZmMtOTkwYy02MTVlYzNhNjc1M2YiIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo4NGI1NjQ1Mi0wMTgwLTRjNDctOWMxYy04OWYyYjlkNDIyMDIiIGRjOkZvcm1hdD0iaW1hZ2Uvd2VicCIgR0lNUDpBUEk9IjIuMCIgR0lNUDpQbGF0Zm9ybT0iTGludXgiIEdJTVA6VGltZVN0YW1wPSIxNzEwMzM1NzkxODEwNDkyIiBHSU1QOlZlcnNpb249IjIuMTAuMzQiIHRpZmY6T3JpZW50YXRpb249IjEiIHhtcDpDcmVhdG9yVG9vbD0iR0lNUCAyLjEwIiB4bXA6TWV0YWRhdGFEYXRlPSIyMDI0OjAzOjEzVDE0OjE2OjIzKzAxOjAwIiB4bXA6TW9kaWZ5RGF0ZT0iMjAyNDowMzoxM1QxNDoxNjoyMyswMTowMCI+IDx4bXBNTTpIaXN0b3J5PiA8cmRmOlNlcT4gPHJkZjpsaSBzdEV2dDphY3Rpb249InNhdmVkIiBzdEV2dDpjaGFuZ2VkPSIvIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjY2MTk5YzNhLWM1YTItNGI1ZS04NGMyLTQ4NGU4NDI1NTk3YSIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iR2ltcCAyLjEwIChMaW51eCkiIHN0RXZ0OndoZW49IjIwMjQtMDMtMTNUMTQ6MTY6MzErMDE6MDAiLz4gPC9yZGY6U2VxPiA8L3htcE1NOkhpc3Rvcnk+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDw/eHBhY2tldCBlbmQ9InciPz4=",
        "enhancements": ["denoise", "deblur", "light"],
        "width": 2000
    }'
```

{% endtab %}

{% tab title="curl form-data" %}

```bash
curl --location \
     --request POST \
     --url https://deep-image.ai/rest_api/process_result \
     --header 'x-api-key: API_KEY' \
     --form 'file=@"LOCAL_FILE_PATH"' \
     --form parameters="{\"width\": 1000}"
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const fs = require('fs');
const path = require('path');
const axios = require('axios');
const https = require('https');
const http = require('http');

const API_KEY = 'REPLACE_WITH_YOUR_API_KEY';
const YOUR_LOCAL_FILE_TO_SEND = 'YOUR_LOCAL_FILE_TO_SEND'; // Replace with your file path

const headers = {
  'x-api-key': API_KEY,
};

const requestData = {
  enhancements: ['denoise', 'deblur', 'light'],
  url: 'https://deep-image.ai/api-example.png', // Replace with your image URL if different
  width: 2000,
};

const dataDumped = { parameters: JSON.stringify(requestData) };

const downloadFile = (url, outputPath) => {
  const file = fs.createWriteStream(outputPath);
  const protocol = url.startsWith('https') ? https : http;

  protocol.get(url, (response) => {
    response.pipe(file);
    file.on('finish', () => {
      file.close();
    });
  });
};

const processImage = async () => {
  try {
    const response = await axios.post('https://deep-image.ai/rest_api/process_result', dataDumped, {
      headers,
    });

    if (response.status === 200 && response.data.status === 'complete') {
      const resultUrl = response.data.result_url;
      const fileName = path.basename(resultUrl);
      downloadFile(resultUrl, fileName);
    } else if (['received', 'in_progress', 'not_started'].includes(response.data.status)) {
      let jobResponse = response.data;
      while (['received', 'in_progress', 'not_started'].includes(jobResponse.status)) {
        const jobStatusResponse = await axios.get(
          `https://deep-image.ai/rest_api/result/${jobResponse.job}`,
          { headers }
        );
        jobResponse = jobStatusResponse.data;
        if (['received', 'in_progress', 'not_started'].includes(jobResponse.status)) {
          await new Promise((resolve) => setTimeout(resolve, 1000)); // Wait for 1 second
        }
      }

      if (jobResponse.status === 'complete') {
        const resultUrl = jobResponse.result_url;
        const fileName = path.basename(resultUrl);
        downloadFile(resultUrl, fileName);
      }
    }
  } catch (error) {
    console.error('Error:', error);
  }
};

processImage();

```

{% endtab %}

{% tab title="Python" %}

```python
import time
import json
from pathlib import Path

from urllib.request import urlretrieve

# using requests library
import requests

API_KEY = REPLACE_WITH_YOUR_API_KEY

headers = {
    'x-api-key': API_KEY,
}

data = {
    "enhancements": ["denoise", "deblur", "light"],
    "width": 2000
}

data_dumped = {"parameters": json.dumps(data)}

with open(YOUR_LOCAL_FILE_TO_SEND, 'rb') as f:
    response = requests.post('https://deep-image.ai/rest_api/process_result', headers=headers,
                             files={'image': f},
                             data=data_dumped)
    if response.status_code == 200:
        response_json = response.json()
        if response_json.get('status') == 'complete':
            p = Path(response_json['result_url'])
            urlretrieve(response_json['result_url'], p.name)
        elif response_json['status'] in ['received', 'in_progress', 'not_started']:
            while response_json['status'] in ['received', 'in_progress', 'not_started']:
                response = requests.get(f'https://deep-image.ai/rest_api/result/{response_json["job"]}',
                                        headers=headers)
                response_json = response.json()
                time.sleep(1)
            if response_json['status'] == 'complete':
                p = Path(response_json['result_url'])
                urlretrieve(response_json['result_url'], p.name)

```

{% endtab %}

{% tab title="Python client" %}
{% code overflow="wrap" %}

```bash
import os

import deep_image_ai_client

configuration = deep_image_ai_client.Configuration(
    host="https://deep-image.ai"
)

configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

with deep_image_ai_client.ApiClient(configuration) as api_client:
    api_instance = deep_image_ai_client.DefaultApi(api_client)
    process_payload = {
        "url": "https://deep-image.ai/api-example.png",
        "enhancements": ["denoise", "deblur", "light"],
        "width": 2000
    }
    api_response = api_instance.rest_api_process_result_post(process_payload)

```

{% endcode %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
All data examples in this documentation are JSON based. You can replace above JSON data with that ones from the examples.
{% endhint %}


# API methods

The API address is [https://deep-image.ai/rest\_api/](https://deep-image.ai/rest_api/v2/)

There are two methods for the scheduling image processing and one for retrieving the results. With "[process\_result](#post-rest_api-process_result)" method, image can be processed and if the result is available during 25 seconds, the url to the result will be returned. The second method - "[process](#post-rest_api-process)" - always schedules a processing job and the user has to wait for the result with "[result](#get-rest_api-result-hash)" method.

Processing methods supports both form-data and json content types.

{% openapi src="/files/3OFpeujvbewtPkDrg1oZ" path="/rest\_api/process\_result" method="post" %}
[swagger3.yml](https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2F9qIlTUgwt8yeGrDr3N5w%2Fswagger3.yml?alt=media\&token=09f1c54e-f0e6-4337-98e1-0fa9658a8a4a)
{% endopenapi %}

{% openapi src="/files/RCWevyg9B6ovtEB9NnBM" path="/rest\_api/process" method="post" %}
[swagger3.yml](https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2FQpwfcjdv3nmIvkENVmKH%2Fswagger3.yml?alt=media\&token=f0df3744-c5c6-46cc-ba15-ca08bfb97b71)
{% endopenapi %}

{% openapi src="/files/NNnrOenUh63lGfS6fD9k" path="/rest\_api/me" method="get" %}
[swagger.yml](https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2F24UMPSGF40X9pRnpAWNl%2Fswagger.yml?alt=media\&token=b2dfe09d-cac2-464b-8951-e78b2e43847e)
{% endopenapi %}

{% openapi src="/files/8BT5nrgpCHb2E6yWWUKD" path="/rest\_api/result/{hash}" method="get" %}
[swagger.yml](https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2FqYtZbzmlcCEbAoCqFOPJ%2Fswagger.yml?alt=media\&token=d397d18e-9be4-479d-b272-0c68531924bd)
{% endopenapi %}

{% openapi src="/files/CG8VboqFNlhUQYC2Teo1" path="/rest\_api/result/{hash}" method="delete" %}
[swagger.yml](https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2Fvj1xx256lm0WaAouIKLR%2Fswagger.yml?alt=media\&token=6c6e81c7-ff63-45ad-bc00-398e42f259d2)
{% endopenapi %}

{% hint style="info" %}
When processing is in progress, the result endpoint should be periodically checked for the complete status.
{% endhint %}


# Easy integration

#### **Easy API Integration with Deep Image AI**

Deep Image AI makes it easy to process images through a simple API. Follow these steps to use it correctly and avoid common mistakes.

***

#### **1. Process an Image**

There are two processing methods.

The [process](/api-methods#rest_api-process) method sends an image for processing and immediately returns job id.

The [process\_result](/api-methods#rest_api-process_result) method sends an image and waits **up to 25 seconds** for the result. If the image is processed in time, you get a **direct link** to the final image.

#### Sending an image with process method and periodically checking the result

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

```python
import time
import json
from pathlib import Path

from urllib.request import urlretrieve

# using requests library
import requests

API_KEY = REPLACE_WITH_YOUR_API_KEY

headers = {
    'x-api-key': API_KEY,
}

data = {
    "enhancements": ["denoise", "deblur", "light"],
    "width": 2000
}

data_dumped = {"parameters": json.dumps(data)}

with open(YOUR_LOCAL_FILE_TO_SEND, 'rb') as f:
    response = requests.post('https://deep-image.ai/rest_api/process', headers=headers,
                             files={'image': f},
                             data=data_dumped)
    if response.status_code == 200:
        response_json = response.json()
        job_id = response_json["job"]
        result_status = "received"

        while result_status in ['received', 'in_progress', 'not_started']:
            response = requests.get(f'https://deep-image.ai/rest_api/result/{job_id}',
                                    headers=headers)
            response_json = response.json()
            result_status = response_json['status']
            time.sleep(1)
        if result_status == 'complete':
            p = Path(response_json['result_url'])
            urlretrieve(response_json['result_url'], p.name)

```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$apiKey = 'REPLACE_WITH_YOUR_API_KEY';
$yourLocalFileToSend = 'path/to/your/image.jpg';

$headers = [
    'x-api-key: ' . $apiKey,
];

$data = [
    "enhancements" => ["denoise", "deblur", "light"],
    "width" => 2000
];

$ch = curl_init();

$curlFile = new CURLFile($yourLocalFileToSend);
$postFields = [
    'image' => $curlFile,
    'parameters' => json_encode($data)
];

curl_setopt($ch, CURLOPT_URL, 'https://deep-image.ai/rest_api/process');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);

$response = curl_exec($ch);
curl_close($ch);

$responseJson = json_decode($response, true);
$jobId = $responseJson['job'] ?? null;

if ($jobId) {
    $resultStatus = 'received';
    while (in_array($resultStatus, ['received', 'in_progress', 'not_started'])) {
        sleep(1);
        
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, "https://deep-image.ai/rest_api/result/{$jobId}");
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        
        $resultResponse = curl_exec($ch);
        curl_close($ch);
        
        $resultJson = json_decode($resultResponse, true);
        $resultStatus = $resultJson['status'] ?? '';
    }
    
    if ($resultStatus === 'complete') {
        $resultUrl = $resultJson['result_url'] ?? '';
        if ($resultUrl) {
            $fileName = basename($resultUrl);
            file_put_contents($fileName, file_get_contents($resultUrl));
            echo "File downloaded as {$fileName}\n";
        }
    }
} else {
    echo "Error: No job ID received.\n";
}

```

{% endtab %}

{% tab title="Javascript" %}

```javascript
const fs = require('fs');
const path = require('path');
const fetch = require('node-fetch');
const FormData = require('form-data');
const { promisify } = require('util');
const streamPipeline = promisify(require('stream').pipeline);

const API_KEY = 'REPLACE_WITH_YOUR_API_KEY';
const YOUR_LOCAL_FILE_TO_SEND = 'path/to/your/image.jpg';

const headers = {
    'x-api-key': API_KEY,
};

const data = {
    "enhancements": ["denoise", "deblur", "light"],
    "width": 2000
};

async function processImage() {
    const formData = new FormData();
    formData.append('image', fs.createReadStream(YOUR_LOCAL_FILE_TO_SEND));
    formData.append('parameters', JSON.stringify(data));

    try {
        const response = await fetch('https://deep-image.ai/rest_api/process', {
            method: 'POST',
            headers: headers,
            body: formData
        });

        if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
        const responseJson = await response.json();
        const jobId = responseJson.job;
        let resultStatus = 'received';

        while (["received", "in_progress", "not_started"].includes(resultStatus)) {
            await new Promise(resolve => setTimeout(resolve, 1000));
            const resultResponse = await fetch(`https://deep-image.ai/rest_api/result/${jobId}`, { headers });
            const resultJson = await resultResponse.json();
            resultStatus = resultJson.status;
        }

        if (resultStatus === 'complete') {
            const resultUrl = resultJson.result_url;
            const fileName = path.basename(resultUrl);
            const fileResponse = await fetch(resultUrl);

            if (!fileResponse.ok) throw new Error(`HTTP error while downloading file! status: ${fileResponse.status}`);
            
            const fileStream = fs.createWriteStream(fileName);
            await streamPipeline(fileResponse.body, fileStream);
            console.log(`File downloaded as ${fileName}`);
        }
    } catch (error) {
        console.error('Error:', error);
    }
}

processImage();

```

{% endtab %}
{% endtabs %}

#### Sending an Image with process\_result method and periodically checking the result

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

```python
import time
import json
from pathlib import Path

from urllib.request import urlretrieve

# using requests library
import requests

API_KEY = REPLACE_WITH_YOUR_API_KEY

headers = {
    'x-api-key': API_KEY,
}

data = {
    "enhancements": ["denoise", "deblur", "light"],
    "width": 2000
}

data_dumped = {"parameters": json.dumps(data)}

with open(YOUR_LOCAL_FILE_TO_SEND, 'rb') as f:
    response = requests.post('https://deep-image.ai/rest_api/process_result', headers=headers,
                             files={'image': f},
                             data=data_dumped)
    if response.status_code == 200:
        response_json = response.json()
        if response_json.get('status') == 'complete':
            p = Path(response_json['result_url'])
            urlretrieve(response_json['result_url'], p.name)
        elif response_json['status'] in ['received', 'in_progress', 'not_started']:
            while response_json['status'] in ['received', 'in_progress', 'not_started']:
                response = requests.get(f'https://deep-image.ai/rest_api/result/{response_json["job"]}',
                                        headers=headers)
                response_json = response.json()
                time.sleep(1)
            if response_json['status'] == 'complete':
                p = Path(response_json['result_url'])
                urlretrieve(response_json['result_url'], p.name)

```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$API_KEY = 'REPLACE_WITH_YOUR_API_KEY';
$YOUR_LOCAL_FILE_TO_SEND = 'path/to/your/image.jpg';

$headers = [
    'x-api-key: ' . $API_KEY
];

$data = [
    "enhancements" => ["denoise", "deblur", "light"],
    "width" => 2000
];

function processImage($filePath, $headers, $data) {
    try {
        // Prepare the file upload
        $postData = [
            'image' => new CURLFile($filePath),
            'parameters' => json_encode($data)
        ];

        // Initialize cURL for processing
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, 'https://deep-image.ai/rest_api/process_result');
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        
        $response = curl_exec($ch);
        
        if (curl_errno($ch)) {
            throw new Exception('cURL error: ' . curl_error($ch));
        }
        
        curl_close($ch);
        
        $responseJson = json_decode($response, true);
        
        if (!$responseJson) {
            throw new Exception("Error processing image: " . $response);
        }
        
        if ($responseJson['status'] === 'complete') {
            downloadFile($responseJson['result_url']);
        } else if (in_array($responseJson['status'], ['received', 'in_progress', 'not_started'])) {
            while (in_array($responseJson['status'], ['received', 'in_progress', 'not_started'])) {
                sleep(1);
                $ch = curl_init();
                curl_setopt($ch, CURLOPT_URL, "https://deep-image.ai/rest_api/result/{$responseJson['job']}");
                curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                
                $response = curl_exec($ch);
                $responseJson = json_decode($response, true);
                curl_close($ch);
            }
            
            if ($responseJson['status'] === 'complete') {
                downloadFile($responseJson['result_url']);
            }
        }
        
    } catch (Exception $e) {
        echo "Error: " . $e->getMessage() . "\n";
    }
}

function downloadFile($url) {
    try {
        $fileName = basename($url);
        $fileContent = file_get_contents($url);
        
        if ($fileContent === false) {
            throw new Exception("Failed to download file from: " . $url);
        }
        
        file_put_contents($fileName, $fileContent);
        echo "File downloaded as " . $fileName . "\n";
        
    } catch (Exception $e) {
        echo "Error downloading file: " . $e->getMessage() . "\n";
    }
}

// Execute the function
processImage($YOUR_LOCAL_FILE_TO_SEND, $headers, $data);

?>
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
const fs = require('fs');
const path = require('path');
const fetch = require('node-fetch');
const FormData = require('form-data');

const API_KEY = 'REPLACE_WITH_YOUR_API_KEY';
const YOUR_LOCAL_FILE_TO_SEND = 'path/to/your/image.jpg';

const headers = {
    'x-api-key': API_KEY,
};

const data = {
    "enhancements": ["denoise", "deblur", "light"],
    "width": 2000
};

async function processImage() {
    const formData = new FormData();
    formData.append('image', fs.createReadStream(YOUR_LOCAL_FILE_TO_SEND));
    formData.append('parameters', JSON.stringify(data));

    let response = await fetch('https://deep-image.ai/rest_api/process_result', {
        method: 'POST',
        headers: headers,
        body: formData
    });
    
    if (!response.ok) {
        console.error("Error processing image", await response.text());
        return;
    }
    
    let responseJson = await response.json();
    
    if (responseJson.status === 'complete') {
        await downloadFile(responseJson.result_url);
    } else if (["received", "in_progress", "not_started"].includes(responseJson.status)) {
        while (["received", "in_progress", "not_started"].includes(responseJson.status)) {
            await new Promise(resolve => setTimeout(resolve, 1000));
            response = await fetch(`https://deep-image.ai/rest_api/result/${responseJson.job}`, { headers: headers });
            responseJson = await response.json();
        }
        if (responseJson.status === 'complete') {
            await downloadFile(responseJson.result_url);
        }
    }
}

async function downloadFile(url) {
    const fileName = path.basename(url);
    const response = await fetch(url);
    const buffer = await response.buffer();
    fs.writeFileSync(fileName, buffer);
    console.log(`File downloaded as ${fileName}`);
}

processImage().catch(console.error);
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**If you don’t get a result URL, don’t send the image again!** Use the job ID to check the status instead.
{% endhint %}

***

#### **2. Get results faster with webhooks (Recommended)**

Instead of checking the status manually, you can **set up a webhook**. This means Deep Image AI will **send you the result automatically** when the image is ready.

{% hint style="info" %}
**Why use webhooks?**

* No need to keep checking the status.
* The result is sent **automatically** when ready.
  {% endhint %}

#### Example: Send a Request with a Webhook

```python
payload = {
    "webhook_url": "https://your-server.com:5000/deep-image-webhook",
    "enhancements": ["denoise", "deblur", "light"],
    "width": 2000
}

data_dumped = {"parameters": json.dumps(payload)}

with open("YOUR_LOCAL_FILE_TO_SEND", "rb") as f:
    response = requests.post("https://deep-image.ai/rest_api/process", headers=headers,
                             files={"image": f}, data=data_dumped)

print(response.json())  # Shows job ID
```

#### Example: Receiving the Webhook (Flask)

```python
from flask import Flask, request, jsonify

app = Flask(__name__)

@app.route("/deep-image-webhook", methods=["POST"])
def webhook():
    data = request.json
    print("Image is ready:", data["result_url"])
    return jsonify({"status": "received"}), 200

app.run(port=5000)
```

***

#### **3. Automate Workflows with Zapier Integration**

**Zapier** enables you to connect Deep Image AI with thousands of other applications, automating tasks seamlessly. For example, you can set up a workflow where images uploaded to a specific folder in Google Drive are automatically enhanced using Deep Image AI.

**✅ Example: Automating Image Enhancement with Zapier**

1. **Trigger**: When a new image is added to a designated Google Drive folder.
2. **Action**: Use Deep Image AI to enhance the image automatically.

This setup ensures that every image added to your folder is processed without manual intervention.

**Resources**:

* **Deep Image AI Zapier Integrations**: Explore various integration possibilities - <https://zapier.com/apps/deep-image/integrations>
* **Integration Guide**: Step-by-step instructions on creating your first Zap with Deep Image AI - [https://deep-image.ai/blog/deep-image-now-fully-integrated-with-zapier-quick-guide-for-your-first-zap](https://deep-image.ai/blog/deep-image-now-fully-integrated-with-zapier-quick-guide-for-your-first-zap/?utm_source=chatgpt.com)

***

#### **4. Enhance Automation with Make (Integromat) Integration**

**Make** allows you to build and automate complex workflows by connecting Deep Image AI with numerous other apps. For instance, you can create a scenario where images from a Telegram Bot are automatically processed and stored in Dropbox.

**✅ Example: Processing Images via Make**

1. **Trigger**: Receive a new image through a Telegram Bot.
2. **Action**: Process the image using Deep Image AI's enhancement features.
3. **Action**: Save the enhanced image to a Dropbox folder.

This workflow automates the entire process from image reception to storage.

**Resources**:

* **Deep Image AI Make Integrations**: Discover integration options and modules available - [https://www.make.com/en/integrations/deep-image-ai](https://www.make.com/en/integrations/deep-image-ai?utm_source=chatgpt.com)
* **Integration Guide**: Learn how to integrate photo enhancements with other tools using Make - [https://deep-image.ai/blog/how-to-use-make-com-to-integrate-photo-enhancements-with-other-tools](https://deep-image.ai/blog/how-to-use-make-com-to-integrate-photo-enhancements-with-other-tools/?utm_source=chatgpt.com)

***

**Summary: Leveraging Automation Platforms**

* **Zapier Integration**: Automate tasks by connecting Deep Image AI with various apps, enabling workflows like automatic image enhancement upon upload.
* **Make Integration**: Design intricate scenarios that process images through Deep Image AI and interact with multiple applications, enhancing efficiency.

By integrating Deep Image AI with these platforms, you can significantly streamline your image processing tasks and improve productivity.


# Easily Copy Pre-Formatted API Requests for Integration

In the Deep-Image.ai web application, users can easily display an API request by utilizing the "Copy API Request" button found within the Advanced Options of the AI Enhancer Pro feature.

<figure><img src="/files/FBiuFdRpWEL5XnVLrjur" alt=""><figcaption></figcaption></figure>

This functionality allows users to quickly generate and copy a pre-formatted API request, enabling seamless integration with their own systems or tools. By providing this convenience, Deep-Image.ai ensures that technical users have a straightforward means of accessing and implementing API interactions without needing to construct the request manually.


# Handling Large File Sets

Large number of images can be processed with cloud target

## Enterprise API

The enterprise version of our REST API effectively manages the reliable and stable processing of large volumes of data. Designed for high-throughput scenarios, it ensures consistent and dependable performance, making it ideal for handling extensive datasets and numerous files.

If you're interested in our enterprise API, contact us at <https://deep-image.ai/outsourcing> for more information or to discuss your specific needs.

## Cloud providers

Deep image supports various cloud providers: Google Drive, Dropbox, OneDrive and S3. Using API images can be fetch from one storage and put into another one.

First you need to configure your storages at <https://deep-image.ai/app/my-profile/storages>

<figure><img src="/files/gbqv2dYpADlKkynoG6Nc" alt=""><figcaption><p>Example of my storages page</p></figcaption></figure>

In above example user has Dropbox storage named "dropbox-storage". Using that name images can be fetched or uploaded.

```json
{
    "url": "storage://dropbox-storage/source_folder/image.png",
    "width": 1000,
    "target": "storage://dropbox-storage/destination_folder"
}
```

## Multiple processing

Methods [API methods](/api-methods#process_result) and [API methods](/api-methods#process) can process one or more images.

It is possible to send more than one image with "urls" parameter.

```json
{
    "urls": [
        "https://deep-image.ai/api-example.png",
        "https://deep-image.ai/api-example2.jpg"
    ],
    "width": 1000
}
```

&#x20;

The result of the above request that was send with [API methods](/api-methods#process_result):

```json
{
    "status": "complete",
    "job": "daed6c88-c25e-11ed-b500-92631771ed1d",
    "results": [
        {
            "job": "dbaa2aa8-c25e-11ed-bbfe-668140caf6e4",
            "status": "complete",
            "url": "https://deep-image.ai/images/2023-03-14/7c278066-48c0-4ce0-bcd8-75549ad6c6f4.png",
            "original_url": "https://deep-image.ai/api-example.png"
        },
        {
            "job": "dce9ddf0-c25e-11ed-bbfe-668140caf6e4",
            "status": "complete",
            "url": "https://deep-image.ai/images/2023-03-14/b838297f-4775-4fe8-abeb-8ddb2553c7eb.jpg",
            "original_url": "https://deep-image.ai/api-example2.jpg"
        }
    ]
}
```


# Supported formats

In addition to standard formats, Deep Image API supports RAW formats like NEF or CR2

* BLP
* BMP
* DDS
* DIB
* EPS
* GIF
* ICNS
* ICO
* IM
* JPEG
* JPEG 2000
* MSP
* PCX
* PNG
* PPM&#x20;
* SGI
* SPIDER
* TGA
* TIFF
* XBM
* CUR
* DCX
* FITS
* FLI
* FLC
* FPX
* FTEX
* GBR
* GD
* IMT
* IPTC/NAA
* MCIDAS
* MIC
* MPO
* PCD
* PIXAR
* PSD
* SUN
* WAL
* WMF
* EMF
* XPM
* WEBP
* CR2
* NEF


# Webhooks

General use case is when you do not want (or have possibility) to write the code that waits for the processing result. In that situation deep image will send the processing result information directly to user defined url.

Deep image provides webhooks support for the end of image processing event.

There two types of webhooks:

* set by Deep Image staff at user's account
* specified in the request

You can specify webhook in your processing request where the data with completed job will be sent:

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 1000,
    "height": 1000,
    "webhooks": {
        "complete": "https://YOUR-WEBHOOK"
    }
}
```

So, when job is completed, address "YOUR-WEBHOOK" will receive that data:

```json
{
  "job": "ce0e7624-634e-11ee-a699-0242ac14000b",
  "data": YOUR_REQUEST,
  "result_url": "https://localhost:8073/images/2023-10-05/1f48bcdb-0117-49aa-b9e3-c5df10680642.png",
  "results": null
}
```

If you cannot specify webhook in your request, please write a message to <support@deep-image.ai> and user's account webhook will be set.


# Auto enhance image quality

Deep Image web application includes an Auto Enhance tool that improves overall image quality automatically, without any manual settings.

Presets are ordered by quality and processing time (from the highest quality and longest time to the fastest):

* `auto_enhance_pro`
* `auto_enhance_qwen`
* `auto_enhance_klein9b`
* `auto_enhance` (Auto Enhance Normal)

### Presets overview <a href="#presets-overview" id="presets-overview"></a>

Use the preset that best fits your content and priorities (quality, speed, or minimal edits).

<table><thead><tr><th width="216">Preset</th><th>Label in app</th><th>Best for</th><th>Summary</th></tr></thead><tbody><tr><td><code>auto_enhance_pro</code></td><td>Auto Enhance Pro</td><td>Maximum quality</td><td>Advanced enhancement with the most detailed improvements.</td></tr><tr><td><code>auto_enhance_qwen</code></td><td>Auto Enhance Qwen</td><td>Balanced results</td><td>Balances the original input with re-generated elements for a natural look.</td></tr><tr><td><code>auto_enhance_klein9b</code></td><td>Auto Enhance Flux 2 Klein 9B</td><td>Speed</td><td>Fast, all-purpose enhancement optimized for speed and efficiency.</td></tr><tr><td><code>auto_enhance_generative</code></td><td>Auto Enhance Generative</td><td>Speed</td><td>Light adjustments focused on lighting, clarity, and face enhancement.</td></tr><tr><td><code>auto_enhance</code></td><td>Auto Enhance Normal</td><td>Speed</td><td>Light adjustments focused on lighting, clarity, and face enhancement.</td></tr></tbody></table>

### Image size logic <a href="#image-size-logic" id="image-size-logic"></a>

Auto Enhance applies automatic resize logic based on the input image width:

* for images below 1000 pixels - width = 400%
* for images from 1000 to 4096 - width = 4096
* for images above 4096 - no upscale

Height is calculated based on the input image aspect ratio.

```json
{
    "url": "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/old_photo.jpeg",
    "preset": "auto_enhance_pro"
}
```

Let's see results of each presets processing on such input photos:

<figure><img src="/files/GgErwzLsdNSUu9OVe7bu" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/LBIEIxK40JFTV3PjDkxB" alt=""><figcaption></figcaption></figure>

### `auto_enhance_pro`&#x20;

Processing time is around 30 seconds per image.

<figure><img src="/files/3KsQGZmdo0zgLFCH83IR" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/puffRBDrz588VlHIinLY" alt=""><figcaption></figcaption></figure>

### `auto_enhance_qwen`&#x20;

Processing time is around 30 seconds per image.

<figure><img src="/files/rRWgnCBJ9iwZXXN0OpWt" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/IkePNLHWBpkWflhQ0Dgd" alt=""><figcaption></figcaption></figure>

### `auto_enhance_klein9b`&#x20;

Processing time is around 15 seconds per image.

<figure><img src="/files/uYIFkk8TgJbdoMhpnd95" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/t8x4rOQt8PCtOqfPzcIT" alt=""><figcaption></figcaption></figure>

### `auto_enhance_generative`&#x20;

Processing time is around 15 seconds per image

<figure><img src="/files/vbIT490lO9iFZ8InPXYb" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/wX1l5Qe09H2PqTaLhY3r" alt=""><figcaption></figcaption></figure>

### `auto_enhance`&#x20;

Processing time is around 3 seconds per image.

<figure><img src="/files/J7XxsqZm2kIJ41wtghWk" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/YN06aOnaLJqXS9bGppBq" alt=""><figcaption></figcaption></figure>


# Create business photo or avatar from face image

This API function generates a custom avatar based on a single input image, ideal for creating high-quality avatars from a provided reference. Users can customize the avatar's dimensions, background, and style to suit various use cases.

Let's use this image as input:

<figure><img src="/files/ablWR34Tybss4iLAuEWF" alt=""><figcaption></figcaption></figure>

When creating images, there are several model types available. However, these two are preferred for optimal results:

* see-dream-4.5
* qwen
* gemini-3-pro-image-preview
* flux2-klein9b

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "width": 1024,
    "height": 1024,
    "background": {
        "generate": {
            "description": "Woman in a beige pantsuit, arms in pockets, looking professional, standing near a bookshelf. Outfit:  beige linen pantsuit and white blouse.",
            "adapter_type": "face",
            "model_type": "see-dream-4.5",
            "avatar_generation_type": "regular"
        }
    }
}
```

### see-dream-4.5

<figure><img src="/files/eSQucqteLyqZuUtd4p9a" alt=""><figcaption></figcaption></figure>

### qwen

<figure><img src="/files/AdS74sukfhQQUyBBAo1l" alt=""><figcaption></figcaption></figure>

### gemini-3-pro-image-preview

<figure><img src="/files/IQvovtNTuJqEFswxrFix" alt=""><figcaption></figcaption></figure>

### flux2-klein9b

<figure><img src="/files/IuHfgoSjBdS1bcaao1VT" alt=""><figcaption></figcaption></figure>

Also face swap can be used to ensure the face will be as close to source face as possible.

It can be done by specifying avatar\_generation\_type = "accurate"

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "width": 1024,
    "height": 1024,
    "background": {
        "generate": {
            "description": " a woman sitting behind a desk in a modern office environment. her smiling face is seen from behind her computer screen, with only the top of her head and a portion of her shoulders visible. The office space around her is bright and airy, illuminated by soft, natural light streaming in from large windows.",
            "adapter_type": "face",
            "model_type": "google-gemini-image-flash",
            "avatar_generation_type": "accurate"
        }
    }
}
```

**Description of older models**

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "width": 1024,
    "height": 1024,
    "background": {
        "generate": {
            "description": " a woman sitting behind a desk in a modern office environment. her smiling face is seen from behind her computer screen, with only the top of her head and a portion of her shoulders visible. The office space around her is bright and airy, illuminated by soft, natural light streaming in from large windows.",
            "adapter_type": "face",
            "face_id": true
        }
    }
}
```

**Parameter Breakdown:**

* **url**: URL of the input image that will serve as the base for avatar generation.
* **width** and **height**: Dimensions of the output avatar image, specified in pixels. Here, the output will be a 1024x1024 square.
* **background**:
  * **generate**: Details for the AI-generated image.
    * **description**: Text description
    * **adapter\_type**: it has to be "face" for avatar generation
    * **face\_id**: if true it turns on algorithm that changes hair, etc.

<figure><img src="/files/NeAoAu12YPCzGyoXKpUH" alt=""><figcaption></figcaption></figure>


# Face swap

Face swapping API can be used for replacing the face on the original image with another one.

```json
{
    "url": "original_image",
    "background": {
        "generate": {
            "adapter_type": "face",
            "avatar_generation_type": "creative_img2img",
            "ip_image2": "replacement_face_url"
        }
    }
}
```

### Whole head swap

By default, face swap replaces the face area only.

To swap the whole head, set `background.generate.generation_type` to `"head_swap"`.

This works well when hairstyle, head shape, or head position should also change.

```json
{
    "url": "original_image",
    "background": {
        "generate": {
            "adapter_type": "face",
            "avatar_generation_type": "creative_img2img",
            "generation_type": "head_swap",
            "ip_image2": "replacement_face_url"
        }
    }
}
```

Let's swap a head from this photo to another:

<figure><img src="/files/xPlWu7PXvEbUHPJdKiH0" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/V4OFlfdGtQuVIFkkVlq0" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/p0mUwetHvPibDRpuSh88" alt=""><figcaption></figcaption></figure>


# Create beautiful product photo

Generating background is fantastic way of improving product photo look. It can be even solution for creating product pack shots without need of manually taking expensive commercial photo shoots. It automatically removes background around the main subject, places it in the center of specified canvas (width and height API parameters) and generates image around the subject.

There are two types of background generation:

1. Blended (original image over the generated background)\
   Pros: the product stays identical to the original, no risk of product distortion, predictable result, product can be positioned freely,\
   Cons: less creative freedom, the product cannot be naturally integrated into the scene (e.g., held in a hand), weaker light/shadow interaction with the environment.
2. Fully generative\
   Pros: the product can be modified by the scene (e.g., covered by something or held in a hand), higher creative freedom and more realistic scene integration.\
   Cons: limited generation resolution (1024×1024), risk that the product may look different from the original.

### Blended background generation

| Parameter              | Description                                                                                                                                                                                                                   |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| description            | Text prompt describing the scene                                                                                                                                                                                              |
| item\_area\_percentage | Parameter between 0 and 1 that controls size of the object which is placed in the middle of final image. So, 0.85 is 85%                                                                                                      |
| sample\_num            | Seed for random generator. Basically is "id" of generated image. When not specified, image will randomly different every time.                                                                                                |
| color                  | When color is specified, generated background is converted to b\&w and then to specified color. It works best for prompts such as: "item standing on plain white background". Color has to be RGB array - f.e. \[255,255,255] |
| generation\_type       | Should be set to "**outpainting**". Other type is "**generate**" which will regenerate whole image with given product. Outpainting guarantees product unchanged.                                                              |

Let's place the bottle of perfumes from below photo in other environment.

<figure><img src="/files/AL06ocJsMKT3XsFoCYXi" alt=""><figcaption></figcaption></figure>

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "background": {
        "generate": {
            "description": "Small {item} positioned on a moss-covered rock, misty forest in the background.",
            "item_area_percentage": 0.75,
            "generation_type": "outpainting"
        }
    }
}
```

<figure><img src="/files/Mll27ARuDQa5aPshjWIm" alt=""><figcaption></figcaption></figure>

We can specify also image resolution:

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 1000,
    "height": 1000,
    "background": {
        "generate": {
            "description": "Small {item} positioned on a moss-covered rock, misty forest in the background.",
            "item_area_percentage": 0.75,
            "generation_type": "outpainting"
        }
    }
}
```

<figure><img src="/files/mDV3qkaX36PqF2BLUYGk" alt=""><figcaption></figcaption></figure>

When specifying a color:

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 1000,
    "height": 1000,
    "background": {
        "generate": {
            "description": "item positioned on plain white background",
            "item_area_percentage": 0.65,
            "color": [217,179,190]
        }
    }
}
```

<figure><img src="/files/YRMBTOFlVh546ekVcD9t" alt=""><figcaption></figcaption></figure>

### Generative background generation

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 1000,
    "height": 1000,
    "background": {
        "generate": {
            "description": "Item positioned on a moss-covered rock, misty forest in the background.",
            "generation_type": "generate"
        }
    }
}
```

<figure><img src="/files/WiFuS32ZpqXqOPpFYlf9" alt=""><figcaption></figcaption></figure>

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 1024,
    "height": 1024,
    "background": {
        "generate": {
            "model_type": "gemini-3-pro-image-preview",
            "description": "Place this item on a moss-covered rock, misty forest in the background."
        }
    }
}
```

<figure><img src="/files/Q4Mz9eo4Z92fuOK9UAFe" alt=""><figcaption></figcaption></figure>

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 2048,
    "height": 2048,
    "background": {
        "generate": {
            "model_type": "see-dream-4.5",
            "description": "Place this item on a moss-covered rock, misty forest in the background."
        }
    }
}
```

<figure><img src="/files/idhXydXPDlTR4UFTkSNj" alt=""><figcaption></figcaption></figure>

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 1024,
    "height": 1024,
    "background": {
        "generate": {
            "model_type": "flux2-klein9b",
            "description": "Place this item on a moss-covered rock, misty forest in the background."
        }
    }
}
```

<figure><img src="/files/9Y9ICvkvA4lMOCKiTd1Y" alt=""><figcaption></figcaption></figure>


# Product photo unification

To achieve a professional and consistent look for ecommerce product photos, it's important to standardize and center each image within a square format and white background.

By setting the width and height to 2048 pixels, and using a cropping method that isolates the item, each product can be presented uniformly. This setup also includes a padding of 15.72%, ensuring that the product is not squeezed against the edges, thereby providing a clean and balanced visual appearance. Such attention to detail can enhance the overall aesthetic of the online store, making it more appealing to potential customers.

```json
{
  "url": "https://deep-image.ai/api-example.png",
  "width": 2048,
  "height": 2048,
  "fit": {
     "crop": "item"
  },
  "padding": "15.72%",
  "background": {
    "remove": "auto",
    "color": "#FFFFFF"
  }
}
```

<figure><img src="/files/Q9qoRWDFSJ7WP8ZL1Dgj" alt=""><figcaption></figcaption></figure>


# Generative upscale

Generative upscaling increases image resolution with diffusion models.

It works for any input image, not only generated ones.

Use it for photos, product shots, scans, illustrations, and AI-generated images when you want more texture and more detail than regular upscale can recover.

{% hint style="warning" %}
Generative upscale can slightly change the image. It may add or reinterpret small details. Keep it off when exact source fidelity matters most.
{% endhint %}

### Parameters

| Parameter            | What it does                                                                                                                                     |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `generative_upscale` | Turns on diffusion-based upscaling. Use `true` when you want a richer and more detailed result.                                                  |
| `upscale_strength`   | Controls how strongly the generative part affects the image. Lower values stay closer to standard upscale. Higher values push a stronger effect. |

If you only set `width` or `height`, the other dimension is calculated automatically. For more about sizing rules, see [Resize and padding](/image-processing/resize-and-padding).

### `upscale_strength` levels

Think about `upscale_strength` as a style dial.

Values `1` to `3` stay closest to standard upscale.

Values `4` to `6` are a more balanced middle ground.

Values `7` to `9` push the strongest generative effect.

<table><thead><tr><th width="99">Value</th><th>In plain words</th></tr></thead><tbody><tr><td><code>1</code></td><td>Most conservative option with cleanup. Good when you want a tidier image with minimal reinterpretation.</td></tr><tr><td><code>2</code></td><td>Bicubic resize without generative influence. Simple and conservative.</td></tr><tr><td><code>3</code></td><td>Pure upscale_4 path. Best when you want a safer result.</td></tr><tr><td><code>4</code></td><td>Balanced and cleaner. Useful for older photos, web images, and mild compression artifacts.</td></tr><tr><td><code>5</code></td><td>A solid default when you want detail without going too far.</td></tr><tr><td><code>6</code></td><td>Balanced direct upscale with a lighter generative touch.</td></tr><tr><td><code>7</code></td><td>Strong effect with cleanup. Good for messy or compressed inputs.</td></tr><tr><td><code>8</code></td><td>Starts from bicubic resize, then lets the generative model do heavy lifting.</td></tr><tr><td><code>9</code></td><td>Most AI-driven version of direct 4x upscale. Good when you want extra texture and detail.</td></tr></tbody></table>

Let's check the 320×213 example

<figure><img src="/files/AKShB7Fp5zJVOWs7byiB" alt=""><figcaption></figcaption></figure>

Upscaled with strength 1:

<figure><img src="/files/0HqLQ2PfCh3AO3plGqjW" alt=""><figcaption></figcaption></figure>

and with strength = 9

<figure><img src="/files/NH29gsaDpmeJjBy0S4Ru" alt=""><figcaption></figcaption></figure>

### Upscale any image

This example upscales a regular input image.

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 3000,
    "generative_upscale": true,
    "upscale_strength": 5
}
```

Use a lower `upscale_strength` when you want to stay closer to the original image.

Use a higher `upscale_strength` when you want a stronger stylized result.

### Prompt-guided generative upscale

You can also guide the upscale with a prompt.

This is useful when you want the model to push specific textures or visual mood during the upscale.

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 2048,
    "height": 1024,
    "generative_upscale": true,
    "upscale_strength": 4,
    "background": {
        "generate": {
            "adapter_type": "upscale",
            "description": "small cottage and cows eating grass on the green fields. Sunset."
        }
    }
}
```

For more about prompt-based generation fields, see [Image generation](/image-processing/image-generation).

<figure><img src="/files/MlFdf1YSd39DmqRWRhyy" alt=""><figcaption><p>Example result with generative upscale enabled.</p></figcaption></figure>


# Remove background

Remove the background from a product, person, or object.

Use background removal when you want a clean cutout for ecommerce, design, or further editing.

The simplest request uses `background.remove`.

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "background": {
        "remove": "auto"
    }
}
```

`auto` works well for most images.

Use `human` for portraits.

Use `item` for products and objects.

### Prompt-based removal

Use prompt-based removal when the image contains multiple foreground elements and you want to control what stays.

```json
{
    "background": {
        "remove": "generative",
        "prompt": "keep relevant foreground, keep relevant objects"
    }
}
```

Let's remove background from this photo:

<figure><img src="/files/o4Phr8PwEsOqnNEJPlzM" alt=""><figcaption></figcaption></figure>

First with default model:

<figure><img src="/files/aYgal4D4TlH6GPeM5wFl" alt=""><figcaption></figcaption></figure>

And then with diffusion based background removal with prompt: "keep relevant foreground, keep relevant objects"

<figure><img src="/files/UizaVNvhqKA42Gc0mfZK" alt=""><figcaption></figcaption></figure>

You can combine removal with a flat color or a replacement background.

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "background": {
        "remove": "item",
        "color": "#FFFFFF"
    }
}
```

For full parameter details, examples, and item cropping, see [Background removal and generation](/image-processing/background-removal-and-generation).

For photo preparation tips, see [Remove BG recommendation](/image-processing/background-removal-and-generation/remove-bg-recommendation).


# AI Drawing to Image - Doodle

The "AI Drawing to Image - Doodle" feature allows you to turn simple sketches or doodles into fully realized images using AI. This is particularly useful for artists, designers, and creatives who want to quickly visualize concepts or refine rough drafts into polished designs. By interpreting your drawing, the AI applies its generative capabilities to transform basic sketches into detailed, stylistically rich images.

To use this feature, simply provide a rough outline or doodle, and the AI will generate an image based on your input. You can specify the level of detail, style, and even include specific prompts for what you'd like the AI to emphasize in the drawing.

Let's make a photo from flower drawing.

<figure><img src="/files/ULHdhG5Fh8BISJMhiSnO" alt="" width="375"><figcaption></figcaption></figure>

Using request:

```json
{
    "url": "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/flowers-6770694_1280.jpg",
    "background": {
       "generate": {
           "description": "realistic version of flowers in the mountains",
           "adapter_type": "control2",
           "model_type": "qwen"
       }
    }
}
```

our result is

<figure><img src="/files/D6pG50lSd7xXs8DjzMeG" alt=""><figcaption></figcaption></figure>

### Other models

#### Default (without model\_type)

<figure><img src="/files/VHT3oEN5Cr0JgVrFBRf1" alt="" width="375"><figcaption></figcaption></figure>

### see-dream-4.5

<figure><img src="/files/fUcbabgAJYpAhE2oqrn9" alt=""><figcaption></figcaption></figure>

### flux2-klein9b

<figure><img src="/files/bLlpM4xutlL7QORSkB1l" alt=""><figcaption></figcaption></figure>


# Real estate

We can use image generation feature to transform empty or bare room photos into fully furnished and designed spaces. Whether you're showcasing a property, visualizing design options, or enhancing listings, this feature can automatically add furniture, decor, and other design elements to an empty room, creating a realistic, styled environment.

Let's change this image

<figure><img src="/files/LTW6gd7JzZaLh4Ca3Gkf" alt="" width="563"><figcaption></figcaption></figure>

### Image edit based

```json
{
    "url": "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/lost-places-597166_1280.jpg",
    "background": {
       "generate": {
           "description": "A loft style furnishings",
           "adapter_type": "control",
           "model_type": "flux2-klein9b"
       }
    }
}
```

<figure><img src="/files/Ts39GeB2cVBJGX0jK5zx" alt=""><figcaption></figcaption></figure>

Other model types examples:

#### gemini-3-pro-image-preview

<figure><img src="/files/LoZgXNjhaRl98OUEHLsN" alt=""><figcaption></figcaption></figure>

#### qwen

<figure><img src="/files/mliFk04qMsM9f9qhk2AK" alt=""><figcaption></figcaption></figure>

#### see-dream-4.5

<figure><img src="/files/ebwP0GTumrmDJ36HLvxq" alt=""><figcaption></figcaption></figure>

### Controlnet based

```json
{
    "url": "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/lost-places-597166_1280.jpg",
    "background": {
       "generate": {
           "description": "A loft style furnishings",
           "adapter_type": "control",
           "controlnet_conditioning_scale": 0.75
       }
    }
}
```

into:

<figure><img src="/files/Ylv8X1SPzdVPCz4Zc6qe" alt="" width="563"><figcaption></figcaption></figure>

Parameter "**adapter\_type**" is an algorithm type. Value "**control**" generates images based on given image and the edges extracted from the given image while value "**control2**" generates based only on extracted edges. Let's visualise those differences:

Having that image:

<figure><img src="/files/08rX4WbY9aakkop9X8f1" alt=""><figcaption></figcaption></figure>

Edges extracted from that image (this is done under the hood during processing):

<figure><img src="/files/VLrnuo01ygdK1Kyi8x2S" alt=""><figcaption></figcaption></figure>

Result (the same prompt and other parameters) for adapter\_type = "**control**" (based on image and edges), image is mostly preserved, there are just minimal changes.

<figure><img src="/files/RdpqJSzXZVTsiiVYE1AG" alt=""><figcaption></figcaption></figure>

Using adapter\_type = "control2" it uses only edges of the given image:

<figure><img src="/files/MhgAfLZ4uS2IZBJOWG7y" alt=""><figcaption></figcaption></figure>

Yet another example.

<figure><img src="/files/WuxnZH9kIJSNqgQbtBe8" alt=""><figcaption></figcaption></figure>

Description: "house at winter", adapter\_type="control2" (just edges).

<figure><img src="/files/uzqPekAPlPuxPP31bFgE" alt=""><figcaption></figcaption></figure>


# Enhancing documents

### Using image edit generation models

Generative document upscaling can enhance legibility and recover fine details from low‑resolution scans, improving OCR accuracy, searchability, and archival quality while reducing manual cleanup. It also enables consistent formatting across batches and can adaptively sharpen text, diagrams, and stamps better than traditional interpolation. However, it may introduce hallucinated artifacts, alter original content fidelity, or over‑smooth important marks, which is risky for legal or compliance contexts. The results can be biased by the training data and are sensitive to input quality, and the process can be compute‑intensive, requiring careful validation and human review for critical documents.

Having such small document image

<figure><img src="/files/cquuSqIe6t2Eo7bidvm9" alt=""><figcaption></figcaption></figure>

```json
{
    "url": "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/tax-office-233345_1280-small.jpg",
    "preset": "enhance_document"
}
```

<figure><img src="/files/AuWEXpnM74byI853YEYR" alt=""><figcaption></figcaption></figure>

### Using text\_x4 upscale model

"text\_x4" is a model that is specifically optimized for upscaling and enhancing images containing text. This feature is ideal for images such as documents, scanned text, or any visuals with embedded text that require high readability and clarity after upscaling. Using advanced AI models trained on text-focused data, this endpoint allows you to upscale images while preserving and enhancing text details, making text sharper and easier to read at higher resolutions.

Usage:

```json
{
    "url": "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/tax-office-233345_1280-small.jpg",
    "width": "400%",
    "upscale_parameters": {
        "type": "text_x4"
    }
}
```

and the result

<figure><img src="/files/atLC8hgMVgTDVcTE8RyE" alt=""><figcaption></figcaption></figure>

While using normal upscale effect is:

<figure><img src="/files/5UTEk1EEPSQZRcxE8H6d" alt=""><figcaption></figcaption></figure>


# Car dealer photo

Let's say we want to create attractive car photo. We have plain car photos:

<figure><img src="/files/FeTvLqBj7DsAxfWKQLQB" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/9FYfCIFMLRnNN90mCLTz" alt=""><figcaption></figcaption></figure>

and the backdrops:

<figure><img src="/files/25hf5zf7foWJ6N2tAhTm" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/PzYt5T7taW1PKNDMFjIi" alt=""><figcaption></figcaption></figure>

#### Image Blending Techniques

When it comes to integrating a product image with various backdrops, two primary image blending techniques can be employed:

1. **Fully Generative**:

   * This technique allows for the generation of entirely new visuals by seamlessly integrating the product with the chosen backdrop. It can also amend or alter the product image itself, ensuring that it aesthetically aligns with the overall composition. Fully generative blending is particularly useful for creative and flexible visual storytelling where customization and independence from the original image are desired.

2. **Plain Blending**

   This type of blending preserves item/product but can have problems with perspective. By not changing item/product it also will not remove uncecessary reflections, dirt, etc.

Each method offers distinct advantages, depending on whether the emphasis is on creative freedom or product fidelity.

### Example of fully generative blending

<figure><img src="/files/qYmfQADtgvDdhqayE1fw" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/4pNR8ZDv002akbsVSiAU" alt=""><figcaption></figcaption></figure>

```json
{
  "background": {
    "generate": {
      "description": "place the car in place from second photo, car dealer photo",
      "model_type": "gemini-3-pro-image-preview",
      "adapter_type": "img2img",
      "context_images": [
        "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/gitbook1.jpg",
        "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/gitbook2.jpg"
      ]
    }
  },
  "width": 1344,
  "height": 768
}
```

and the result is:

<figure><img src="/files/5V4QNXavo4WwZ4orU6Sf" alt=""><figcaption></figcaption></figure>

### Example of plain blending

```json
{
    "url": "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/20230315_101335.jpg",
    "background": {
        "generate": {
            "description": "item positioned on plain white background, diffused reflections",
            "item_area_percentage": 0.65,
            "position": "MB",
            "background_url": "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/auto-backdrop2.jpg"
        }
    }
}
```

<figure><img src="/files/EYEs5kj0p77cYUqRyqVt" alt=""><figcaption></figcaption></figure>

| Parameter              | Description                                                                                                                                                                                                                                                      |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| item\_area\_percentage | Float value from 0.3 to 1.0 describing how much the item  will be rescaled.                                                                                                                                                                                      |
| position               | <p>Possible values</p><ul><li>LT - left top</li><li>MT - middle top</li><li>RT - right top</li><li>LM - left middle</li><li>MM - middle middle</li><li>RM - right middle</li><li>LB - left bottom</li><li>MB - middle bottom</li><li>RB - right bottom</li></ul> |
| background\_url        | Url to backdrop image                                                                                                                                                                                                                                            |

Additional hints:

* To create a realistic effect, ensure the object's perspective matches the background. Otherwise, the effect may appear unrealistic.
* The prompt description needs to similar to: "item positioned on plain white background, diffuse reflections", otherwise blend of generated background and the backdrop will be unrealistic.
* Generated image will have resolution of the given backgrop


# Prompt-based image editing

Prompt-based editing lets you modify a specific part of an image by describing the change you want to see. The API uses a context image and generates a new version based on your instruction.

#### Basic example

Let's us try to remove a blue car from below photo.

<figure><img src="/files/Q8KroevNqMhZg2WKYgNs" alt=""><figcaption></figcaption></figure>

```json
{
  "background": {
    "generate": {
      "description": "remove a blue car",
      "model_type": "gemini-3-pro-image-preview",
      "adapter_type": "img2img",
      "context_images": [
        "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/gitbook1.jpg"
      ]
    }
  },
  "width": 1344,
  "height": 768
}
```

And the result is

<figure><img src="/files/JdPb1QBWuXVwUs9ba5xJ" alt=""><figcaption></figcaption></figure>

#### Parameters of background generate section

| Parameter       | Description                                                                                                                              |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| description     | Text prompt describing the edit you want to apply.                                                                                       |
| model\_type     | Model used for editing. Example: gemini-3-pro-image-preview. [Other models](/image-processing/advanced-model-types-for-image-generation) |
| adapter\_type   | Adapter that defines the editing mode. Use img2img for editing based on an existing image.                                               |
| context\_images | Array of URLs to source images used as context for the edit.                                                                             |
| width           | Target width of the output image.                                                                                                        |
| height          | Target height of the output image.                                                                                                       |

#### Notes

* Use clear and specific prompts (e.g., “remove a blue car”, “replace sky with sunset”).
* The output size is controlled by width and height.
* context\_images must be publicly accessible URLs.

#### Example prompt variations

{% tabs %}
{% tab title="Remove object" %}

```json
{
  "background": {
    "generate": {
      "description": "remove a blue car",
      "model_type": "gemini-3-pro-image-preview",
      "adapter_type": "img2img",
      "context_images": [
        "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/gitbook1.jpg"
      ]
    }
  },
  "width": 1344,
  "height": 768
}
```

{% endtab %}

{% tab title="Change background" %}

```json
{
  "background": {
    "generate": {
      "description": "replace background with a snowy mountain landscape",
      "model_type": "gemini-3-pro-image-preview",
      "adapter_type": "img2img",
      "context_images": [
        "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/gitbook1.jpg"
      ]
    }
  },
  "width": 1344,
  "height": 768
}
```

{% endtab %}

{% tab title="Add detail" %}

```json
{
  "background": {
    "generate": {
      "description": "add a red umbrella on the left side",
      "model_type": "gemini-3-pro-image-preview",
      "adapter_type": "img2img",
      "context_images": [
        "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/gitbook1.jpg"
      ]
    }
  },
  "width": 1344,
  "height": 768
}
```

{% endtab %}
{% endtabs %}


# Resize and padding

### Image size

Image can be upscaled and placed in any shape/canvas.

It is possible to set just one dimension, the other will be calculated automatically and image ratio will be preserved. Also padding parameter will be used in that case.

{% hint style="info" %}
Notice that Deep Image supports AI upscale up to 4x of the original resolution. Everything above that will be upscaled traditionally with bicubic supersampling.
{% endhint %}

Let's check some resize examples.

This is the input image.

<figure><img src="/files/dDMyXHxEpDSuA0b0jCor" alt=""><figcaption><p>Input image: 640x427</p></figcaption></figure>

The destination image size can be controller with "width" and "height" parameters.

{% hint style="info" %}
Image can be also upscaled with "print\_size" and "dpi" parameters. More on that here in Image Processing / Print chapter.
{% endhint %}

<table><thead><tr><th width="244">Parameter name</th><th>Description</th></tr></thead><tbody><tr><td>width</td><td><ul><li>string f.e. - "200%" - it will upscale image by factor 2.</li><li>integer f.e. - 200 - it will upscale/downscale image to have width 200 pixels. If the height is not given it will be calculated to match image ratio.</li></ul></td></tr><tr><td>height</td><td><ul><li>string f.e. - "200%" - it will upscale image by factor 2.</li><li>integer f.e. - 200 - it will upscale/downscale image to have height 200 pixels. If the width is not given it will be calculated to match image ratio.</li></ul></td></tr><tr><td>min_length</td><td>integer f.e. - 200 - it will upscale/downscale image to have minimum 200 pixels width or height. That will also be applied to identified item/content when removing background.</td></tr><tr><td>generative_upscale</td><td>true/false - Turns on upscaling based on diffusion algorithms. Image is generated max in 2048x2048 resolution and then upscaled further using standard AI upscaling. More on that: <a href="https://documentation.deep-image.ai/image-processing/image-generation#generative-upscaling">https://documentation.deep-image.ai/image-processing/image-generation#generative-upscaling</a></td></tr><tr><td>upscale_parameters: type</td><td><ul><li>v1 - (default) - basic AI upscaling method</li><li>text_x4 - used to upscale images containing text, such as invoices or product photos with labels, optimizing clarity and readability of the text.</li></ul></td></tr></tbody></table>

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 1000,
    "upscale_parameters": {
        "type": "text_x4"
    }
}
```

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

```
curl --request POST \
     --url https://deep-image.ai/rest_api/process_result \
     --header 'content-type: application/json' \
     --header 'x-api-key: API_KEY' \
     --data '{
         "url": "https://deep-image.ai/api-example.png",
         "width": 1000
      }'
```

{% endtab %}

{% tab title="Python client" %}

```python
import os

import deep_image_ai_client

configuration = deep_image_ai_client.Configuration(
    host="https://deep-image.ai"
)

configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

with deep_image_ai_client.ApiClient(configuration) as api_client:
    api_instance = deep_image_ai_client.DefaultApi(api_client)
    process_payload = {"url": "https://deep-image.ai/api-example.jpg", "width": 1000}
    api_response = api_instance.rest_api_process_result_post(process_payload)

```

{% endtab %}
{% endtabs %}

<figure><img src="/files/4IlBA2tOt6FW7wOoqdJh" alt=""><figcaption><p>Result image: 1000x667</p></figcaption></figure>

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "height": 1000
}
```

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

```
curl --request POST \
     --url https://deep-image.ai/rest_api/process_result \
     --header 'content-type: application/json' \
     --header 'x-api-key: API_KEY' \
     --data '{
         "url": "https://deep-image.ai/api-example.png",
         "height": 1000
      }'
```

{% endtab %}

{% tab title="Python client" %}

```python
import os

import deep_image_ai_client

configuration = deep_image_ai_client.Configuration(
    host="https://deep-image.ai"
)

configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

with deep_image_ai_client.ApiClient(configuration) as api_client:
    api_instance = deep_image_ai_client.DefaultApi(api_client)
    process_payload = {"url": "https://deep-image.ai/api-example.jpg", "height": 1000}
    api_response = api_instance.rest_api_process_result_post(process_payload)

```

{% endtab %}
{% endtabs %}

<figure><img src="/files/kzg9xTmlW29JjUV6PpOF" alt=""><figcaption><p>Result image: 1500x1000</p></figcaption></figure>

If width and height is specified together, image with original ratio will be upscaled and placed inside "width x height" canvas. Fitting parameter will be used accordingly.

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 1000,
    "height": 1000
}
```

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

```
curl --request POST \
     --url https://deep-image.ai/rest_api/process_result \
     --header 'content-type: application/json' \
     --header 'x-api-key: API_KEY' \
     --data '{
         "url": "https://deep-image.ai/api-example.png",
         "width": 1000,
         "height": 1000
      }'
```

{% endtab %}

{% tab title="Python client" %}

```python
import os

import deep_image_ai_client

configuration = deep_image_ai_client.Configuration(
    host="https://deep-image.ai"
)

configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

with deep_image_ai_client.ApiClient(configuration) as api_client:
    api_instance = deep_image_ai_client.DefaultApi(api_client)
    process_payload = {"url": "https://deep-image.ai/api-example.jpg", "width": 1000, "height": 1000}
    api_response = api_instance.rest_api_process_result_post(process_payload)

```

{% endtab %}
{% endtabs %}

<figure><img src="/files/XakgSgI21mrcyt2WO0zi" alt=""><figcaption><p>Result image: 1000x1000</p></figcaption></figure>

### Fitting and padding

According to specified width and height image can either cropped to fill given canvas or placed fully into the given canvas. When image is cropped checking the image content can be performed.

How the image is placed into destination canvas (with width and height parameters) is controlled by "fit" parameter.

<table><thead><tr><th width="189">Name</th><th>Description</th></tr></thead><tbody><tr><td>canvas</td><td><strong>(default)</strong> - whole image is placed into width x height canvas, missing space is filled with background color. Additionally "outpainting" might be specified - more on that <a href="/pages/9u6p1oSHO6k6sYsvsLvj#outpainting-uncrop">here</a> </td></tr><tr><td>crop</td><td>Image is cropped to match destination width x height canvas. Crop is content aware by default. It can be changed to be on center as well.</td></tr><tr><td>bounds</td><td>image is upscaled to fit specified width x height.</td></tr><tr><td>cover</td><td> image is upscaled to fully cover specified width x height.</td></tr></tbody></table>

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

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 1000,
    "height": 1000,
    "fit": "canvas"
}
```

<figure><img src="/files/NHK76Da0tOK3kgr3O4H7" alt=""><figcaption><p>Result image: 1000x1000</p></figcaption></figure>
{% endtab %}

{% tab title="Crop" %}

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 1000,
    "height": 1000,
    "fit": {
         "crop": "content"
    }
}
```

<figure><img src="/files/LrnVzSvuShNhocNk9kKe" alt=""><figcaption><p>Result image: 1000x1000</p></figcaption></figure>
{% endtab %}
{% endtabs %}

### Types of crop

Image cropping can be performed from the image center or from the center of identified content.

<figure><img src="/files/nZqCWtZf8etUYroxcwVZ" alt=""><figcaption><p>Input</p></figcaption></figure>

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

```json
{
    "url": "https://deep-image.ai/api-example2.jpg",
    "width": 1000,
    "height": 1000,
    "fit": {
         "crop": "center"
    }
}
```

<figure><img src="/files/QuFPc2ECKmF5khIJ01AV" alt=""><figcaption><p>Result</p></figcaption></figure>
{% endtab %}

{% tab title="Content" %}

```json
{
    "url": "https://deep-image.ai/api-example2.jpg",
    "width": 1000,
    "height": 1000,
    "fit": {
         "crop": "content"
    }
}
```

<figure><img src="/files/W2xEXcPz0wM7GV3TP1OR" alt=""><figcaption><p>Result</p></figcaption></figure>

{% endtab %}

{% tab title="Item" %}

```json
{
    "url": "https://deep-image.ai/api-example2.jpg",
    "width": 1000,
    "height": 1000,
    "fit": {
         "crop": "item"
    }
}
```

<figure><img src="/files/mdIKz42qiGOPypf7jGN6" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

Crop "item" type is not particularly useful without padding and removing background. But it's very useful for "product" type manipulations. More on that at [Remove background and item cropping](/image-processing/background-removal-and-generation#item-cropping).

Content aware cropping prevents objects being cut by the desired canvas proportions. Let's see some examples.

<figure><img src="/files/BU1mQcqJJ76fZSzujeyH" alt=""><figcaption><p>Input image</p></figcaption></figure>

```json
{
    "width": 1000,
    "height": 1000,
    "fit": "crop"
}
```

<figure><img src="/files/2Y77MIIR5542ESp3uU0T" alt=""><figcaption></figcaption></figure>

When margin is needed, parameter padding can be used for that. It can be specified either in pixels  or in percentages.

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

```json
{
    "url": "https://deep-image.ai/api-example.jpg",
    "width": 1000,
    "height": 1000,
    "fit": "canvas",
    "padding": "20%"
}
```

<figure><img src="/files/uCV4p2uqn9rKLgk8niym" alt=""><figcaption><p>Result image: 1000x1000, content: 800x533, padding 200 pixels</p></figcaption></figure>
{% endtab %}

{% tab title="Crop" %}

```json
{
    "url": "https://deep-image.ai/api-example.jpg",
    "width": 1000,
    "height": 1000,
    "fit": "crop",
    "padding": "20%"
}
```

<figure><img src="/files/5AsotI2pNA0S2JIcr2Ss" alt=""><figcaption><p>Result image: 1000x1000, content: 800x800, padding: 200</p></figcaption></figure>
{% endtab %}
{% endtabs %}

<br>


# E-commerce

E-commerce image-processing templates and background styles.

Use these templates to select a product image treatment or background style.

Each template has a display name and a `name` value for processing requests.

### Example API request

Pass the selected `name` in `preset`.

This example uses the premium automotive listing template.

```json
{
  "url": "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/gitbook1.jpg",
  "preset": "automotive-luxury-dramatic-lighting-premium-listing",
  "model_type":"gemini-3-pro-image",
  "adapter_type":"img2img"
}
```

Replace `url` and `preset` with your values.

### Jewelry and accessories

| Preview                                                                                                        | Template                             | `name`                                                   |
| -------------------------------------------------------------------------------------------------------------- | ------------------------------------ | -------------------------------------------------------- |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/bd724b50-16d5-45e4-b9dd-b8bd86636c69.webp) | Ring on Finger – Close-Up Detail     | `jewelry-accessories-ring-on-finger-close-up-detail`     |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/63658e44-2ffa-4239-ad38-92cfbb8ccd9f.webp) | Ring on Hand – Mid Distance          | `jewelry-accessories-ring-on-hand-mid-distance`          |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/23bd24f0-98d7-43bb-a71c-e041a57f3e30.webp) | Earrings – Close Detail              | `jewelry-accessories-earrings-close-detail`              |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/00000395-025a-40d7-9172-4d0b878dc69a.webp) | Earrings – Half Portrait             | `jewelry-accessories-earrings-half-portrait`             |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/a11dbb16-6420-4795-822e-411d0e3a69b0.webp) | Necklace – Close-Up Neck Detail      | `jewelry-accessories-necklace-close-up-neck-detail`      |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/78389b8e-ec99-4963-a973-95fceaddd7be.webp) | Necklace – Upper Body Shot           | `jewelry-accessories-necklace-upper-body-shot`           |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/317ec1df-e78e-44e8-9400-2666502861bc.webp) | Bracelet – Macro Wrist Detail        | `jewelry-accessories-bracelet-macro-wrist-detail`        |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/8c5ad598-7dab-494b-aa93-af1cef294614.webp) | Bracelet – Mid Distance Natural Pose | `jewelry-accessories-bracelet-mid-distance-natural-pose` |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/32393218-04ca-4729-bda8-fc47b02147ca.webp) | Jewelry – Close-Up Studio Packshot   | `jewelry-accessories-jewelry-close-up-studio-packshot`   |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/2bf2b325-9667-4ca8-b77f-4799dc2522a8.webp) | Jewelry – Standard Catalog Distance  | `jewelry-accessories-jewelry-standard-catalog-distance`  |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/dbebdd54-6fbf-42e3-a254-3227afd72e08.webp) | Jewelry in Box – Close Detail        | `jewelry-accessories-jewelry-in-box-close-detail`        |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/4fbd008c-8577-422c-8fbd-a2d709e73c80.webp) | Jewelry in Box – Wider Composition   | `jewelry-accessories-jewelry-in-box-wider-composition`   |

### Fashion and apparel

| Preview                                                                                                        | Template                               | `name`                                                 |
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------- | ------------------------------------------------------ |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/90fd67c0-d644-4000-ae64-419a009880c1.webp) | Female Model – Clean Studio Look       | `fashion-apparel-female-model-clean-studio-look`       |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/403056f1-ced3-4009-92fb-4e69b8899a0c.webp) | Male Model – Clean Studio Look         | `fashion-apparel-male-model-clean-studio-look`         |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/80386246-79d8-4e2f-876f-49b4efb34e23.webp) | Female Model – Urban Lifestyle         | `fashion-apparel-female-model-urban-lifestyle`         |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/f6a75947-92f6-490a-acd6-8b5afaea407b.webp) | Male Model – Urban Street Style        | `fashion-apparel-male-model-urban-street-style`        |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/13abf630-658b-4d12-8dbe-0edee0ced75d.webp) | Female Model – Indoor Minimal Interior | `fashion-apparel-female-model-indoor-minimal-interior` |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/ea56112e-38bf-4ff0-aa99-29895991a8f5.webp) | Male Model – Casual Everyday Context   | `fashion-apparel-male-model-casual-everyday-context`   |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/0b76b680-86a7-4811-aa63-e8e05f842c1e.webp) | Full-Body Female Model Shot            | `fashion-apparel-full-body-female-model-shot`          |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/70fb437b-df87-4554-bdb8-f3b4e3a97034.webp) | Full-Body Male Model Shot              | `fashion-apparel-full-body-male-model-shot`            |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/ec62e1d1-3e88-49e8-9b66-a442e36cc6e7.webp) | Front & Back View                      | `fashion-apparel-front-back-view`                      |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/edbf310e-8ec1-4c6d-addc-f65fc5a0ac12.webp) | Flat Lay Composition                   | `fashion-apparel-flat-lay-composition`                 |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/a4ef4f4b-bb49-4fb5-a6ac-573bbd397902.webp) | On Mannequin                           | `fashion-apparel-on-mannequin`                         |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/39c3d0c6-a607-4b0e-85b9-c8f596526d3a.webp) | Matching surrounding                   | `fashion-apparel-matching-surrounding`                 |

### Beauty and cosmetics

| Preview                                                                                                        | Template             | `name`                                  |
| -------------------------------------------------------------------------------------------------------------- | -------------------- | --------------------------------------- |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/b7313181-2070-4ba9-8c76-dd5e70f1c6cf.webp) | Clean White Packshot | `beauty-cosmetics-clean-white-packshot` |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/90eb1b4f-54a2-4518-851f-ec92098f5722.webp) | Glossy Reflection    | `beauty-cosmetics-glossy-reflection`    |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/c074978b-ff58-448f-b246-1949266ead40.webp) | Bathroom Shelf Scene | `beauty-cosmetics-bathroom-shelf-scene` |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/02b01675-ff73-4feb-b90f-7321c6693ddd.webp) | Packaging Highlight  | `beauty-cosmetics-packaging-highlight`  |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/7ce080ea-1f71-43ac-8b24-3dbbb64a1f47.webp) | Texture Close-Up     | `beauty-cosmetics-texture-close-up`     |

### Electronics and gadgets

| Preview                                                                                                        | Template              | `name`                                      |
| -------------------------------------------------------------------------------------------------------------- | --------------------- | ------------------------------------------- |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/fe9215f2-6ebd-4a79-818d-84473d61d681.webp) | White Background Tech | `electronics-gadgets-white-background-tech` |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/af7f0f9e-8d30-4483-8c5f-f0a96e7d8794.webp) | Front & Back View     | `electronics-gadgets-front-back-view`       |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/4a6603da-75ab-4f08-af4b-bd98b1c5e44c.webp) | Slight Angle Premium  | `electronics-gadgets-slight-angle-premium`  |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/84b1a7e4-c773-41e6-bdbf-b280156d907e.webp) | Packaging Shot        | `electronics-gadgets-packaging-shot`        |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/f69ac2c5-177c-47ba-b3e0-9d739910116f.webp) | Detail Close-Up       | `electronics-gadgets-detail-close-up`       |

### Home and living

| Preview                                                                                                        | Template                   | `name`                                   |
| -------------------------------------------------------------------------------------------------------------- | -------------------------- | ---------------------------------------- |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/138445a8-34f9-40b1-9766-9c76b984396d.webp) | Minimal Interior Placement | `home-living-minimal-interior-placement` |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/94bb6a78-1d85-4591-99d7-15e6076e23b7.webp) | Clean White Background     | `home-living-clean-white-background`     |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/b833d615-078b-4955-a8c8-972840c007da.webp) | Wooden Table Lifestyle     | `home-living-wooden-table-lifestyle`     |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/9ef2ae5f-0bea-434b-ae7a-6df13a769df8.webp) | Shelf Display              | `home-living-shelf-display`              |

### Food and beverage

| Preview                                                                                                        | Template                | `name`                                  |
| -------------------------------------------------------------------------------------------------------------- | ----------------------- | --------------------------------------- |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/0a38b458-17b7-4fcd-98eb-435d384ea4f2.webp) | Clean White Packshot    | `food-beverage-clean-white-packshot`    |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/cdc9e27b-9c91-4ec3-9233-b89eb9a0aaab.webp) | Reflective Surface      | `food-beverage-reflective-surface`      |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/6a3db20a-3b27-431a-9a5e-fc3765d66290.webp) | Minimal Kitchen Setting | `food-beverage-minimal-kitchen-setting` |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/71526a49-d2f7-4b40-a4a7-33f6f8d31dd1.webp) | Packaging Focus         | `food-beverage-packaging-focus`         |

### Automotive

| Preview                                                                                                        | Template                                       | `name`                                                    |
| -------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | --------------------------------------------------------- |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/dc4715f4-878d-4700-82fd-f65cec614d96.webp) | Studio White Background (Dealer Style)         | `automotive-studio-white-background-dealer-style`         |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/50c5ea1e-a83c-4cf9-9701-d644e9fc501e.webp) | Front Three-Quarter Angle (Classic Sales Shot) | `automotive-front-three-quarter-angle-classic-sales-shot` |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/afbb45f6-46f0-45c2-8a7e-0d82c2f97aed.webp) | Side Profile Catalog View                      | `automotive-side-profile-catalog-view`                    |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/4d115f02-2a9d-4ee7-b0fc-f3ebe8edebb6.webp) | Premium Showroom Environment                   | `automotive-premium-showroom-environment`                 |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/df89d2e8-1db3-4192-a911-2bdd4700a0c9.webp) | Urban Minimal Background                       | `automotive-urban-minimal-background`                     |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/ecb2f41c-a9e7-4422-96b8-6767bf618c11.webp) | Luxury Dramatic Lighting (Premium Listing)     | `automotive-luxury-dramatic-lighting-premium-listing`     |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/3b0e20d4-928c-49da-88cb-530ab7dbf6f0.webp) | Rear Three-Quarter Angle                       | `automotive-rear-three-quarter-angle`                     |

### Main product images

| Preview                                                                                                        | Template                  | `name`                                         |
| -------------------------------------------------------------------------------------------------------------- | ------------------------- | ---------------------------------------------- |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/05d0678a-aaa4-469f-ab64-6d30d280cfb6.jpg)  | Classic White Background  | `main-product-images-classic-white-background` |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/cb303493-0ef1-4ea9-9196-010224f27053.webp) | Reflective White Surface  | `main-product-images-reflective-white-surface` |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/e85f4dd7-de4b-438c-a70c-762b9aaaa02e.jpg)  | Soft Shadow Premium Look  | `main-product-images-soft-shadow-premium-look` |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/d85ce7bf-906b-479a-b5ad-9b6e7027eb68.webp) | Front & Slight Angle View | `main-product-images-front-slight-angle-view`  |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/b953182e-c30a-4788-b375-bb9f8686ddc2.jpg)  | Product Held in Hand      | `main-product-images-product-held-in-hand`     |

### Lifestyle scenes

| Preview                                                                                                        | Template                      | `name`                                         |
| -------------------------------------------------------------------------------------------------------------- | ----------------------------- | ---------------------------------------------- |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/7585468b-6056-46f1-a661-02318a91e5de.webp) | Minimal Interior Setting      | `lifestyle-scenes-minimal-interior-setting`    |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/958252cd-cdba-49a9-80cc-25d4e7687260.webp) | Modern Desk Scene             | `lifestyle-scenes-modern-desk-scene`           |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/93bf71ce-2fe7-4150-bd06-f0dd66909d68.webp) | Bathroom Shelf (Beauty Style) | `lifestyle-scenes-bathroom-shelf-beauty-style` |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/67a46603-cb65-430f-82c0-cf1d8500d784.webp) | Soft Editorial Style          | `lifestyle-scenes-soft-editorial-style`        |

### Detail and macro

| Preview                                                                                                        | Template                 | `name`                                    |
| -------------------------------------------------------------------------------------------------------------- | ------------------------ | ----------------------------------------- |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/13453fc7-95fe-46e7-8d28-b8bf4cdf4754.webp) | Macro Detail Shot        | `detail-and-macro-macro-detail-shot`      |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/bd9e155b-a100-4b85-93a9-15bd0d5b3530.webp) | Material & Texture Focus | `detail-and-macro-material-texture-focus` |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/ea716363-7817-4cbc-8137-689871bc6bd0.webp) | Logo / Branding Detail   | `detail-and-macro-logo-branding-detail`   |

### Creative backgrounds

| Preview                                                                                                        | Template                              | `name`                                  |
| -------------------------------------------------------------------------------------------------------------- | ------------------------------------- | --------------------------------------- |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/e3259d95-4574-4946-8cc1-7e392516177a.webp) | Item on purple background             | `item on purple background`             |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/81aa9c50-432f-48f0-aba6-2ea894b3ae2c.webp) | Burst of particles                    | `burst of particles`                    |
| ![](https://neuroapi-store.s3.eu-central-1.amazonaws.com/thumbnails/7eaea311-a002-471d-a93f-befb2365ca54.jpg)  | Studio photo on white with reflection | `studio photo on white with reflection` |

### Solid-color backgrounds

| Color     | Template    | `name`                     |
| --------- | ----------- | -------------------------- |
| `#D9B3BE` | Dusty Rose  | `solid-colors-dusty-rose`  |
| `#FFFFFF` | Pure White  | `solid-colors-pure-white`  |
| `#F3F4F6` | Light Gray  | `solid-colors-light-gray`  |
| `#F8F1E7` | Warm Cream  | `solid-colors-warm-cream`  |
| `#E8D8C3` | Soft Beige  | `solid-colors-soft-beige`  |
| `#111111` | Matte Black | `solid-colors-matte-black` |
| `#2F3437` | Charcoal    | `solid-colors-charcoal`    |
| `#1F2A44` | Navy Blue   | `solid-colors-navy-blue`   |
| `#A8B8A0` | Sage Green  | `solid-colors-sage-green`  |
| `#CFE8F6` | Sky Blue    | `solid-colors-sky-blue`    |


# Denoise and sharpen

Image can be enhanced in few ways, it can be denoised and it can be sharpened (deblurred).

<table><thead><tr><th width="208.33333333333331">Enhancement</th><th>Description</th><th data-type="content-ref"></th></tr></thead><tbody><tr><td>denoise</td><td>Reduces the image noise</td><td><a href="/pages/Rb93jWgSyYWiIooO0Cnw#noise-removal">/pages/Rb93jWgSyYWiIooO0Cnw#noise-removal</a></td></tr><tr><td>deblur</td><td>Sharpen the image</td><td><a href="/pages/Rb93jWgSyYWiIooO0Cnw#out-of-focus-blur-reduction">/pages/Rb93jWgSyYWiIooO0Cnw#out-of-focus-blur-reduction</a></td></tr><tr><td>clean</td><td>Cleans the image without changing resolution</td><td></td></tr><tr><td>face_enhance</td><td></td><td><a href="/pages/zkOX3aWQfL6y9UHbVjLl">/pages/zkOX3aWQfL6y9UHbVjLl</a></td></tr><tr><td>light</td><td></td><td><a href="/pages/nnfsdpr8MiSEknGkfbRC">/pages/nnfsdpr8MiSEknGkfbRC</a></td></tr><tr><td>color</td><td></td><td><a href="/pages/nnfsdpr8MiSEknGkfbRC">/pages/nnfsdpr8MiSEknGkfbRC</a></td></tr><tr><td>white_balance</td><td></td><td><a href="/pages/7j2ddvHpDq9h8g7mZP1K">/pages/7j2ddvHpDq9h8g7mZP1K</a></td></tr></tbody></table>

Version of model for denoise or deblur can be parametrized.

There are two models: v1 and v2. v2 which is newer, handles better heavily blurry and noisy pictures. By default v1 is used.

It is not recommended to use that for good quality pictures though.

```json
"denoise_parameters": {
    "type": "v2"
}
```

```json
"deblur_parameters": {
    "type": "v2"
}
```

Let's check some examples.

<figure><img src="/files/mpv9mP8AfCcE02NK5vV4" alt=""><figcaption></figcaption></figure>

#### Noise removal

```json
{
    "enhancements": ["denoise"],
    "denoise_parameters": {
        "type": "v2"
    }
}
```

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

```
curl --request POST \
     --url https://deep-image.ai/rest_api/process_result \
     --header 'content-type: application/json' \
     --header 'x-api-key: API_KEY' \
     --data '{
         "url": "https://deep-image.ai/api-example.png",
         "enhancements": ["denoise"],
         "denoise_parameters": {
           "type": "v2"
         }
      }'
```

{% endtab %}

{% tab title="Python client" %}

```python
import os

import deep_image_ai_client

configuration = deep_image_ai_client.Configuration(
    host="https://deep-image.ai"
)

configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

with deep_image_ai_client.ApiClient(configuration) as api_client:
    api_instance = deep_image_ai_client.DefaultApi(api_client)
    process_payload = {"url": "https://deep-image.ai/api-example.jpg", "enhancements": ["denoise"],
                       "denoise_parameters": {
                           "type": "v2"
                       }}
    api_response = api_instance.rest_api_process_result_post(process_payload)

```

{% endtab %}
{% endtabs %}

<figure><img src="/files/E2FMPcrupLydCUVSnSiA" alt=""><figcaption></figcaption></figure>

#### Out of focus blur reduction

We can also make sharper blurry image like this:

<figure><img src="/files/ltELoFTcwz4ABmPKNiz0" alt=""><figcaption></figcaption></figure>

```json
{
    "enhancements": ["deblur"]
}
```

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

```
curl --request POST \
     --url https://deep-image.ai/rest_api/process_result \
     --header 'content-type: application/json' \
     --header 'x-api-key: API_KEY' \
     --data '{
         "url": "https://deep-image.ai/api-example.png",
         "enhancements": ["deblur"]
      }'
```

{% endtab %}

{% tab title="Python client" %}

```python
import os

import deep_image_ai_client

configuration = deep_image_ai_client.Configuration(
    host="https://deep-image.ai"
)

configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

with deep_image_ai_client.ApiClient(configuration) as api_client:
    api_instance = deep_image_ai_client.DefaultApi(api_client)
    process_payload = {"url": "https://deep-image.ai/api-example.jpg", "enhancements": ["deblur"]}
    api_response = api_instance.rest_api_process_result_post(process_payload)

```

{% endtab %}
{% endtabs %}

<figure><img src="/files/R5IYU4Ec6BCdxTNNxRlt" alt=""><figcaption></figcaption></figure>

&#x20;Those two options can be specified together.

Let's check the results on that image:

<figure><img src="/files/bMtrxmf0Vxa5qf6otxXp" alt=""><figcaption></figcaption></figure>

```json
{
    "enhancements": ["deblur", "denoise"]
}
```

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

```
curl --request POST \
     --url https://deep-image.ai/rest_api/process_result \
     --header 'content-type: application/json' \
     --header 'x-api-key: API_KEY' \
     --data '{
         "url": "https://deep-image.ai/api-example.png",
         "enhancements": ["deblur", "denoise"]
      }'
```

{% endtab %}

{% tab title="Python client" %}

```python
import os

import deep_image_ai_client

configuration = deep_image_ai_client.Configuration(
    host="https://deep-image.ai"
)

configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

with deep_image_ai_client.ApiClient(configuration) as api_client:
    api_instance = deep_image_ai_client.DefaultApi(api_client)
    process_payload = {"url": "https://deep-image.ai/api-example.jpg", "enhancements": ["deblur", "denoise"]}
    api_response = api_instance.rest_api_process_result_post(process_payload)

```

{% endtab %}
{% endtabs %}

<figure><img src="/files/zgn4uWWIKSnjp2iGLboZ" alt=""><figcaption></figcaption></figure>

#### Cleaning the image

Image can also be "cleaned" from artifacts and previously poorly upscaled image.

```json
"enhancements": ["clean"]
```

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

```
curl --request POST \
     --url https://deep-image.ai/rest_api/process_result \
     --header 'content-type: application/json' \
     --header 'x-api-key: API_KEY' \
     --data '{
         "url": "https://deep-image.ai/api-example.png",
         "enhancements": ["clean"]
      }'
```

{% endtab %}

{% tab title="Python client" %}

```python
import os

import deep_image_ai_client

configuration = deep_image_ai_client.Configuration(
    host="https://deep-image.ai"
)

configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

with deep_image_ai_client.ApiClient(configuration) as api_client:
    api_instance = deep_image_ai_client.DefaultApi(api_client)
    process_payload = {"url": "https://deep-image.ai/api-example.jpg", "enhancements": ["clean"]}
    api_response = api_instance.rest_api_process_result_post(process_payload)

```

{% endtab %}
{% endtabs %}

Resolution of the image remains the same but image should be in better quality.


# Enhance lighting and colors

Image lighting, colors and contrast can be also enhanced. It can be done with 3 types of enhancements: light, color and white\_balance.

```json
{
    "enhancements": ["light", "color", "white_balance", "exposure_correction"]
}
```

Those types of enhancements can be parametrized further.

```json
    "light_parameters": {
        "type": "contrast", // "hdr_light" | "hdr_light_advanced"
        "level": 0.8
    },

    "color_parameters": {
        "type": "contrast", // "hdr_light" | "hdr_light_advanced",
        "level": 0.8
    },

    "white_balance_parameters": {
        "level": 0.8
    }
```

### Types of light and colors algorithms

Let's check the various combinations of light algorithms enhancements.

Our input image:

<figure><img src="/files/A7bhLlwGuTBX9QUoMLeP" alt=""><figcaption></figcaption></figure>

The results of 3 light enhancement types.

{% tabs %}
{% tab title="hdr\_light\_andvanced" %}

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "enhancements": ["light"],
    "light_parameters": {
        "type": "hdr_light_advanced",
        "level": 1
    }
}
```

<figure><img src="/files/axoKlnI79qNAiFFHzYxS" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="hdr\_light" %}

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "enhancements": ["light"],
    "light_parameters": {
        "type": "hdr_light",
        "level": 1
    }
}
```

<figure><img src="/files/Ihyz9Za7ueZbZ9WLQrjy" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="contrast" %}

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "enhancements": ["light"],
    "light_parameters": {
        "type": "contrast",
        "level": 1
    }
}
```

<figure><img src="/files/vTjWXXnRN6MZa450TJWa" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

The input image which is little bit desaturated.

<figure><img src="/files/Wgntku2xhbZ3lIxBn5pn" alt=""><figcaption></figcaption></figure>

The results of color enhancements

{% tabs %}
{% tab title="hdr\_light\_andvanced" %}

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "enhancements": ["color"],
    "color_parameters": {
        "type": "hdr_light_advanced",
        "level": 1
    }
}
```

<figure><img src="/files/HcPGrzSg7AqnQSmCIQ8o" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="hdr\_light" %}

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "enhancements": ["color"],
    "color_parameters": {
        "type": "hdr_light",
        "level": 1
    }
}
```

<figure><img src="/files/cPzYiOcGbarNkBv36ueT" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="contrast" %}

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "enhancements": ["color"],
    "color_parameters": {
        "type": "contrast",
        "level": 1
    }
}
```

<figure><img src="/files/FuPdV0E3nQvzKmgka2rD" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

Combining all together.

{% tabs %}
{% tab title="hdr\_light\_andvanced" %}

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "enhancements": ["light","color"],
    "light_parameters": {
        "type": "hdr_light_advanced",
        "level": 1
    },
    "color_parameters": {
        "type": "hdr_light_advanced",
        "level": 1
    }
}
```

<figure><img src="/files/PxLnonk8ZvkeCPCjmXtn" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="hdr\_light" %}

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "enhancements": ["light","color"],
    "light_parameters": {
        "type": "hdr_light",
        "level": 1
    },
    "color_parameters": {
        "type": "hdr_light",
        "level": 1
    }
}
```

<figure><img src="/files/LsQjqGplAoXjaXVV6TDq" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="contrast" %}

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "enhancements": ["light","color"],
    "light_parameters": {
        "type": "contrast",
        "level": 1
    },
    "color_parameters": {
        "type": "contrast",
        "level": 1
    }
}
```

<figure><img src="/files/vyVRN5YUeoXb2sSbqFiw" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

### White balance correction

White balance can be also automatically fixed if it went wrong with camera's settings.

<figure><img src="/files/gZ0W71qIUpCciwBBgOoF" alt=""><figcaption></figcaption></figure>

```json
{
    "enhancements": ["white_balance"]
}
```

<figure><img src="/files/A1RSSOvxfZUCO7AIWpDB" alt=""><figcaption></figcaption></figure>

### Exposure correction

Exposure can be corrected with "**exposure\_correction**" enhancement type. This algorithm works different than previous "**light**" enhancement. It corrects image globally with amending its with gamma correction.

```json
    "enhancements": ["exposure_correction"]
```

<figure><img src="/files/elyfclNSKzEjMVONwB9I" alt=""><figcaption><p><a href="https://deep-image.ai/api-example3.jpg">https://deep-image.ai/api-example3.jpg</a> exposure corrected</p></figcaption></figure>


# Enhance face details

Enhancing face details is needed when image is rather small or is heavily distorted with noise, compression artefacts or is blurred.

Face enhancement can be done when adding "face\_enhance" option to enhancements.

Type of the face enhancement can be selected by setting **face\_enhance\_parameters:type** parameter

```
"enhancements": ["face_enhance"],
"face_enhance_parameters": {
    "type": "beautify-real",
    "level": 0.8,
    "smoothing_level": 0.1
}
```

| Parameter       | Description                                                                   |
| --------------- | ----------------------------------------------------------------------------- |
| type            | Face enhancing algorithm, described below.                                    |
| level           | Level of face enhancement, values from 0.0 to 1.0. Default is 1.0 - 100%      |
| smothing\_level | Additional skin smoothing filter, values from 0.0 to 1.0. Default is 0.0 - 0% |

| type          | description                                                                                                                                                    |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| beautify-real | Enhances face in 2048x2048 resolution, suitable for higher resolution photos effect - real looking skin, no compression/diffusion artifacts. **Default value** |
| beautify      | Enhances face in 512x512 resolution, suitable for beautify effect - smooth skin, no visible artifacts, low resolution though.                                  |

Let's check the examples. Type beautify.

<figure><img src="/files/b8Tmxak9QNWqgrPRKy84" alt=""><figcaption><p>Input image</p></figcaption></figure>

<figure><img src="/files/u54HE21vUdYFnL3XIPro" alt=""><figcaption><p>Upscaled 4x with face_enhance option</p></figcaption></figure>

<figure><img src="/files/vZnhQrq4shKBj7Zlsf0B" alt=""><figcaption><p>Upscaled 4x without face_enhance option</p></figcaption></figure>

Let's correct generated image with 'beautify-real' type.

<figure><img src="/files/kUTPZZ8XdMwiQInnIcnP" alt=""><figcaption><p>Generated face</p></figcaption></figure>

<figure><img src="/files/ZrdAyg9jcow7OTO6LoZN" alt=""><figcaption><p>Face enhancement - beautify-real</p></figcaption></figure>

<figure><img src="/files/GhpGZNTPHPHE4L2ZHJou" alt=""><figcaption><p>Face enhancement - beautify</p></figcaption></figure>


# Background removal and generation

Use `background.remove` to cut out the main subject.

You can keep transparency, apply a flat color, replace the background, or generate a new one.

### Background removal

```json
{
    "background": {
        "remove": "auto",
        "color": "#FFFFFF"
    }
}
```

#### Parameters

| Parameter | Description                                                                                                 |
| --------- | ----------------------------------------------------------------------------------------------------------- |
| `remove`  | Controls the background removal mode. Supported values are `auto`, `v2`, `human`, `item`, and `generative`. |
| `prompt`  | Text instruction used with `remove: "generative"`. Describe what should stay in the foreground.             |
| `color`   | Controls the output background color. Use `auto`, a hex color like `#FFFFFF`, or `transparent`.             |
| `replace` | URL of a background image for simple replacement. This does not generate new shadows or reflections.        |

`auto` is the default mode.

Use `human` for portraits.

Use `item` for products and objects.

Use `generative` when the image has multiple relevant foreground elements and you want the prompt to guide what stays.

Let's check some examples.

<figure><img src="/files/4d4lcIVAUK2RoE4M3JtT" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Click the result image to compare it with the source.
{% endhint %}

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

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "background": {
        "remove": "auto",
        "color": "transparent"
    }
}
```

{% endtab %}

{% tab title="white" %}

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "background": {
        "remove": "item",
        "color": "#FFFFFF"
    }
}
```

<figure><img src="/files/h4lRJPRBOeV32EHegOMu" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="replace" %}

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "background": {
        "remove": "auto",
        "replace": "https://images.pexels.com/photos/628281/pexels-photo-628281.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1"
    }
}
```

<figure><img src="/files/G5t062WeBPZLbP0h19wB" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

<figure><img src="/files/BY1e6CasVwcKcsE9Cs0J" alt=""><figcaption></figcaption></figure>

### Prompt-based background removal

Use prompt-based removal when `auto` keeps too much, removes too much, or misses related foreground objects.

Keep the prompt short and focused on what should remain.

```json
{
    "background": {
        "remove": "generative",
        "prompt": "keep relevant foreground, keep relevant objects"
    }
}
```

You can combine this with `color` or `replace` when you do not want a transparent result.

For image preparation tips, see [Remove BG recommendation](/image-processing/background-removal-and-generation/remove-bg-recommendation).

### Item cropping

You can combine background removal, padding, and item crop to center a subject inside a fixed canvas.

```json
{
    "url": "https://deep-image.ai/api-example2.jpg",
    "width": 1000,
    "height": 1000,
    "fit": {
         "crop": "item"
    },
    "background": {
        "remove": "auto",
        "color": "#FFFFFF"
    },
    "padding": 100
}
```

<figure><img src="/files/rwHzQg3xVg5IuwBt3DGN" alt=""><figcaption><p>Result</p></figcaption></figure>

### Background generation

Background generation improves product photos without a manual photo shoot.

It removes the original background, places the subject on the canvas, and generates a new scene around it.

#### Parameters

| Parameter              | Description                                                                                                             |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `description`          | Text prompt describing the scene.                                                                                       |
| `item_area_percentage` | Float from `0` to `1` that controls how much of the final image the item occupies. `0.85` means 85%.                    |
| `sample_num`           | Random seed for the generated image. If you omit it, results vary between runs.                                         |
| `color`                | Converts the generated background to black and white, then tints it with the given RGB array. Example: `[255,255,255]`. |
| `background_url`       | URL of an image blended with the generated background for more consistent outputs.                                      |

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "background": {
        "generate": {
            "description": "item standing on sand with beach in background",
            "item_area_percentage": 0.65,
            "sample_num": 12663
        }
    }
}
```

<figure><img src="/files/IGgoFJy1ZX4XQFjBrUMf" alt=""><figcaption></figcaption></figure>

Without `sample_num`:

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "background": {
        "generate": {
            "description": "item standing on sand with beach in background",
            "item_area_percentage": 0.65
        }
    }
}
```

<figure><img src="/files/ej8AsuUuMgWLFVbWrzUI" alt=""><figcaption></figcaption></figure>

You can also set the output size:

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 1000,
    "height": 1000,
    "background": {
        "generate": {
            "description": "item standing on sand with beach in background",
            "item_area_percentage": 0.65
        }
    }
}
```

<figure><img src="/files/8EBrGXS2ezXviOWpbkN9" alt=""><figcaption></figcaption></figure>

When specifying a color:

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 1000,
    "height": 1000,
    "background": {
        "generate": {
            "description": "item positioned on plain white background",
            "item_area_percentage": 0.65,
            "color": [217,179,190]
        }
    }
}
```

<figure><img src="/files/qPu83rU6vL1zGJmZ6uUf" alt=""><figcaption></figcaption></figure>


# Remove BG recommendation

Best practices to prepare a photo for background removal

### **Contrast**

High contrast between foreground and background gives better results than low contrast. It is worth ensuring that the photos are taken in good lighting conditions.

<figure><img src="/files/r7ZjzFnPmjdhiD2XAuBf" alt=""><figcaption></figcaption></figure>

### **Prefer plain backgrounds**

Backgrounds with a single-color are easier to remove than backgrounds with many details.

<figure><img src="/files/QJ1wrXfWzrXk6Bp7RFqT" alt=""><figcaption></figcaption></figure>

### **Sharp foreground**

The foreground should be sharp and the edges of the objects should be clear, otherwise, the out-of-focus parts may be removed. If only the edges are blurred, they will still be blurred in the cutout, which may or may not be a problem.

<figure><img src="/files/HIBlmAdsLeklcEgVemUK" alt=""><figcaption></figcaption></figure>

### **Objects**

Objects held in the hands or worn on the body are usually supported, while large protruding objects can be problematic and may be removed.

<figure><img src="/files/KVFqw4eyJo50dUnlDYev" alt=""><figcaption></figcaption></figure>

## Recommendations for product photos and other objects

### **Whole object**

It's important that the entire product be visible in the photo, this means it can't be cut off, obscure&#x64;**,** or shaded.

<figure><img src="/files/27JtmqU9P7xWQRKPCj9g" alt=""><figcaption></figcaption></figure>

### **Object in focus**

Place the subject in front of a smooth, uniform background (photo studio, wall, floor). This will give you a good indication of the shape of the object to be cut out.

<figure><img src="/files/JmSoxvSylXUzCwubFv2y" alt=""><figcaption></figcaption></figure>

### **Shadows and reflections**

Try to avoid shadows and reflections because they can be mistaken for part of the foreground. This will result in a wrong definition of the object's shape.

<figure><img src="/files/fHoFogrqHN3HTzkF2Rgw" alt=""><figcaption></figcaption></figure>


# Image generation

## Background/generate parameters

Let's see all the parameters of background generate section that can be used in image generation API. They will be described in detail down below.

<table><thead><tr><th width="270">Field name</th><th>Description</th></tr></thead><tbody><tr><td>model_type</td><td><p>This parameter chooses model which will be used for image generation, realistic is the default one:</p><ul><li>gemini-3-pro-image-preview</li><li>see-dream-4.5</li><li>qwen</li><li>flux2-klein9b</li><li>z-image-turbo</li><li>realistic</li><li>fantasy</li><li>premium</li><li>google-gemini-image-flash</li></ul></td></tr><tr><td>description</td><td>Generation prompt. By default "high quality, highly detailed, 8K" phrase is added to it.</td></tr><tr><td>sample_num</td><td>Works like generator random seed.</td></tr><tr><td>adapter_type</td><td><p>This parameter controls how generator will use the input image.</p><ul><li><strong>generate_background -</strong> (default value) background is generated around the main object found in the input image</li><li><strong>face</strong> - generator will use first found face of the input image to create an avatar</li><li><strong>control</strong> - (also known as "image to image") generator will generate image based on image and image edges, it's useful for adding details to existing photos, f.e. adding furniture to empty room</li><li><strong>control2</strong> - generator will generate image based only on image edges, it's useful for generating images from drawings</li><li><strong>upscale</strong> - used for specifying prompts for generative upscale</li><li><strong>inpainting</strong> - described in <a href="/pages/9u6p1oSHO6k6sYsvsLvj">separated chapter</a> </li></ul></td></tr><tr><td>face_id</td><td>true/false - Works only when adapter_type is face. Selects different face generation algorithm when just face details are used (skips for example hair style from original photo).</td></tr><tr><td>controlnet_conditioning_scale</td><td>Float value from 0 to 1 describes how much edges will be preserved. Default value is 0.5</td></tr></tbody></table>

Let's check some examples.

## Based on text only

Image can be generated based on text prompt in given resolution.

```json
{
    "width": 2048,
    "height": 1024,
    "background": {
        "generate": {
            "description": "woman in a futuristic suit holding a gun in her hand, looking at the camera, cyberpunk art, neo-figurative, anime"
        }
    }
}
```

And the result:

<figure><img src="/files/Q8hfuoOSjrbWmxYE5IaH" alt=""><figcaption></figcaption></figure>

Now, the same prompt but with **fantasy** model:

```json
{
    "width": 2048,
    "height": 1024,
    "background": {
        "generate": {
            "description": "woman in a futuristic suit holding a gun in her hand, looking at the camera, cyberpunk art, neo-figurative, anime",
            "model_type": "fantasy"
        }
    }
}
```

<figure><img src="/files/xlPT2d9QOLGg5UyfINqx" alt=""><figcaption></figcaption></figure>

Now, the same prompt but with **premium** model:

```json
{
    "width": 2048,
    "height": 1024,
    "background": {
        "generate": {
            "description": "woman in a futuristic suit holding a gun in her hand, looking at the camera, cyberpunk art, neo-figurative, anime",
            "model_type": "premium"
        }
    }
}
```

<figure><img src="/files/mjuoGGSLegd1DgCBM8VH" alt=""><figcaption></figcaption></figure>

## Based on image

Images can be generated based on face details or image canny edges.

Let's check some examples.

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 1024,
    "height": 1024,
    "background": {
        "generate": {
            "description": "item on the beach",
            "adapter_type": "generate_background"
        }
    }
}
```

And the result

<figure><img src="/files/HzkeMNaCShSolieHcHps" alt="" width="563"><figcaption></figcaption></figure>

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "width": 1024,
    "height": 1024,
    "background": {
        "generate": {
            "description": "model on the beach",
            "adapter_type": "face"
        }
    }
}
```

And the result

<figure><img src="/files/yeBLrUffrn5rfsqZ9mj8" alt="" width="563"><figcaption></figcaption></figure>

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "background": {
        "generate": {
            "description": "model in the room",
            "adapter_type": "control"
        }
    }
}
```

And the result

<figure><img src="/files/I2nqo7dGst4wg9lxKWWq" alt=""><figcaption></figcaption></figure>

## Generative upscaling

Let's try to use generative upscaling. This algorithm can do some real magic :slight\_smile:. It also modifies image slightly because it's based on diffusion algorithm so do not use it when you really want to preserve exact image colors and original image details.

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 3000,
    "generative_upscale": true
}
```

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

```
curl --request POST \
     --url https://deep-image.ai/rest_api/process_result \
     --header 'content-type: application/json' \
     --header 'x-api-key: API_KEY' \
     --data '{
         "url": "https://deep-image.ai/api-example.png",
         "width": 3000,
         "generative_upscale": true
      }'
```

{% endtab %}

{% tab title="Python client" %}

```python
import os

import deep_image_ai_client

configuration = deep_image_ai_client.Configuration(
    host="https://deep-image.ai"
)

configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

with deep_image_ai_client.ApiClient(configuration) as api_client:
    api_instance = deep_image_ai_client.DefaultApi(api_client)
    process_payload = {"url": "https://deep-image.ai/api-example.jpg", "width": 3000, generative_upscale: True}
    api_response = api_instance.rest_api_process_result_post(process_payload)

```

{% endtab %}
{% endtabs %}

And the result:

<figure><img src="/files/sF1XWGQYkdYOF3OsN9cE" alt=""><figcaption><p>Generative upscale result</p></figcaption></figure>


# Advanced model types for image generation

The `premium` model type elevates image generation by providing advanced features that are unattainable with other model types. It excels in producing images with correctly rendered captions and is capable of adjusting object lighting dynamically in response to background changes, enhancing the overall realism of generated images. Below is an example of how to use the `premium` model to achieve these effects:

{% code overflow="wrap" %}

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 1024,
    "height": 1024,
    "background": {
        "generate": {
            "description": "item half-buried in the sand on a beach, with ocean waves crashing against it. The setting is moody and atmospheric, with wet sand, sea foam, and a cloudy sky. The object is partially exposed, hinting at its full form hidden beneath the surface.",
            "adapter_type": "generate_background",
            "model_type": "premium"
        }
    }
}
```

{% endcode %}

<figure><img src="/files/BnEtjtHfOBNmwInJIj9j" alt=""><figcaption></figcaption></figure>

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 1024,
    "height": 1024,
    "background": {
        "generate": {
            "description": "item half-buried in the sand on a beach, with ocean waves crashing against it. The setting is moody and atmospheric, with wet sand, sea foam, and a cloudy sky. The object is partially exposed, hinting at its full form hidden beneath the surface.",
            "adapter_type": "generate_background",
            "model_type": "qwen"
        }
    }
}
```

<figure><img src="/files/D50BGEbxaf0y9SmzPWf2" alt=""><figcaption></figcaption></figure>

Plain generation example:

{% code overflow="wrap" %}

```json
{
    "width": 1024,
    "height": 1024,
    "background": {
        "generate": {
            "description": "A weathered wooden sign on a beach, half-buried in the sand, with waves crashing nearby. The sign has the word 'DANGER' written in bold red letters, partially faded by time and saltwater. The sky is overcast, and sea spray is in the air. Debris and seaweed surround the sign, enhancing the abandoned, ominous mood.",
            "model_type": "premium"
        }
    }
}
```

{% endcode %}

<figure><img src="/files/5LqmRIdTHn0bnot3nMG5" alt=""><figcaption></figcaption></figure>

and for qwen model:

<figure><img src="/files/mkz5TzNeJNmePfbikIGA" alt=""><figcaption></figcaption></figure>

Avatars can be customized using the premium model to add unique features that enhance their visual appeal and character. The premium model offers higher quality outputs, providing detailed textures and lifelike appearances. For instance, by describing specific elements, such as facial expressions or attire, users can generate avatars that align perfectly with their creative vision. This level of customization is particularly beneficial for projects requiring a distinct and engaging character presence.

{% code overflow="wrap" %}

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "width": 1024,
    "height": 1024,
    "background": {
        "generate": {
            "description": "Portrait, half-body photo of the elegant beautiful bride in a wedding dress as she poses outside a charming church. Bride is laughing.",
            "adapter_type": "face",
            "model_type": "premium"
        }
    }
}
```

{% endcode %}

<figure><img src="/files/kqGrnD39xbeF1q8shi03" alt=""><figcaption></figcaption></figure>

For qwen model:

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "width": 1024,
    "height": 1024,
    "background": {
        "generate": {
            "description": "Portrait, half-body photo of the elegant beautiful bride in a wedding dress as she poses outside a charming church. Bride is laughing.",
            "adapter_type": "face",
            "model_type": "qwen"
        }
    }
}
```

<figure><img src="/files/2u62tDzBHM8PHNYsT4li" alt=""><figcaption></figcaption></figure>

and google-gemini-image-flash (aka Nanobanana):

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "width": 1024,
    "height": 1024,
    "background": {
        "generate": {
            "description": "Portrait, half-body photo of the elegant beautiful bride in a wedding dress as she poses outside a charming church. Bride is laughing.",
            "adapter_type": "face",
            "model_type": "google-gemini-image-flash"
        }
    }
}
```

<figure><img src="/files/fgVNYIgaoyVFR8fdwt5Y" alt=""><figcaption></figcaption></figure>


# Inpainting and outpainting (uncrop)

## Inpainting

Inpainting is a technique used in image processing to fill in missing or damaged parts of an image in a way that blends seamlessly with the surrounding areas. This process can reconstruct removed elements or extend the background of an image while preserving the visual coherence of textures, colors, and patterns.

Inpainting is a part of background generation parameters

| Parameter     | Description       |
| ------------- | ----------------- |
| adapter\_type | inpainting        |
| ip\_image2    | url to mask image |

Let's check the example. There is a generated image with some hand issues:

<figure><img src="/files/QHrseatyhRmQvNMfJ27E" alt=""><figcaption></figcaption></figure>

Quickly created mask:

<figure><img src="/files/563EVW0qMIpdw3wtVE5R" alt=""><figcaption></figcaption></figure>

```json
{
    "url": "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/inpainting-example.png",
    "background": {
        "generate": {
            "description": "hands touching surfing board",
            "adapter_type": "inpainting",
            "ip_image2": "https://s3.eu-central-1.amazonaws.com/deep-image.ai/api-examples/inpainting-example-mask4.png",
            "controlnet_conditioning_scale": 0.5
        }
    }
}
```

And the result:

<figure><img src="/files/EJky7nApeo0vuYKQsEvq" alt=""><figcaption></figcaption></figure>

## Outpainting (uncrop)

Outpainting, or "uncropping," is a technique used to expand an image beyond its original borders by generating new visual content that seamlessly extends the existing scene. Unlike inpainting, which fills in missing areas within an image, outpainting creatively imagines what might lie beyond the current frame, effectively "uncropping" it to add context or detail.

Let's make a horizontal image of the vertical one.

<figure><img src="/files/MlIHPDR2tRRjuvnvpL7b" alt=""><figcaption></figcaption></figure>

```json
{
    "url": "https://deep-image.ai/api-example2.jpg",
    "width": 2000,
    "height": 1000,
    "fit": {
        "canvas": "outpainting"
    }
}
```

And the result:

<figure><img src="/files/CNqYgs9GgH5DYxjoJEHz" alt=""><figcaption></figcaption></figure>

Prompt or image description is generated by default so for this particular example is: "there is a boat that is sitting on the sand near a building".

Additional outpainting parameters:

| Parameter                        | Description                                                                                                                                                                                                          |
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `background.generate.model_type` | Controls the outpainting model. Supported values are `qwen` and `qwen-no-blending`. The default is `qwen`. `qwen-no-blending` works like `qwen`, but it does not blend the original image over the generated result. |
| `placement`                      | Controls where the source image is placed on the destination canvas before outpainting starts.                                                                                                                       |
| `placement.coordinates`          | X and Y coordinates of the placed source image on the destination canvas.                                                                                                                                            |
| `placement.width`                | Width of the placed source image area.                                                                                                                                                                               |
| `placement.height`               | Height of the placed source image area.                                                                                                                                                                              |
| `placement.rotation`             | Rotation of the placed source image.                                                                                                                                                                                 |
| `placement.fit`                  | Controls whether the source image is fitted to the placement box.                                                                                                                                                    |

We can use our prompt as well:

```json
{
    "url": "https://deep-image.ai/api-example2.jpg",
    "width": 2000,
    "height": 1000,
    "fit": {
        "canvas": "outpainting"
    },
    "background": {
        "generate": {
            "adapter_type": "upscale",
            "description": "Boat on Mars with spaceships around."
        }
    }
}
```

And the result:

<figure><img src="/files/WoHrGA5J1CWbJly5O2LQ" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
`generative_upscale` applies diffusion-based upscaling to the final image. It can improve detail, but it can also slightly change the original source image. Keep it `false` when you want to preserve the source area more closely.
{% endhint %}

We can also place the source image manually and select the outpainting model:

```json
{
    "width": 3434,
    "height": 2074,
    "background": {
        "generate": {
            "description": "high quality",
            "model_type": "qwen-no-blending",
            "adapter_type": "upscale"
        }
    },
    "generative_upscale": false,
    "placement": {
        "coordinates": [
            1717,
            1037
        ],
        "width": 880,
        "height": 1244,
        "rotation": 0,
        "fit": false
    },
    "image_app": "tool_uncrop",
    "fit": {
        "canvas": "outpainting"
    },
    "url": "https://deep-image.ai/api-example2.jpg"
}
```

Let's see an example. It's generative upscaled with blending of original image:

<figure><img src="/files/WtUP61GxGBoD7zUWi7IG" alt=""><figcaption></figcaption></figure>

And the result:

<figure><img src="/files/NF5dm1RqMfNJiFVqcEDi" alt=""><figcaption></figcaption></figure>


# Frame identification

When using the "content" [crop](/image-processing/resize-and-padding#types-of-crop) fit type, the image content is analysed for better cropping result, f.e. to reduce the possibility of cutting objects on the photo.

<figure><img src="/files/OTuQXrsS1XLJ4014gAvd" alt=""><figcaption></figcaption></figure>

Identified object will be put inside desired size that has vertical proportions (1000x1500). Remaining background will be filled with black color which has been automatically found.

```json
{
    "width": 1000,
    "height": 1500,
    "fit": {
        "crop": "content"
    }
}
```

<figure><img src="/files/yx9jK5CSoMouQKmLrOX2" alt=""><figcaption></figcaption></figure>


# Print

Deep Image API supports optimizing image resolution for specific paper size.

Let's check the example:

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "print_size": "A5",
    "dpi": 150
}
```

A5 paper size is 5.83 x 8.27 inches. Our api-example.png has 640x427 pixels.

DPI 150 means that image has to have at least 150 points/pixels per inch so image will be upscaled to 874x1240 pixels.

{% hint style="info" %}
By default desired width and height values are reoriented to match print size orientation.
{% endhint %}

<figure><img src="/files/dA5jxrQJ8PpnuhCfwkfJ" alt=""><figcaption><p>Result is 1240x874 pixels</p></figcaption></figure>

<table><thead><tr><th width="226">Parameter name</th><th>Description</th></tr></thead><tbody><tr><td>print_size</td><td>Name of the paper size format, f.e. A4, B0, letter, etc.</td></tr><tr><td>dpi</td><td>Integer value for DPI - <strong>300 by default</strong></td></tr><tr><td>print_reorientation</td><td>true/false - swap target width and height values to match paper size orientation. <strong>true by default</strong></td></tr></tbody></table>


# Captions

With "caption" parameter any image can be added as a caption to result image.

```json
{
    "url": "https://deep-image.ai/api-example.png",
    "width": 600,
    "output_format": "jpg",
    "caption": {
        "url": "http://ain.teonite.net/neuroapi-store/2023-02-07/d9a91e2e-9843-4d85-ae1a-e7baefc87746.png",
        "position": "RB",
        "target_width_percentage": 25,
        "padding": 20,
        "opacity": 85
    }
}
```

Caption can has several options:

<table><thead><tr><th width="287">Parameter name</th><th>Description</th></tr></thead><tbody><tr><td>url</td><td>(<strong>required</strong>) - url to the caption image</td></tr><tr><td>position</td><td>(<strong>RB by default</strong>) - position of the caption expressed as two letters - LT, MT, RT, ML, MM, MR, BL, BM, BR (L - left, M - middle, R - right, B - bottom, T - top)</td></tr><tr><td>target_width_percentage</td><td>(<strong>25 by default</strong>) - size of the captioning expressed as percentage of width of destination image</td></tr><tr><td>padding</td><td>(<strong>5% of width by default</strong>) - space in pixels between image borders and the captioning</td></tr><tr><td>opacity</td><td>(<strong>100 by default</strong>) - opacity of the captioning from 0 to 100</td></tr></tbody></table>

The result of example image with added "Deep image" caption"

<figure><img src="/files/wUe8y5hSJ4eLCgTNASxh" alt=""><figcaption><p>Caption result</p></figcaption></figure>


# Additional parameters

There are also parameters that controls level of jpeg compression and output image format.

<table><thead><tr><th width="251">Parameter name</th><th>Description</th></tr></thead><tbody><tr><td>quality</td><td>Integer value for the level of jpeg or webp compression.</td></tr><tr><td>output_format</td><td>The format of the output image:<br><br>- jpeg<br>- png<br>- webp</td></tr><tr><td>max_file_size</td><td>Integer or string value with maximum file size.<br>It supports "<strong>kb</strong>", "<strong>mb</strong>" and "<strong>gb</strong>" units.<br>It is used with output_format equals jpeg or webp. When specified, Deep Image API tries to match highest possible jpeg quality and specified <strong>max_file_size</strong>.</td></tr><tr><td>safe</td><td>Boolean value that turns on NSFW filtering.</td></tr><tr><td>nsfw_parameters</td><td>Configuration of safe filter:<br>- threshold (0-1 float value)<br>- nsfw_image_url (optional image url returned when threshold is exceeded)</td></tr></tbody></table>

Output format, quality and max file size example:

```json
{
    "url": "image_url",
    "width": 1000,
    "height": 1000,
    "output_format": "jpeg",
    "quality": 85,
    "max_file_size": "1MB"
}
```

Safe filter example:

```json
{
    "url": "https://deep-image.ai/api-example3.jpg",
    "safe": true,
    "nsfw_parameters": {
        "thresold": 0.0,
        "image_url": "https://deep-image.ai/api-example2.jpg"
    }
}
```

This will return image specified in nsfw\_parameters.image\_url because safe filter threshold has been set to 0 (always fail)


# Presets

To simplify image enhancements preset parameter can be used.

```json
{
    "url": "image_url",
    "preset": "real_estate"
}
```

## Preset description

<table><thead><tr><th width="298">Preset name</th><th>Description</th></tr></thead><tbody><tr><td>auto_enhance</td><td><pre class="language-json"><code class="lang-json">{
      "max_length": 4096,
      "enhancements": [
        "denoise",
        "face_enhance",
        "deblur",
        "color",
        "light",
        "white_balance",
        "exposure_correction"
      ],
      "light_parameters": {
        "type": "hdr_light_advanced",
        "level": 1.0
      },
      "color_parameters": {
        "type": "hdr_light",
        "level": 0.85
      },
      "white_balance_parameters": {
        "level": 0.5
      },
      "deblur_parameters": {
        "type": "v2"
      },
      "denoise_parameters": {
        "type": "v2"
      },
      "background": {
        "generate": {
          "description": "high quality",
          "adapter_type": "upscale"
        }
    }
}
</code></pre></td></tr><tr><td>real_estate</td><td><ul><li>enhancements: ["light", "color"]</li></ul></td></tr><tr><td>real_estate_upscaled</td><td><ul><li>enhancements: ["light", "color"]</li><li>width: "200%"</li></ul></td></tr><tr><td>ecommerce</td><td><ul><li>enhancements: ["light", "color"]</li></ul></td></tr><tr><td>ecommerce_upscaled</td><td><ul><li>enhancements: ["light", "color"]</li><li>width: 2048</li></ul></td></tr><tr><td>auto_enhance_generative</td><td><pre class="language-json"><code class="lang-json">{
      "max_length": 4096,
      "enhancements": [
        "denoise",
        "face_enhance",
        "deblur",
        "color",
        "light",
        "white_balance",
        "exposure_correction"
      ],
      "light_parameters": {
        "type": "hdr_light_advanced",
        "level": 1.0
      },
      "color_parameters": {
        "type": "hdr_light",
        "level": 0.85
      },
      "white_balance_parameters": {
        "level": 0.5
      },
      "deblur_parameters": {
        "type": "v2"
      },
      "denoise_parameters": {
        "type": "v2"
      },
      "background": {
        "generate": {
          "description": "high quality",
          "adapter_type": "upscale"
        }
    },
    "generative_upscale": true
}
</code></pre></td></tr></tbody></table>


# Account information

Credit balance, username, email, address, etc.

User's account information can be retrieved using [API methods](/api-methods#rest_api-me) method:

```bash
curl --request POST \
     --url https://deep-image.ai/rest_api/me \
     --header 'content-type: application/json' \
     --header 'x-api-key: API_KEY'
```

And the example result:

```json
{
    "credits": 3872,
    "username": "John Doe",
    "email": "john.doe@gmail.com",
    "api_key": "xxxx-xxxx-xxxx-xxxx",
    "language": "en",
    "webhooks": {},
    "address": {
        "tax": "277021597",
        "companyName": "test",
        "streetAddress": "test",
        "city": "test",
        "postalCode": "55555",
        "country": "DE",
        "countryName": "Germany",
        "isCompany": true
    }
}
```


# Overview

Deep Image API Storages offer a convenient and secure way to work with images directly from your object storage, without needing to expose public URLs or handle manual uploads.

&#x20;Currently, Deep Image supports integrations with **AWS S3, Dropbox, Google Drive**, and **OneDrive**. Learn more about usage here: [Usage](/storages/usage)

Storages can be added exclusively via the **Storage** section in your [Deep-Image.ai](https://deep-image.ai) user dashboard. For a detailed setup guide, visit: [Setup](/storages/setup).


# Usage

All storage integrations — AWS S3, Dropbox, OneDrive, Google Drive — can be used directly within the **Deep Image web application**, specifically in the [**AI Enhancer PRO**](https://deep-image.ai/app/application/options) tool. This allows you to process individual images or entire folders, with the option to select a **target storage** where results will be saved. These integrations are also fully supported via the API, enabling automated workflows and seamless integration with your own applications or services.<br>

## API

### Why use storage with the API?

While the web app offers a convenient interface, the **true power** of storages is unlocked when using them via the **Deep Image API**. Thanks to a unified `storage://` syntax, all supported storage types share the **same interface**, regardless of the provider. This makes your workflow more flexible and easier to automate.

### Example usage

To process a specific image from a storage and save the result to another storage, simply use the following format:

[API methods](/api-methods#post-rest_api-process)

```json
{
  "url": "storage://aws-deep-image/2025/may/my-photo.png",
  "target": "storage://onedrive-deep-image/processed"
}
```

In this example:

* The image is loaded from the AWS S3 bucket named `aws-deep-image`.
* The result will be saved to a folder in OneDrive storage named `onedrive-deep-image`.

You can also use only one of the parameters depending on the task. For example:

* For image **generation tasks** (where there is no input image), you can specify only `"target"`.
* For enhancement or transformation of an existing file, use only `"url"` if you don’t need to save the result back to storage (e.g., when downloading it directly from the url in the response).

**Benefits of API-Based Storage Integration**

* **Consistency**: One unified path format (`storage://...`) across different platforms.
* **Automation**: Easily plug into pipelines for bulk processing or integration with other services.
* **Security**: No need to expose image URLs publicly.
* **Scalability**: Perfect for large-scale tasks with thousands of images.

### Note on Google Drive Usage

Unlike other storage integrations, **Google Drive does not support specifying folder or subfolder paths via the API** using the unified `storage://` syntax.\
Due to Google Drive API limitations and security policies, it is **not possible to provide full folder or subfolder paths for accessing files directly via the API**.

Because of these constraints, we **recommend avoiding using Google Drive as a source or target storage through the API**. Instead, for Google Drive workflows, please use the **Deep-Image web application**, which provides a tailored interface for Google Drive with proper handling of folder selection and permissions.

For more details and limitations related to Google Drive integration, see: [#google-drive-in-folder-processing-additional-notes](#google-drive-in-folder-processing-additional-notes "mention")

## Web Application

<figure><img src="/files/tzcIgNf8HVNF7vAqN7NP" alt=""><figcaption></figcaption></figure>

### Folder Processing

The **Folder Processing** feature in Deep-Image allows you to enhance large batches of images automatically, without the need to upload files manually. It supports external cloud storage integrations and organizes both successful and failed results efficiently.

<figure><img src="/files/o7rDUCaP4WixhnadKvC3" alt=""><figcaption></figcaption></figure>

#### How it Works

1. **Connect Your Storage**\
   Deep-Image supports seamless integration with the following cloud storage platforms:
   1. AWS S3
   2. Google Drive
   3. Dropbox
   4. OneDrive
2. **Choose Source and Target Folders**
   1. **Source folder** – contains the original images to be processed.
   2. **Target folder** – stores the results after processing.
3. **Target Folder Structure**\
   By default, processed images are stored in subfolders within the selected target directory:
   * `results` – contains successfully processed images
   * `invalid` *(optional)* – contains files that failed validation or encountered processing errors

{% hint style="info" %}
The source and target folders can belong to different storage types (e.g., source from Dropbox, target to S3).
{% endhint %}

{% hint style="info" %}
Saving failed files to the `invalid` folder is optional and can be toggled depending on your workflow.
{% endhint %}

#### Image validation

Image validation takes place during the processing phase. Images may fail validation if:

* They are corrupted
* They have unsupported formats
* They do not meet required criteria (e.g., resolution)

When enabled, failed files are moved to the `invalid` folder for further review or reprocessing. You can access validation details via **Gallery → Folder Details**, where the reasons for failure are listed.

#### Additional Info

* You can **stop processing** anytime from the Gallery page.
* To **resume processing**, select the same source and target folders; already processed files will be skipped.
* **Limits & credits:**
  * Credits are only consumed for successfully processed images.
  * Files that fail validation do not consume credits, even if saved in the `invalid` folder.

### File Picker

The **File Picker** is a separate tool that lets you:

* Browse your connected cloud storage.
* Select one or multiple individual files.
* Trigger instant on-demand processing without folder setup.

<figure><img src="/files/KcVelzocYzV4L85Km4yA" alt="" width="390"><figcaption></figcaption></figure>

### Google Drive in Folder Processing - Additional Notes

#### Using Google Drive as Source Folder

* To use a **Google Drive folder as the image source**, you must create a **shareable link** to the folder.
* The folder needs to have **'read for everyone'** permissions to allow Deep-Image to access the images.
* Alternatively, for more secure access, share the folder **specifically** with the service account email:\
  `deep-image-ai@deep-image-341514.iam.gserviceaccount.com`.
* This is required because Deep-Image accesses Google Drive via a service account and needs explicit permissions.

#### Using Google Drive as Target Folder

* When selecting a **target folder in Google Drive**, users can only select folders **within the app-specific folder namespace**.
* This limitation is due to Google Drive API's security model, which restricts apps from writing outside their dedicated folder area unless explicitly authorized.
* Therefore, target folders in Google Drive are limited to the app's folder or subfolders inside it.


# Setup


# AWS S3

How to configure AWS Storage

To configure storage for the user **"di-test"** with an existing S3 bucket **"di-test-bucket"**, follow these steps:

1. Create IAM User and Permissions.

   1. Log in to the AWS Console: <https://console.aws.amazon.com/>
   2. Navigate to **IAM** → **Users** → **Add users**.
   3. Enter **di-storage** as the username.
   4. Select **Attach policies directly**, then click **Create policy**.
   5. Choose the **JSON** tab and paste the following content:

      ```json
      {
        "Version": "2012-10-17",
        "Statement": [
          {
            "Effect": "Allow",
            "Action": [
              "s3:GetBucketLocation",
              "s3:GetObjectAttributes",
              "s3:PutObject",
              "s3:GetObject",
              "s3:ListBucket",
              "iam:SimulatePrincipalPolicy"
            ],
            "Resource": [
              "arn:aws:s3:::di-test-bucket/*",
              "arn:aws:s3:::di-test-bucket",
              "arn:aws:iam::<account_id>:user/di-test"
            ]
          }
        ]
      }
      ```
   6. Replace `<account_id>` with your AWS Account ID (without dashes).
   7. Complete the user creation process.
   8. Name the policy **di-policy** and save it.
   9. Back on the user creation page, refresh the policy list, find **di-policy**, and attach it to the user.
   10. Complete the user creation process.

2. Generate Access Keys

   1. Go to the newly created user **di-test**, open the **Security credentials** tab.
   2. Click **Create access key** → Choose **Third-party service**.
   3. Generate the keys and **copy** the Access Key ID and Secret Access Key. These will be used in Deep Image.

3. Set Up Storage in Deep Image

   1. Log in to the[ Deep Image web app](https://deep-image.ai/app/).
   2. Navigate to **Profile** → **My Profile** → [**Storages**](https://deep-image.ai/app/my-profile/storages). <br>

      <figure><img src="/files/mYDfK0yqgAHKm4k8bF1u" alt=""><figcaption></figcaption></figure>
   3. Select **AWS** as the storage type and click **ADD**.
   4. Fill in the following:
      1. **Name**: `di-storage`
      2. **Bucket**: `di-test-bucket`
      3. **Access Key** and **Secret Access Key** from step 2.<br>

   <figure><img src="/files/GzZSAL2dbzNjqNGdmLGK" alt=""><figcaption></figcaption></figure>

4. Using Your Storage - [Usage](/storages/usage)<br>


# OneDrive

How to configure OneDrive Storage

Set Up Storage in Deep Image

1. Log in to the [Deep Image web app.](https://deep-image.ai/app/)
2. Navigate to **Profile** → **My Profile** → [**Storages**](https://deep-image.ai/app/my-profile/storages). <br>

   <figure><img src="/files/22vNOmu8PVuiZUBrL94U" alt=""><figcaption></figcaption></figure>
3. Select **OneDrive** as the storage type and click **ADD**.
4. Fill name and click **ADD.**
5. Login to your OneDrive account.<br>

   <figure><img src="/files/ZDaz1KeEDgZMO2mM6zJS" alt=""><figcaption></figcaption></figure>
6. Using Your Storage - [Usage](/storages/usage)


# Dropbox

How to configure Dropbox Storage

Set Up Storage in Deep Image

1. Log in to the [Deep Image web app.](https://deep-image.ai/app/)
2. Navigate to **Profile** → **My Profile** → [**Storages**](https://deep-image.ai/app/my-profile/storages). <br>

   <figure><img src="/files/HKSUOO6xLDdAbc1rcsyn" alt=""><figcaption></figcaption></figure>
3. Select **Dropbox** as the storage type and click **ADD**.
4. Fill name and click **ADD.**
5. Login to your Dropbox account.<br>

   <figure><img src="/files/Hu9dlAimHDrS2tas09ps" alt=""><figcaption></figcaption></figure>
6. Using Your Storage - [Usage](/storages/usage)


# Google Drive

Z powodu pewnych ograniczen Google Drive nie jest wspierany w pelni w storages.&#x20;


# E-commerce

High-Quality Sales

The importance of product photography in eCommerce is immense. 90% of information sent to the brain is visual, which means high-quality photography increase customer confidence and leads them to make a purchase decision. There are so many benefits of good product photography:

* A high-quality image implies that your product is high quality; it creates a good first impression of your brand.
* You inspire trust in your customers to buy from your eCommerce store with confidence.
* Photographic images are more appealing than written copy.
* Photographs are an excellent way to establish your brand identity.
* Photography plays a key role in the decision-making process – it will increase your conversion rate.
* Product photos can be used as a marketing touchstone across all of your marketing channels.
* Custom product photography is far more beneficial than stock photography – you can show the USPs of your product to stand out in the market.

Deep-Image.AI app offers a fully automated image enhancement experience letting you focus on your business.

<figure><img src="/files/AwHMvpyBryFx3eVogiy5" alt=""><figcaption></figcaption></figure>

### Some statistics

If you're still not convinced of the high value of product photography, here are some statistics which solidify the significance of product photography for your eCommerce store.

* **90%** of online buyers say that photo quality is the most important factor in an online sale.
* Good product photography can increase your conversion rate by **30%**.
* **75%** of online shoppers rely on a product photo to make a decision.
* **90%** of online buyers say that photo quality is the most important factor in an online sale
* **93%** of consumers consider visual content to be the key deciding factor in a purchasing decision.
* Good product photography is **40%** more likely to be shared from your social media accounts.
* [A study conducted by Forbes](https://www.bright-river.com/blog/bigger-images-mean-higher-sales-conversions/) has shown that **50%** of online shoppers say “large, high-quality product images are more important than product information, descriptions or even reviews.”
* **94%** of consumers will leave a website with poor graphic design, and photography impacts the overall look and feel of a website or landing page.

### User Generated Content

UGC (User Generated Content) helps build loyalty and trust in e-commerce. Some platforms that offer users to display their products and services must rely on user-made photography. With a ready-made filters, you can improve any photo from your client or taken by yourself.

<figure><img src="/files/nM190XC6yVxqjPf7J4K6" alt=""><figcaption></figcaption></figure>

### E-commerce preset via API


# Real-estate

Let us boost your sales.

### **Make your real-estate ad more successful**

In today’s market, the vast majority of buyers start their search for a new home online. That means that your listing photos are often the first impression potential buyers will have of your property. If your photos are dark, blurry, or otherwise unappealing, potential buyers might move on to another listing without even giving your home a chance.

<figure><img src="/files/t7VR65dpOBSsGc4k2tCT" alt=""><figcaption></figcaption></figure>

### Real-estate photography statistics <a href="#real-estate-photography-statistics" id="real-estate-photography-statistics"></a>

* Getting professional real estate photos when selling your home is that homes with professional photos **sell 35% faster** than those without professional photos.
* Homes with professional photos also **sell for more money**. In fact, data in recent years showed homes with professional photos sold for **up to $11,000** more compared to homes without professional photos.
* Real-estate data show that homes with professional photos are up to **20% more likely to sell**.&#x20;
* With **around 90%** of buyers finding their next home online, professional photos are more important than ever to make a great first impression.

Professional photography services are expensive. With [Deep-image.ai](http://deep-image.ai/) you can get the same image quality saving time and money.

<figure><img src="/files/ffAKmzofs03A76XIlmUu" alt=""><figcaption></figcaption></figure>

### Real-estate API


# Print/Photo

Achieve premium print quality.

Increase the image resolution of your illustrations, photos or posters to achieve great printing results. Restore compressed image files from your Google Photos. Our revolutionary method, which is based on the use of machine learning, allowed us to bring the quality of corrected photos to the next level. With just one blink of an eye, you can get a much better photo.

<figure><img src="/files/0D83k3Hp4T9dTiLD0BbR" alt=""><figcaption></figcaption></figure>

## The benefits of using AI for post-processing photos <a href="#id-1e1a" id="id-1e1a"></a>

1\. There are many benefits to using AI for post-processing photos. AI can help to improve the quality of your photos, and it can also help to speed up the process.

2\. AI can be used to automatically correct common problems with photos, such as exposure and color. AI can also be used to enhance details and get professional effects.

3\. AI is also very helpful for batch processing large numbers of photos. This can save a lot of time, especially if you have a large number of photos to process.

4\. And last, but not least. The algorithms are still getting better and better. If you have a special use case and want to improve the results of enhancement, we can train the model to be the best in your kind of image. That is the huge advantage of artificial intelligence over traditional tools.

<figure><img src="/files/ljq9brygJwyoMXPhtUin" alt=""><figcaption></figcaption></figure>

If you’re looking to get higher-quality photos, you should definitely use AI post-processing. These tools can help you fix common problems like poor lighting and composition, and they can also help you add artistic touches to your photos that will make them really stand out.

## How many pixels are needed for a good-quality photo? <a href="#id-520f" id="id-520f"></a>

The number of pixels needed for a good-quality picture depends on the resolution of the image. The higher the resolution, the more pixels are needed. For example, an image with a resolution of 300 dpi would require 9,000 pixels to create a 3-inch by 3-inch print. For a 7-inch by 10-inch print, you’d need 36,000 pixels. If the resolution remains constant, increasing the physical size of the image will increase the pixel count.&#x20;

In Deep-image.ai you can set upscale to enlarge your images automatically 2x,3x,4x times or increase their resolution by specifying the parameter of one of the sides in pixels. The length of the other side will then automatically set itself to maintain the aspect ratio from the input image.

<figure><img src="/files/R9epGxuBgaL9aCoIAKo7" alt=""><figcaption></figcaption></figure>

### Print/Photo API


# Digital Art

Better quality for your Digital Arts

Use dedicated filters to match your style and have the ability to print your art on virtually any format. With the help of AI, we can now upscale small images to create sharp, high-quality work arts that are virtually indistinguishable from their originals. This new level of detail and resolution means that we can enjoy our favorite digital artworks in a whole new way.

<figure><img src="/files/0bP5Nt2RoYIyvkw7M5rY" alt=""><figcaption></figcaption></figure>

The Deep-image.ai application uses artificial intelligence algorithms to create new pixels from parameters available in the image. The available presets allow you to choose the right filter for particular types of digital art, such as PixelArt, AI-generated Art, etc.

<figure><img src="/files/wjk10fCV5QLGaDvplsJ7" alt=""><figcaption></figcaption></figure>

Neural networks have been trained to enlarge an image without changing the original version. Deep-image.ai allows you to pull out all the details, contours and shapes. With this application you can enlarge your image automatically and use it in any format in great quality.

### Digital Art API


# Algorithms

Thanks to Artificial Intelligence and Machine Learning, Deep-Image.ai is trained to provide desired results in various business scenarios. We can teach algorithm-specific use cases based on a client's needs.

<figure><img src="/files/8lZywTJASzHiVgaBGmEO" alt=""><figcaption></figcaption></figure>

Deep-Image.ai uses its GPU hardware infrastructure to deliver results to clients in Europe and America. We have enough capacity to process hundreds of thousands of images monthly. We prepare a dedicated infrastructure for larger volumes of transformations; the service can also be hosted in cloud environments.

Working with neural networks does not look like a standard programming process. **More like science, based on showing the pattern**. Check this:

* in Deep-Image.ai on the input, we have low-resolution graphics, while on the output we have to get a high resolution. At the beginning of cooperation with the neural network, we set random parameters
* From the moment of entry, the neural network learns how to create good-quality graphics with the help of various transformations
* The network counts an error by analyzing the difference between the input (the starting image) and the output (the final image). Then it modifies the weights so that the difference between successive exits is as small as possible.
* The learning and creation process is based on algorithms (filter sets). Neural network assimilates information about a given edge so that in the end the line is smooth.

**Application operation is based on the iterative process**, which brings the final graphics almost to perfection.&#x20;


# Upscale

**Deep-image.ai** uses a revolutionary upscale technique to create high-resolution images from low-resolution originals. While there are many techniques to upscale an image, the neural networks at **Deep-image.ai** offer a solution that scales or enlarges your image using the latest artificial intelligence algorithms techniques. With this technology, any image can be upscaled to a high-resolution version without losing quality.

<figure><img src="/files/geT8ud2kXkSvtkTRjLWa" alt=""><figcaption></figcaption></figure>

### **PNG vs JPEG — the difference in upscaling**

PNG offers a lossless compression meaning that the picture loses no quality with compression, meanwhile JPEG reduces the image quality as the file size gets smaller. The most obvious thing to happen when a JPEG compresses severely is that the finer details disappear. Pictures is getting more pixelated, giving the image “blocky” apperance.

Deep-Image.AI uses different AI models for each of these formats, but it recognises the image format by its image header.

One of the potential challenges is be when the image which was saved first with JPEG compression that introduced heavy JPEG artifacts was saved as a PNG file. In that case Deep-Image.AI will process the file as PNG, but in fact pixels look like they were processed with JPEG compression.

Let see the example below. One was saved as a PNG file and upscaled 4x and the second one was saved as a JPEG file and also upscaled 4x.

<figure><img src="/files/NIGfgd5wnavcaQZWTYJA" alt=""><figcaption><p>RAW photo without any compression.</p></figcaption></figure>

<div><figure><img src="/files/oT9Np5HSVJcLzRWnIgBs" alt=""><figcaption><p>JPEG image upscaled 4x and cropped</p></figcaption></figure> <figure><img src="/files/RZB1gUvhTdm1LDZhZ4FO" alt=""><figcaption><p>PNG image upscaled 4x and cropped</p></figcaption></figure></div>

The differences are clearly noticeable. Much more details are restored in the PNG image.

Of course, this will only happen when the source image was the RAW file not a JPEG file saved as a PNG. In that case, we would have the situation described at the beginning of this section

### Video&#x20;

{% embed url="<https://www.youtube.com/watch?v=Y4j_rODWs_w>" %}


# Sharpen & Noise reduction

### Sharpening of images is useful when:

\- image is slightly blurred and the blurred nature is close to the filter known as gaussian diffuse,

\- image is pixelated — the more anti-aliased pixels, the better.

Sharpen unfortunately can over-sharpen the image when the image is not blurred at all — so it is the human role to decide when it is useful.

In the future, Deep-Image.ai will provide some kind of automatic guessing of what kind of degradation the image has and which filters will be the best.

### Example of sharpening filter work

<div><figure><img src="/files/NxK8GRZBlurtecDeJJyQ" alt=""><figcaption><p>Blurry image sharpened</p></figcaption></figure> <figure><img src="/files/1KsotFajxhmKEUva61f6" alt=""><figcaption><p>Blurry image example</p></figcaption></figure></div>

<div><figure><img src="/files/Dm4qGIrQVpBadoJATLQT" alt=""><figcaption><p>Pixelated image sharpened</p></figcaption></figure> <figure><img src="/files/4ZoRaOBwIOwoeJRy8sJQ" alt=""><figcaption><p>Pixelated image example</p></figcaption></figure></div>

As you can see there are plenty of use cases related to the filters in Deep-Image.AI. It’s important to be fully aware of the capabilities behind the software and to use them in the most beneficial way.

### Noise reduction of images

Noise can occur as a result of using high ISO settings or taking a photo in low light. Most often this is an unwanted effect. The photo corrected by Deep-image.ai is smooth and clean. Noise is the changes in the digital image. Deep Image's algorithms can remove the grain from the photo and effectively reduce all the noise. Here is an example of the results:

{% embed url="<https://www.youtube.com/watch?v=98eEbMZNt24>" %}


# Enhance Lighting

Color & Light Correction

The application offers filters for color and light enhancement (HDR & Light Enhanced) which can allow you to get even better results on images.&#x20;

<figure><img src="/files/4wZYI3xvT4xtHtIntO5s" alt=""><figcaption></figcaption></figure>

With the help of Deep-image.ai, you can enhance your images and use them in a variety of places, such as a real-estate ads, posters, advertisements, or in any other printed publication.

<figure><img src="/files/QFxvGZMSutyjBnsxEWAq" alt=""><figcaption></figcaption></figure>

Certainly, the use of artificial intelligence algorithms will save you time and money in creating valuable marketing and enhancing user generated content, which is what everyone cares about.

<figure><img src="/files/qRMawo86ZaBjH0MoSydy" alt=""><figcaption></figcaption></figure>


# FAQ

The most common questions and answers.

#### 1. For what purpose can I use API?&#x20;

You can use API to integrate Deep-Image into your website, app or workflow. You can find the relevant docs here.

#### 2. How many images can I process simultaneously with the use of API?&#x20;

You can process simultaneously as many images as you have available in your account’s plan. If you upload several images, they will be processed one by one.

#### 3.  How do credits work?&#x20;

When you buy a subscription you receive a monthly budget of credits. 1 image transformtion requires 1 credit.

#### 4. How to cancel my subscription?&#x20;

After logging in to my profile, you can manage (and cancel) your subscription.

#### 5. How subscription credits accumulation works?&#x20;

Unused credits will roll over up to 3 months. Keep your subscription active to use them.

#### 6. What happens to the credits if I don't use them all in a given month?&#x20;

You can use all the credits in a given month or move them to the next month as long as you remain a subscriber - so you can still use them. Max accumulation - 3 months.

#### 7. What happens to the credits if I remove the subscription?&#x20;

If you cancel your membership you will lose your remaining credits.

#### 8. How refferal code work?&#x20;

If someone makes a purchase from your referral code, both of you will get 50% more credits from new purchase.

#### 9. How many times can I use a refferal code?&#x20;

A new user, who comes from a referral can use the referral code only once, but you can give your referral code an infinite number of times.

#### 10. Where can I find a refferal code?&#x20;

You can generate your unique code in your profile.


