Photo Enhancement API

Try on PicWish

AI improves blurry or low-quality images by enhancing detail, clarity, and resolution. It works for product photos, portraits, and design assets, with async and sync request modes.

The result image URL is valid for 1 hour. Please download and store it promptly.

Authentication

Every API request must include your API Key in the X-API-KEY request header. Send it with each request exactly as shown in the examples and parameter descriptions.

X-API-KEY: YOUR_API_KEY

Create a photo enhancement task

POST /api/tasks/visual/scale

Body Parameters

image_url string optional

Source image URL. If this parameter is present, the other image source parameters must be empty.

one required
image_file file optional

Source image file as binary data. If this parameter is present, the other image source parameters must be empty.

For image upload requirements, see Guidelines and Limits #3.

sync integer optional

Whether to return the result image in real time. Use 0 to return a task_id asynchronously and fetch the result later; use 1 to wait and return the result synchronously. Results are kept for up to 1 hour.

type string optional

Enhancement type. clean = image enhancement, best for non-portrait images such as products; face = face enhancement, best for portraits. Up to 10 portraits can be enhanced in one image. Default is clean.

scale_factor integer optional

Enhancement value. Empty = auto enhancement: (10,512] upscales to 4x, (512,1024] upscales to 2x, and (1024,4096] keeps the original resolution. 1 keeps the original resolution, 2 upscales to 2x, and 4 upscales to 4x.

return_type integer optional

Result return type. 1 returns an image URL; 2 returns a base64-encoded string; 3 returns binary data and is only available for synchronized requests. Default is 1.

Return Parameters

status number

HTTP response status code. 200 means success, and non-200 means failure. See Status Code Definitions.

message string

API response message. Usually success for a successful request.

data.task_id string

Async photo enhancement task ID returned after the task is created. Use it to query the result later.

status number

HTTP response status code. 200 means success, and non-200 means failure. See Status Code Definitions.

message string

API response message. Usually success for a successful request.

data.task_id string

Photo enhancement task ID.

data.created_at string

Timestamp of task creation.

data.processed_at string

Timestamp when the task started to be processed.

data.completed_at string

Timestamp of task completion.

data.image string

The result image URL or base64 data. The URL is valid for 1 hour.

data.progress number

Task progress. 100 means processing is complete.

data.state number

Task status code. 1 means succeeded, greater than 1 means processing, and less than 0 means failed. See Status Code Definitions.

Query photo enhancement result

GET /api/tasks/visual/scale/{task_id}

Path Parameters

task_id string required

Photo enhancement task ID returned after creating an async task. Use it to query the processing result.

Return Parameters

status number

HTTP response status code. 200 means success, and non-200 means failure. See Status Code Definitions.

message string

API response message. Usually success for a successful request.

data.task_id string

Photo enhancement task ID. If the task fails, contact support with this task_id.

data.created_at string

Timestamp of task creation.

data.processed_at string

Timestamp when the task started to be processed.

data.completed_at string

Timestamp of task completion.

data.image string

The result image URL or base64 data. The URL is valid for 1 hour.

data.progress number

Task progress. 100 means processing is complete.

data.state number

Task status code. 1 means succeeded, greater than 1 means processing, and less than 0 means failed. See Status Code Definitions.

Guidelines and Limits

  1. The result image URL is valid for 1 hour. Please download and store it promptly.

  2. A successful call consumes 2 credits when the long edge is <= 2048px, and 3 credits when 2048px < long edge <= 4096px.

  3. Uploaded images must meet the following format, resolution, and file size limits.

    FormatResolutionSize
    jpg, jpeg, bmp, png, webp, tiff, tif, bitmap, raw, rgb, jfif, lzwUp to 4096 x 4096Up to 20MB