Enterprise: Super Resolution Endpoint
Overview
Super Resolution API returns a super resolution version of an image that is passed to the url
attribute.
Request
--request POST 'https://modelslab.com/api/v1/enterprise/super_resolution/make' \
Send a POST
request to https://modelslab.com/api/v1/enterprise/super_resolution/make endpoint to return the corresponding super resolution image of the image passed.
Body Attributes
Parameter | Description | Values |
---|---|---|
key | Your API Key used for request authorization | string |
init_image | The URL of the image that you want to upscale | URL |
scale | A number for scaling the image | int |
face_enhance | A boolean flag (true/false) for face enhancement feature | true or false |
webhook | Provide a URL to receive a POST API call once the image generation is complete | URL |
track_id | This ID is returned in the response to the webhook API call and will be used to identify the webhook request | integer |
Example
Body
Body Raw
{
"key": "",
"init_image": "https://i.pinimg.com/564x/fc/8e/6a/fc8e6a075f341284b0f44bf1592f9f3c.jpg",
"face_enhance": false,
"scale": 3,
"webhook": null,
"track_id": null
}
Request
- JS
- PHP
- NODE
- PYTHON
- JAVA
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"key": "",
"init_image": "https://i.pinimg.com/564x/fc/8e/6a/fc8e6a075f341284b0f44bf1592f9f3c.jpg",
"face_enhance": false,
"scale": 3,
"webhook": null,
"track_id": null
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://modelslab.com/api/v1/enterprise/super_resolution/make", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
<?php
$payload = [
"key" => "",
"init_image" => "https://i.pinimg.com/564x/fc/8e/6a/fc8e6a075f341284b0f44bf1592f9f3c.jpg",
"face_enhance" => false,
"scale" => 3,
"webhook" => null,
"track_id": null
];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://modelslab.com/api/v1/enterprise/super_resolution/make',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://modelslab.com/api/v1/enterprise/super_resolution/make',
'headers': {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"key": "",
"init_image": "https://i.pinimg.com/564x/fc/8e/6a/fc8e6a075f341284b0f44bf1592f9f3c.jpg",
"face_enhance": false,
"scale": 3,
"webhook": null,
"track_id": null
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
import json
url = "https://modelslab.com/api/v1/enterprise/super_resolution/make"
payload = json.dumps({
"key": "",
"init_image": "https://i.pinimg.com/564x/fc/8e/6a/fc8e6a075f341284b0f44bf1592f9f3c.jpg",
"face_enhance": false,
"scale": 3,
"webhook": None,
"track_id": None
})
headers = {
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"key\": \"\",\n \"url\": \"https://i.pinimg.com/564x/fc/8e/6a/fc8e6a075f341284b0f44bf1592f9f3c.jpg\",\n \"scale\": 3,\n \"webhook\": null,\n \"face_enhance\": false\n}");
Request request = new Request.Builder()
.url("https://modelslab.com/api/v1/enterprise/super_resolution/make")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "{{token}}")
.build();
Response response = client.newCall(request).execute();
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": {
"init_image": "https://i.pinimg.com/564x/fc/8e/6a/fc8e6a075f341284b0f44bf1592f9f3c.jpg",
"prompt": "masterpiece, best quality, highres",
"watermark": "no",
"upscale_factor": 4,
"controlnet_scale": 0.8,
"controlnet_scale_decay": 1,
"condition_scale": 6,
"tile_size": 200,
"denoise_strength": 0.35,
"temp": "no",
"base64": "no",
"file_prefix": "d449de6f-67a3-4461-9213-ce86890e3a3c.jpg",
"steps": 20
}
}