Enhance

Enhance images by removing noise, sharpening, and upscaling while preserving the details of your image, including the faces of important subjects.

Just pass in an image and our Autopilot will automatically determine the best settings for the highest quality.

Additional configuration can be optionally provided, specifically:

  • model

  • output_height

  • output_width

  • output_format

  • crop_to_fill

Please see the reference for further details. Check out the available models to see which model options you have.

Enhance

post

Returns process_id and eta to use as an efficient way to track the progress of the image enhancement job:

  • Use the Status endpoints to check the status of this job using the returned process_id.

  • Use the Download endpoints to download the input or processed image (once it is ready).

  • Use the Cancel endpoint to cancel the job while it is in progress.

The same process_id and eta are also returned in the response headers as X-Process-ID and X-ETA respectively.

The eta represents when the job is expected to finish in Unix time. We recommend using this to know when you can expect your (bulk) jobs to finish processing.

Authorizations
X-API-KeystringRequired

Authentication via the Topaz generated key in the X-API-Key header.

Body
imagestring · binaryOptional

The image file to be processed. Supported formats:

  • jpeg (or jpg)
  • png
  • tiff (or tif)
source_idstringOptional

Unique identifier of the source image.

Example: d7b3b3b3-7b3b-4b3b-8b3b-3b3b3b3b3b3b
source_urlstringOptional

The URL of the source image.

Example: https://example.com/image.jpg
modelstring · enumOptional

The model to use for processing the image.

Default: Standard V2Possible values:
output_heightinteger · min: 1 · max: 32000Optional

The desired height of the output image in pixels. Your image will automatically be upscaled to this specified value. If only one of output_height and output_width is set, then the other dimension is scaled proportionally.

Example: 1080
output_widthinteger · min: 1 · max: 32000Optional

The desired width of the output image in pixels. Your image will automatically be upscaled to this specified value. If only one of output_height and output_width is set, then the other dimension is scaled proportionally.

Example: 1920
crop_to_fillbooleanOptional

Default behavior is to letterbox the image if a differing aspect ratio is chosen. Enable crop_to_fill by setting this to true if you instead want to crop the image to fill the dimensions.

Default: false
output_formatstring · enumOptional

The desired format of the output image.

Default: jpegPossible values:
webhook_urlstringOptional

The URL to send the webhook to. When provided, a POST request with a JSON payload will be sent to this URL when the job status changes or completes.

Request Body: The webhook will be sent as a POST request with Content-Type: application/json containing the following fields:

  • notification_id (string, ULID): Unique identifier for this notification. Can be used to order messages in case they are received out of order.
  • process_id (string, UUID): Unique identifier of the image processing job.
  • status (string): Current status of the job (e.g., "Pending", "Processing", "Completed", "Cancelled", "Failed").
  • creation_time (integer): Unix timestamp in seconds when the job was created.
  • modification_time (integer): Unix timestamp in seconds when the job was last modified.
  • progress (integer): Progress of the job as a percentage (0-100).
  • download_url (string, optional): Presigned GET URL for the processed image. Only present once the job is completed.
  • head_url (string, optional): Presigned HEAD URL for the processed image. Only present once the job is completed.
  • input_download_url (string): Presigned GET URL for the input image.
  • input_head_url (string): Presigned HEAD URL for the input image.

Retry Behavior: If the webhook endpoint returns a 5xx server error, the system will retry the webhook with exponential backoff. The backoff starts at 5 seconds and doubles with each retry attempt (5s, 10s, 20s, 40s, etc.), up to a maximum of 15 minutes. Client errors (4xx status codes) are not retried and the notification is discarded.

Example: https://example.com/webhook
Other propertiesstringOptional

Additional key-value pairs to be used as model settings. Only pairs relevant for your chosen model are used. Please see the available models for more details.

Responses
post
/enhance/async
POST /image/v1/enhance/async HTTP/1.1
Host: api.topazlabs.com
X-API-Key: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 298

{
  "image": "binary",
  "source_id": "d7b3b3b3-7b3b-4b3b-8b3b-3b3b3b3b3b3b",
  "source_url": "https://example.com/image.jpg",
  "model": "Standard V2",
  "output_height": 1080,
  "output_width": 1920,
  "crop_to_fill": false,
  "output_format": "jpeg",
  "webhook_url": "https://example.com/webhook",
  "ANY_ADDITIONAL_PROPERTY": "text"
}
{
  "process_id": "d7b3b3b3-7b3b-4b3b-8b3b-3b3b3b3b3b3b",
  "source_id": "d7b3b3b3-7b3b-4b3b-8b3b-3b3b3b3b3b3b",
  "eta": 1617220000
}

