Skip to main content

Upscale API

The Upscale API provides functionality to increase the size of a given image by 2x or 4x. When upscaling to 2K, it applies stable diffusion-based creative upscale logic. However, for generating 4K images, it utilizes GAN-based upscale logic.


Authentication

header
X-Photio-Key : {PHOTIO_API_KEY}

Do you not have an API key yet?

To call the API, you first need to obtain a Photio API key. To get your API key, go to the API Dashboard. After registering your card, you can use the issued API key.


Request Body

VariableTypeRequireDefaultDescription
imagestring-This can be either a image in base64 format or an image URL. Input image for upscale.
upscale_byint2How much do you want to make image bigger x2 or x4.
promptstring""By executing stable diffusion-based high-resolution fix, adding a brief description to the image can lead to higher-quality output.
negative_promptstring"worst quality, low quality, illustration, 3d, 2d, painting, cartoons, sketch"Enter in English any objects or scenarios you do not want to appear in the image. If nothing is entered, a default negative prompt will be used, which includes: "worst quality, low quality, illustration, 3d, 2d, painting, cartoons, sketch."
qualitystring"LOW"Choose from three levels of quality: "LOW", "MIDDLE", "HIGH". The default is "LOW". Setting the quality to "HIGH" will increase the detail quality of the generated image but will also take more time. A "LOW" quality setting results in relatively lower detail quality but faster generation speed.
denoising_strengthfloat0.2This scale represents the similarity score between the input image and the output image, ranging from 0.0 to 1.0. As the score approaches 0, the similarity between the input and output images decreases. Conversely, as it approaches 1.0, the similarity to the previous image increases, though it may appear as if the resolution hasn't increased.
curl --request POST
--url https://api.photio.io/v1/inference/upscale
--header 'X-Photio-Key: {X-Photio-Key}'
--header 'Content-Type: application/json'
--data '{ "image": "https://imagedelivery.net/zea4eJK186SeWjCFHvF-jQ/4038d802-f40e-4f77-0733-dd09308ff800/1k"}'

Response

VariableTypeDescription
status_codeintIn the response, you can find a status value to check the status of the request. A normal response is indicated by 200, authentication issues by 401, and API status problems by a 500 error.
bodystringThe result image data is output as a Base64-encoded string.
Response Example
{
"status_code": Int,
"body": Base64 String
}
  • Our maximum output pixel size is limited by 4K!