Upscale
API documentation and implementation examples for the Upscale model.
Part of the Image To Image / Upscale collection
API Endpoint
/v1/image-to-image/upscaleRequest Parameters
faceboolean
Whether to enhance faces in the image
image_url(Required)string
URL of the image to be upscaled
Code Examples
const apiKey = "YOUR_API_KEY"; fetch("https://api.stockimg.ai/v1/image-to-image/upscale", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${apiKey}` }, body: JSON.stringify({ "face": true, "image_url": "example string" }) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));
Response Example
{ "image": { "content_type": "example string", "file_data": "example string", "file_name": "example string", "file_size": 1, "height": 1, "url": "example string", "width": 1 } }
Response Fields
image(Required)object
content_typestring
Content type/MIME type of the image
file_datastring
Base64-encoded image data (if applicable)
file_namestring
Name of the image file
file_sizeinteger
Size of the image file in bytes
heightinteger
Height of the image in pixels
urlstring
URL of the upscaled image
widthinteger
Width of the image in pixels