Restore
Our restoration models are designed to enhance photos that are older and of poorer quality.
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:
modeloutput_format
Please see the reference for further details. Check out the available models to see which model options you have.
The following are our restoration models designed to enhance photos that are older and of poorer quality.
Returns process_id and eta to use as an efficient way to track the progress of the image restoration job:
Use the
Statusendpoints to check the status of this job using the returnedprocess_id.Use the
Downloadendpoints to download the input or processed image (once it is ready).Use the
Cancelendpoint 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
etarepresents 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.
Authentication via the Topaz generated key in the X-API-Key header.
The image file to be processed. Supported formats:
- jpeg (or jpg)
- png
- tiff (or tif)
Unique identifier of the source image.
d7b3b3b3-7b3b-4b3b-8b3b-3b3b3b3b3b3bThe URL of the source image.
https://example.com/image.jpgThe model to use for processing the image.
Dust-ScratchPossible values: The desired format of the output image.
jpegPossible values: 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.
https://example.com/webhookAdditional 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.
Image processing request has been successfully created.
The request contains malformed data in the body, path, or query parameters.
Authentication is required and has failed or has not yet been provided.
Payment is required to access the resource.
The API key doesn't have permissions to perform the request.
The preconditions to process the request were not met.
The request is larger than the server is willing or able to process.
The request entity has a media type which the server or resource does not support.
The request was well-formed but was unable to be followed due to semantic errors.
The request was sent too early to be processed. Please wait before retrying.
Too many requests hit the API too quickly. A backoff (e.g. exponential) is recommended for your requests.
Unexpected error on our end.
POST /image/v1/restore-gen/async HTTP/1.1
Host: api.topazlabs.com
X-API-Key: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 237
{
"image": "binary",
"source_id": "d7b3b3b3-7b3b-4b3b-8b3b-3b3b3b3b3b3b",
"source_url": "https://example.com/image.jpg",
"model": "Dust-Scratch",
"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