Exterior Restorer Endpoint
Overview
This endpoint allows you to convert bad exterior to good exterior .
Request
--request POST 'https://modelslab.com/api/v6/interior/exterior_restorer' \
Make a POST
request to https://modelslab.com/api/v6/interior/exterior_restorer endpoint and pass the required parameters in the request body.
Body Attributes
Parameter | Description | Values |
---|---|---|
key | Your API Key used for authenticating your request. | String |
prompt | A text prompt describing the content you want in the generated floor plan image. | String |
init_image | A URL to the initial image of the room to base the floor plan on. | URL |
negative_prompt | Negative prompts are descriptions of things we don't want in our image. Examples include NSFW content, extra limbs, distorted faces, poor quality, or anything else we want to avoid. | String |
strength | The degree to which the prompt influences the initial image. 1.0 corresponds to full destruction of the initial image details. | float |
base64 | Specifies whether the response should be returned as a base64 string. Defaults to false . | boolean options: true or false |
num_inference_steps | The number of denoising steps. Acceptable values are 21 , 31 , or 41 . | Integer (21, 31, or 41) |
guidance_scale | The scale for classifier-free guidance. Minimum is 1 , and maximum is 20 . | Integer (1 to 20) |
temp | Indicates if temporary links should be used, valid for 24 hours. Defaults to false . | boolean options: true/false |
seed | Seed is used to reproduce results, same seed will give you same image in return again. Pass null for a random number. | Integer or null |
webhook | A URL to receive a POST API call once the image generation is complete. | URL |
track_id | An ID returned in the API response, used to identify the webhook request. | Integer value |
Example
Body
Body
{
"key":"",
"init_image": "https://imagedelivery.net/PP4qZJxMlvGLHJQBm3ErNg/d9cd96d4-8fb0-4728-f83f-21d4c575c900/768",
"prompt": "Redesign the building exterior in a modern minimalist architectural style",
"negative_prompt": "blurry, low resolution, bad lighting, poorly drawn furniture, distorted proportions, messy room, unrealistic colors, extra limbs, missing furniture, bad anatomy, low detail, pixelated, grainy, artifacts, oversaturated, asymmetry, ugly, cartoonish, out of frame, duplicate objects"
"seed": null,
"guidance_scale": 7.5,
"strength": 0.4,
"num_inference_steps": 51,
"base64": "no",
"temp": false,
"webhook": null,
"id": 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://imagedelivery.net/PP4qZJxMlvGLHJQBm3ErNg/d9cd96d4-8fb0-4728-f83f-21d4c575c900/768",
"prompt": "Redesign the building exterior in a modern minimalist architectural style",
"negative_prompt": "blurry, low resolution, bad lighting, poorly drawn furniture, distorted proportions, messy room, unrealistic colors, extra limbs, missing furniture, bad anatomy, low detail, pixelated, grainy, artifacts, oversaturated, asymmetry, ugly, cartoonish, out of frame, duplicate objects",
"seed": null,
"guidance_scale": 7.5,
"strength": 0.4,
"num_inference_steps": 51,
"base64": "no",
"temp": false,
"webhook": null,
"id": null,
"track_id": null
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://modelslab.com/api/v6/interior/exterior_restorer", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
<?php
$payload = [
"key" => "",
"init_image" => "https://imagedelivery.net/PP4qZJxMlvGLHJQBm3ErNg/d9cd96d4-8fb0-4728-f83f-21d4c575c900/768",
"prompt" => "Redesign the building exterior in a modern minimalist architectural style",
"negative_prompt" => "blurry, low resolution, bad lighting, poorly drawn furniture, distorted proportions, messy room, unrealistic colors, extra limbs, missing furniture, bad anatomy, low detail, pixelated, grainy, artifacts, oversaturated, asymmetry, ugly, cartoonish, out of frame, duplicate objects",
"seed" => null,
"guidance_scale" => 7.5,
"strength" => 0.4,
"num_inference_steps" => 51,
"base64" => "no",
"temp" => false,
"webhook" => null,
"id" => null,
"track_id" => null
];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://modelslab.com/api/v6/interior/exterior_restorer',
CURLOPT_RETURNTRANSFER => true,
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/v6/interior/exterior_restorer',
'headers': { 'Content-Type': 'application/json' },
body: JSON.stringify({
"key": "",
"init_image": "https://imagedelivery.net/PP4qZJxMlvGLHJQBm3ErNg/d9cd96d4-8fb0-4728-f83f-21d4c575c900/768",
"prompt": "Redesign the building exterior in a modern minimalist architectural style",
"negative_prompt": "blurry, low resolution, bad lighting, poorly drawn furniture, distorted proportions, messy room, unrealistic colors, extra limbs, missing furniture, bad anatomy, low detail, pixelated, grainy, artifacts, oversaturated, asymmetry, ugly, cartoonish, out of frame, duplicate objects",
"seed": null,
"guidance_scale": 7.5,
"strength": 0.4,
"num_inference_steps": 51,
"base64": "no",
"temp": false,
"webhook": null,
"id": 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/v6/interior/exterior_restorer"
payload = {
"key": "",
"init_image": "https://imagedelivery.net/PP4qZJxMlvGLHJQBm3ErNg/d9cd96d4-8fb0-4728-f83f-21d4c575c900/768",
"prompt": "Redesign the building exterior in a modern minimalist architectural style",
"negative_prompt": "blurry, low resolution, bad lighting, poorly drawn furniture, distorted proportions, messy room, unrealistic colors, extra limbs, missing furniture, bad anatomy, low detail, pixelated, grainy, artifacts, oversaturated, asymmetry, ugly, cartoonish, out of frame, duplicate objects",
"seed": None,
"guidance_scale": 7.5,
"strength": 0.4,
"num_inference_steps": 51,
"base64": "no",
"temp": False,
"webhook": None,
"id": None,
"track_id": None
}
headers = { 'Content-Type': 'application/json' }
response = requests.post(url, headers=headers, data=json.dumps(payload))
print(response.text)
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"key\":\"\",\n \"init_image\": \"https://i.pinimg.com/736x/b2/94/76/b29476a69497bbc870d48a531e0008db.jpg\",\n \"prompt\": \"rendering floor plan of the apartment layout,top view,white background,masterpiece, kitchen, living room, sofa, chair,bedroom,car best quality, extremely detailed,best illustration, best shadow\",\n \"seed\": 0,\n \"guidance_scale\": 8,\n \"strength\": 0.99,\n \"num_inference_steps\": 51,\n \"base64\": false,\n \"temp\": false,\n \"specific_object\": null,\n \"scale_down\": 6,\n \"opacity\": 0.7,\n \"padding_right\": 10,\n \"padding_down\": 10,\n \"webhook\": null,\n \"track_id\": null\n}");
Request request = new Request.Builder()
.url("https://modelslab.com/api/v6/interior/exterior_restorer")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "{{token}}")
.build();
Response response = client.newCall(request).execute();
Response
- Success
- Processing
- Error
{
"status": "success",
"generationTime": 10.1,
"id": 298,
"output": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/ef717940-ed2f-417d-9c85-454bf4c6082e-0.png"
],
"proxy_links": [
"https://cdn2.stablediffusionapi.com/generations/3ffcf7b3-34e2-4fcf-8c61-7b60bf81df37.png"
],
"meta": {
"room_image": "https://i.pinimg.com/736x/b2/94/76/b29476a69497bbc870d48a531e0008db.jpg",
"prompt": "luxury badroom, table, red carpet, wodden floor",
"seed": 3750372664,
"guidance_scale": 7.5,
"strength": 0.4,
"num_inference_steps": 51,
"base64": "no",
"temp": "no",
"specific_object": null,
"watermark": "no",
"scale_down": 6,
"opacity": 0.7,
"padding_right": 10,
"padding_down": 10,
"file_prefix": "3ffcf7b3-34e2-4fcf-8c61-7b60bf81df37",
"outdir": "out"
}
}
{
"status": "processing",
"tip": "Your image is processing in background, you can get this image using fetch API",
"eta": 20,
"message": "Try to fetch request after seconds estimated",
"fetch_result": "https://modelslab.com/api/v6/interior/fetch/298",
"id": 298,
"output": [],
"meta": {
"room_image": "https://i.pinimg.com/736x/b2/94/76/b29476a69497bbc870d48a531e0008db.jpg",
"prompt": "Redesign the building exterior in a modern minimalist architectural style",
"seed": 2029792393,
"guidance_scale": 7.5,
"strength": 0.4,
"num_inference_steps": 51,
"base64": "no",
"temp": "no",
"specific_object": null,
"watermark": "no",
"scale_down": 6,
"opacity": 0.7,
"padding_right": 10,
"padding_down": 10,
"file_prefix": "3ffcf7b3-34e2-4fcf-8c61-7b60bf81df37",
"outdir": "out"
},
"future_links": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/ef717940-ed2f-417d-9c85-454bf4c6082e-0.png"
]
}
{
"status": "error",
"message": "Error message"
}