Start an image upscale generation job.
Upscaling
Use POST /images/upscaling to create a higher-resolution result for an existing
generated image.
Upscaling uses the same asynchronous job flow as image and video generation:
- Start the upscale job with the source
imageID. - Save the returned
jobId. - Poll
GET /jobs/{id}. - Read the upscaled image from the returned
imagesarray.
const imageId = '<IMAGE_ID>'
const payload = {
imageID: imageId,
}
const response = await fetch(`${BASE_URL}/images/upscaling`, {
method: 'POST',
headers: {
...headers,
'Content-Type': 'application/json',
},
body: JSON.stringify(payload),
})
if (!response.ok) {
throw new Error(await response.text())
}
const body = await response.json()
const jobId = body.result.jobId
console.log('Upscaling queued:', jobId)image_id = "<IMAGE_ID>"
payload = {
"imageID": image_id,
}
response = requests.post(f"{BASE_URL}/images/upscaling", headers=headers, json=payload)
response.raise_for_status()
job_id = response.json()["result"]["jobId"]
print("Upscaling queued:", job_id)Poll /jobs/{id} to track the result. See Jobs for a reusable polling
helper.
const response = await fetch(`${BASE_URL}/jobs/${jobId}`, {
headers,
})
if (!response.ok) {
throw new Error(await response.text())
}
const body = await response.json()
const job = body.result
const images = job.images ?? []response = requests.get(f"{BASE_URL}/jobs/{job_id}", headers=headers)
response.raise_for_status()
job = response.json()["result"]
images = job.get("images", [])