our logo

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_KEY

Recommended pattern

Run enhancement and upscaling pipelines asynchronously on your backend to avoid long‑running operations in client apps.

Enhancement & Upscaling Endpoints

GFPGAN Enhancer

POST/api/gfpgan-enhancer

Enhance a provided image using GFPGAN. Ideal for restoring low‑resolution or compressed images with face enhancement.

Parameters

NameTypeRequiredDescription
imagefile (formData)RequiredImage to enhance with GFPGAN.
versionstring (formData)OptionalGFPGAN model version ('1.3' default, '1.2' uses GFPGANCleanV1).

Task Status Endpoint

GET/api/task-status/{task_id}

Get the status of a task and retrieve the processed image URL.

NameTypeRequiredDescription
task_idstring (path)RequiredThe 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 CodeDescription
200Successfully retrieved task status.
400Bad request.
401Unauthorized.

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

POST/api/upscale

Upscale images according to the factors passed like 2, 4, 8 and optionally compress.

Parameters

NameTypeRequiredDescription
imagefile (formData)RequiredImage to upscale.
factorstring (formData)OptionalUpscaling factor (2, 4, or 8).
target_size_kbinteger (formData)OptionalOptional target size in KB to compress the image.

Task Status Endpoint

GET/api/task-status/{task_id}

Get the status of a task and retrieve the processed image URL.

NameTypeRequiredDescription
task_idstring (path)RequiredThe 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 CodeDescription
200Successfully retrieved task status.
400Bad request.
401Unauthorized.

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

POST/api/upscale_pro

Upscale an image using Imagen 4 Upscale Preview (high-quality upscaling). Recommended when you need maximum sharpness for prints or large displays.

Parameters

NameTypeRequiredDescription
imagefile (formData)RequiredImage to upscale.
upscaleFactorstring (formData)OptionalUpscale factor: 'x2', 'x3', or 'x4'. Default is 'x2'.
addWatermarkboolean (formData)OptionalWhether to add a digital watermark. Defaults to provider's default (true) if omitted.

Task Status Endpoint

GET/api/task-status/{task_id}

Get the status of a task and retrieve the processed image URL.

NameTypeRequiredDescription
task_idstring (path)RequiredThe 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 CodeDescription
200Successfully retrieved task status.
400Bad request.
401Unauthorized.

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

POST/api/outpaint

Expand an image using Imagen outpainting (EDIT_MODE_OUTPAINT). Add more context around the subject while keeping style and quality consistent.

Parameters

NameTypeRequiredDescription
baseImagefile (formData)RequiredBase image to expand.
outpaintMaskfile (formData)RequiredRequired outpainting mask image (black/white) indicating the region to extend beyond the original content.
promptstring (formData)OptionalOptional prompt describing the outpainted area, for example 'a blue sky'. If omitted, the model infers continuation from context.
maskDilationnumber (formData)OptionalOptional mask dilation as fraction of image width. Docs recommend 0.03 for outpainting.

Task Status Endpoint

GET/api/task-status/{task_id}

Get the status of a task and retrieve the processed image URL.

NameTypeRequiredDescription
task_idstring (path)RequiredThe 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 CodeDescription
200Successfully retrieved task status.
400Bad request.
401Unauthorized.

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)