Create Room Interior Endpoint
Overview
V5 APIs Create Room Interior endpoint generates room interiror by modifing a picture of the room.
Together with the room image you can add your description of the desired result in a text prompt.
Request
--request POST 'https://modelslab.com/api/v5/interior' \
Make a POST
request to https://modelslab.com/api/v5/interior endpoint and pass the required parameters in the request body.
Body Attributes
Parameter | Description | Values |
---|---|---|
key | Your API Key used for request authorization. | string |
prompt | A text description of the things you want in the generated image. | string |
init_image | Link to the initial image to be used as a reference. | URL |
num_inference_steps | Number of denoising steps. | 21, 31, 41 |
base64 | Indicate if the image is a base64 encoded image. | "yes"/"no" |
guidance_scale | Scale for classifier-free guidance. | Minimum: 1, Maximum: 20 |
Example
Body
Body
{
"key":"",
"init_image" : "https://huggingface.co/lllyasviel/sd-controlnet-mlsd/resolve/main/images/room.png",
"prompt" : "room",
"num_inference_steps" : 21,
"base64" : "no",
"guidance_scale" : 7
}
Request
- JS
- PHP
- NODE
- PYTHON
- JAVA
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
"key": "",
"init_image" : "https://huggingface.co/lllyasviel/sd-controlnet-mlsd/resolve/main/images/room.png",
"prompt" : "room",
"num_inference_steps" : 21,
"base64" : "no",
"guidance_scale" : 7
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://modelslab.com/api/v5/interior", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
<?php
$payload = [
"key" => "",
"init_image" => "https://huggingface.co/lllyasviel/sd-controlnet-mlsd/resolve/main/images/room.png",
"prompt" => "room",
"num_inference_steps" => 21,
"base64" : "no",
"guidance_scale" => 7
];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://modelslab.com/api/v5/interior',
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/v5/interior',
'headers': {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"key": "",
"init_image" : "https://huggingface.co/lllyasviel/sd-controlnet-mlsd/resolve/main/images/room.png",
"prompt" : "room",
"num_inference_steps" : 21,
"base64" : "no",
"guidance_scale" : 7
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
import json
url = "https://modelslab.com/api/v5/interior"
payload = json.dumps({
"key": "",
"init_image" : "https://huggingface.co/lllyasviel/sd-controlnet-mlsd/resolve/main/images/room.png",
"prompt" : "room",
"num_inference_steps" : 21,
"base64" : "no",
"guidance_scale" : 7
})
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 \"init_image\" : \"https://huggingface.co/lllyasviel/sd-controlnet-mlsd/resolve/main/images/room.png\",\n \"prompt\" : \"room\",\n \"num_inference_steps\" : 21,\n \"guidance_scale\" : 7\n}");
Request request = new Request.Builder()
.url("https://modelslab.com/api/v5/interior")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
Response
Example Response
{
"status": "success",
"generationTime": 8.02,
"id": 99044687,
"output": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/0-a29592cc-2c98-46e1-ae7b-bb1d2550a578.png"
],
"meta": {
"prompt": " room",
"model_id": "realistic-vision-v13",
"controlnet_model": "mlsd",
"controlnet_type": "mlsd",
"negative_prompt": "",
"scheduler": "EulerAncestralDiscreteScheduler",
"safety_checker": "no",
"auto_hint": "yes",
"guess_mode": "no",
"strength": 1,
"W": 560,
"H": 752,
"guidance_scale": 7,
"controlnet_conditioning_scale": 1,
"seed": 1972171263,
"multi_lingual": "no",
"use_karras_sigmas": "no",
"algorithm_type": "no",
"safety_checker_type": "sensitive_content_text",
"instant_response": "no",
"tomesd": "no",
"init_image": "https://huggingface.co/lllyasviel/sd-controlnet-mlsd/resolve/main/images/room.png",
"mask_image": null,
"control_image": null,
"vae": null,
"steps": 21,
"full_url": "no",
"upscale": "no",
"n_samples": 1,
"embeddings": null,
"ip_adapter_id": null,
"ip_adapter_scale": 0.6,
"ip_adapter_image": null,
"enhance_prompt": "no",
"enhance_style": null,
"lora": null,
"lora_strength": 1,
"temp": "no",
"base64": "no",
"clip_skip": 1,
"file_prefix": "a29592cc-2c98-46e1-ae7b-bb1d2550a578.png"
},
"tip": "Get 20x faster image generation using enterprise plan. Click here : https://modelslab.com/enterprise"
}