Image Enhancement & Upscaling API
These endpoints improve image quality, upscale resolution, and expand canvas space using advanced AI models.
Introduction
Use the enhancement APIs to restore low‑resolution photos, upscale images for print, or outpaint additional context while preserving style and quality.
Base URL
https://taiapi.aiphotocraft.com/Authentication
All requests must include your API key in the X-Api-Key header.
X-Api-Key: YOUR_API_KEYRecommended pattern
Run enhancement and upscaling pipelines asynchronously on your backend to avoid long‑running operations in client apps.
Enhancement & Upscaling Endpoints
GFPGAN Enhancer
/api/gfpgan-enhancerEnhance a provided image using GFPGAN. Ideal for restoring low‑resolution or compressed images with face enhancement.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| image | file (formData) | Required | Image to enhance with GFPGAN. |
| version | string (formData) | Optional | GFPGAN model version ('1.3' default, '1.2' uses GFPGANCleanV1). |
Task Status Endpoint
/api/task-status/{task_id}Get the status of a task and retrieve the processed image URL.
| Name | Type | Required | Description |
|---|---|---|---|
| task_id | string (path) | Required | The ID of the task to get the status for. |
Example Request
curl -X GET "https://taiapi.aiphotocraft.com/api/task-status/{task_id}"-H "accept: application/json"-H "X-Api-Key: YOUR_API_KEY"
Example Response
{
"image_url": "https://taiapi.aiphotocraft.com/results/swapped_image.jpg"
}Response Status Codes
| Status Code | Description |
|---|---|
| 200 | Successfully retrieved task status. |
| 400 | Bad request. |
| 401 | Unauthorized. |
Examples
import requests
url = "https://taiapi.aiphotocraft.com/api/gfpgan-enhancer"
headers = {
"X-Api-Key": "YOUR_API_KEY",
"accept": "application/json",
}
files = {
"image": ("input.jpg", open("input.jpg", "rb"), "image/jpeg"),
}
data = {
"version": "1.3",
}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.status_code, response.text)Image Upscale
/api/upscaleUpscale images according to the factors passed like 2, 4, 8 and optionally compress.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| image | file (formData) | Required | Image to upscale. |
| factor | string (formData) | Optional | Upscaling factor (2, 4, or 8). |
| target_size_kb | integer (formData) | Optional | Optional target size in KB to compress the image. |
Task Status Endpoint
/api/task-status/{task_id}Get the status of a task and retrieve the processed image URL.
| Name | Type | Required | Description |
|---|---|---|---|
| task_id | string (path) | Required | The ID of the task to get the status for. |
Example Request
curl -X GET "https://taiapi.aiphotocraft.com/api/task-status/{task_id}"-H "accept: application/json"-H "X-Api-Key: YOUR_API_KEY"
Example Response
{
"image_url": "https://taiapi.aiphotocraft.com/results/swapped_image.jpg"
}Response Status Codes
| Status Code | Description |
|---|---|
| 200 | Successfully retrieved task status. |
| 400 | Bad request. |
| 401 | Unauthorized. |
Examples
import requests
url = "https://taiapi.aiphotocraft.com/api/upscale"
headers = {
"X-Api-Key": "YOUR_API_KEY",
"accept": "application/json",
}
files = {
"image": ("input.jpg", open("input.jpg", "rb"), "image/jpeg"),
}
data = {
"factor": "4",
# "target_size_kb": "500", # optional
}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.status_code, response.text)Image Upscale Pro
/api/upscale_proUpscale an image using Imagen 4 Upscale Preview (high-quality upscaling). Recommended when you need maximum sharpness for prints or large displays.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| image | file (formData) | Required | Image to upscale. |
| upscaleFactor | string (formData) | Optional | Upscale factor: 'x2', 'x3', or 'x4'. Default is 'x2'. |
| addWatermark | boolean (formData) | Optional | Whether to add a digital watermark. Defaults to provider's default (true) if omitted. |
Task Status Endpoint
/api/task-status/{task_id}Get the status of a task and retrieve the processed image URL.
| Name | Type | Required | Description |
|---|---|---|---|
| task_id | string (path) | Required | The ID of the task to get the status for. |
Example Request
curl -X GET "https://taiapi.aiphotocraft.com/api/task-status/{task_id}"-H "accept: application/json"-H "X-Api-Key: YOUR_API_KEY"
Example Response
{
"image_url": "https://taiapi.aiphotocraft.com/results/swapped_image.jpg"
}Response Status Codes
| Status Code | Description |
|---|---|
| 200 | Successfully retrieved task status. |
| 400 | Bad request. |
| 401 | Unauthorized. |
Examples
import requests
url = "https://taiapi.aiphotocraft.com/api/upscale_pro"
headers = {
"X-Api-Key": "YOUR_API_KEY",
"accept": "application/json",
}
files = {
"image": ("input.jpg", open("input.jpg", "rb"), "image/jpeg"),
}
data = {
"upscaleFactor": "x2",
"addWatermark": "false",
}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.status_code, response.text)Outpaint
/api/outpaintExpand an image using Imagen outpainting (EDIT_MODE_OUTPAINT). Add more context around the subject while keeping style and quality consistent.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| baseImage | file (formData) | Required | Base image to expand. |
| outpaintMask | file (formData) | Required | Required outpainting mask image (black/white) indicating the region to extend beyond the original content. |
| prompt | string (formData) | Optional | Optional prompt describing the outpainted area, for example 'a blue sky'. If omitted, the model infers continuation from context. |
| maskDilation | number (formData) | Optional | Optional mask dilation as fraction of image width. Docs recommend 0.03 for outpainting. |
Task Status Endpoint
/api/task-status/{task_id}Get the status of a task and retrieve the processed image URL.
| Name | Type | Required | Description |
|---|---|---|---|
| task_id | string (path) | Required | The ID of the task to get the status for. |
Example Request
curl -X GET "https://taiapi.aiphotocraft.com/api/task-status/{task_id}"-H "accept: application/json"-H "X-Api-Key: YOUR_API_KEY"
Example Response
{
"image_url": "https://taiapi.aiphotocraft.com/results/swapped_image.jpg"
}Response Status Codes
| Status Code | Description |
|---|---|
| 200 | Successfully retrieved task status. |
| 400 | Bad request. |
| 401 | Unauthorized. |
Examples
import requests
url = "https://taiapi.aiphotocraft.com/api/outpaint"
headers = {
"X-Api-Key": "YOUR_API_KEY",
"accept": "application/json",
}
files = {
"baseImage": ("input.jpg", open("input.jpg", "rb"), "image/jpeg"),
"outpaintMask": ("mask.png", open("mask.png", "rb"), "image/png"),
}
data = {
"prompt": "extend the scene with mountains and sky",
"maskDilation": "0.03",
}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.status_code, response.text)