Enhance Generative

post

Returns process_id and eta to use as an efficient way to track the progress of the image enhancement job:

  • Use the Status endpoints to check the status of this job using the returned process_id.

  • Use the Download endpoints to download the input or processed image (once it is ready).

  • Use the Cancel endpoint to cancel the job while it is in progress.

The same process_id and eta are also returned in the response headers as X-Process-ID and X-ETA respectively.

The eta represents when the job is expected to finish in Unix time. We recommend using this to know when you can expect your (bulk) jobs to finish processing.

Authorizations
X-API-KeystringRequired

Authentication via the Topaz generated key in the X-API-Key header.

Body
imagestring · binaryOptional

The image file to be processed. Supported formats:

  • jpeg (or jpg)
  • png
  • tiff (or tif)
source_idstringOptional

Unique identifier of the source image.

Example: d7b3b3b3-7b3b-4b3b-8b3b-3b3b3b3b3b3b
source_urlstringOptional

The URL of the source image.

Example: https://example.com/image.jpg
modelstring · enumOptional

The model to use for processing the image.

Default: RedefinePossible values:
output_heightinteger · min: 1 · max: 32000Optional

The desired height of the output image in pixels. Your image will automatically be upscaled to this specified value. If only one of output_height and output_width is set, then the other dimension is scaled proportionally.

Example: 1080
output_widthinteger · min: 1 · max: 32000Optional

The desired width of the output image in pixels. Your image will automatically be upscaled to this specified value. If only one of output_height and output_width is set, then the other dimension is scaled proportionally.

Example: 1920
crop_to_fillbooleanOptional

Default behavior is to letterbox the image if a differing aspect ratio is chosen. Enable crop_to_fill by setting this to true if you instead want to crop the image to fill the dimensions.

Default: false
output_formatstring · enumOptional

The desired format of the output image.

Default: jpegPossible values:
webhook_urlstringOptional

The URL to send the webhook to. When provided, a POST request with a JSON payload will be sent to this URL when the job status changes or completes.

Request Body: The webhook will be sent as a POST request with Content-Type: application/json containing the following fields:

  • notification_id (string, ULID): Unique identifier for this notification. Can be used to order messages in case they are received out of order.
  • process_id (string, UUID): Unique identifier of the image processing job.
  • status (string): Current status of the job (e.g., "Pending", "Processing", "Completed", "Cancelled", "Failed").
  • creation_time (integer): Unix timestamp in seconds when the job was created.
  • modification_time (integer): Unix timestamp in seconds when the job was last modified.
  • progress (integer): Progress of the job as a percentage (0-100).
  • download_url (string, optional): Presigned GET URL for the processed image. Only present once the job is completed.
  • head_url (string, optional): Presigned HEAD URL for the processed image. Only present once the job is completed.
  • input_download_url (string): Presigned GET URL for the input image.
  • input_head_url (string): Presigned HEAD URL for the input image.

Retry Behavior: If the webhook endpoint returns a 5xx server error, the system will retry the webhook with exponential backoff. The backoff starts at 5 seconds and doubles with each retry attempt (5s, 10s, 20s, 40s, etc.), up to a maximum of 15 minutes. Client errors (4xx status codes) are not retried and the notification is discarded.

Example: https://example.com/webhook
Other propertiesstringOptional

Additional key-value pairs to be used as model settings. Only pairs relevant for your chosen model are used. Please see the available models for more details.

Responses
post
/enhance-gen/async
POST /image/v1/enhance-gen/async HTTP/1.1
Host: api.topazlabs.com
X-API-Key: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 295

{
  "image": "binary",
  "source_id": "d7b3b3b3-7b3b-4b3b-8b3b-3b3b3b3b3b3b",
  "source_url": "https://example.com/image.jpg",
  "model": "Redefine",
  "output_height": 1080,
  "output_width": 1920,
  "crop_to_fill": false,
  "output_format": "jpeg",
  "webhook_url": "https://example.com/webhook",
  "ANY_ADDITIONAL_PROPERTY": "text"
}
{
  "process_id": "d7b3b3b3-7b3b-4b3b-8b3b-3b3b3b3b3b3b",
  "source_id": "d7b3b3b3-7b3b-4b3b-8b3b-3b3b3b3b3b3b",
  "eta": 1617220000
}

Last updated