Premium Edits
Apply a premium edit such as Day to Dusk to an image you have already processed
Premium edits are restaging options that create a new image from one you have already processed, instead of changing the original. Currently the only premium edit is Day to Dusk (see Restaging).
Because the edit is applied after the first enhancement, you review the standard result first and choose which images are worth a premium edit.
This guide assumes you already have an API key and an image that has finished processing. If not, see the Quickstart guides first.
Request the premium edit
Update the processed image, using its image_id, with the premium edit in the restage object. The request is a PUT to /v3/images/{image_id}.
const apiKey = "YOUR_API_KEY";
const imageId = "ID_OF_YOUR_IMAGE";
const requestPremiumEdit = async (imageId, apiKey) => {
const response = await fetch(
`https://api.autoenhance.ai/v3/images/${imageId}`,
{
method: "PUT",
headers: {
"Content-Type": "application/json",
"x-api-key": apiKey,
},
body: JSON.stringify({
restage: { environment: "DUSK" }
}),
}
);
// 201 Created: the new image is at the Location header
const location = response.headers.get("Location");
const newImageId = location.split("/").pop();
return newImageId;
}The response is 201 Created. The body is the original image, unchanged. The Location header is the path of the new image, for example /images/<new_image_id>.
Things to know
The original image keeps its standard enhancement. Each premium edit request creates another new image.
To change how the new image is finished, send
finetune_settingsorpreset_idin the same request. Send nothing else alongsiderestage, otherwise the original is reprocessed instead.If you see
PREMIUM_RESTAGE_ON_INITIAL_PROCESSING, moveenvironmentout of your upload or order request and into this follow-up update.
Was this helpful?