Skip to main content

Super Resolution Endpoint

Overview

Stable Diffusion V6 APIs Super Resolution API returns a super resolution version of an image that is passed to the url attribute.

Super Resolution endpoint result

Request

--request POST 'https://modelslab.com/api/v6/image_editing/super_resolution' \

Send a POST request to https://modelslab.com/api/v6/image_editing/super_resolution endpoint to return the corresponding super resolution image of the image passed.

Watch the how-to video to see it in action.

Body Attributes

ParameterDescriptionValues
keyYour API Key used for request authorizationstring
urlThe URL of the image that you want to upscaleURL
scaleThe scaling factor for the image (min 1 - max 4)integer (1 to 4)
model_idThe upscale model to use. The default is realesr-general-x4v3. Supported models include:- RealESRGAN_x4plus: 4x upscaling model - RealESRNet_x4plus: 4x upscaling model - RealESRGAN_x4plus_anime_6B: 4x Anime upscaling model - RealESRGAN_x2plus: 2x upscaling model - realesr-general-x4v3: 4x upscaling model
webhookProvide a URL to receive a POST API call once the image generation is completeURL
face_enhanceA boolean flag for the face enhancement featureboolean (true/false)

The following upscale models are supported:

Model IDDescription
RealESRGAN_x4plus4x upscaling model
RealESRNet_x4plus4x upscaling model
RealESRGAN_x4plus_anime_6B4x Anime upscaling model
RealESRGAN_x2plus2x upscaling model
realesr-general-x4v34x upscaling general model

Want more upscale models? Request a custom model by contacting us at our Discord server.

Example

Body

Body Raw
{
"key": "",
"url": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/7cppXZYqwxzOSAAthk5FQTXvx9oMLi-metaNzlmMDFiOGYtNjVmZi00ZDZiLWJlMmQtYzdhNDM2OWY0ZjU2LTIucG5n-.png",
"scale": 3,
"webhook": null,
"face_enhance": false
}

Request

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
"key": "",
"url": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/7cppXZYqwxzOSAAthk5FQTXvx9oMLi-metaNzlmMDFiOGYtNjVmZi00ZDZiLWJlMmQtYzdhNDM2OWY0ZjU2LTIucG5n-.png",
"scale": 3,
"webhook": null,
"face_enhance": false
});

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};

fetch("https://modelslab.com/api/v6/image_editing/super_resolution", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));

Response

{
"status": "success",
"generationTime": 7.421302318572998,
"id": 235706,
"output": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/84363904-e07e-4f96-af2b-b20a92540386_out.png"
],
"proxy_links": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/84363904-e07e-4f96-af2b-b20a92540386_out.png",
"meta": {
"ext": "png",
"face_enhance": "0",
"file_name": "84363904-e07e-4f96-af2b-b20a92540386.png",
"file_prefix": "84363904-e07e-4f96-af2b-b20a92540386",
"model_name": "realesr-general-x4v3",
"scale": "3",
"url": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/7cppXZYqwxzOSAAthk5FQTXvx9oMLi-metaNzlmMDFiOGYtNjVmZi00ZDZiLWJlMmQtYzdhNDM2OWY0ZjU2LTIucG5n-.png"
}
}