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://stablediffusionapi.com/api/v5/interior' \
Make a POST
request to https://stablediffusionapi.com/api/v5/interior endpoint and pass the required parameters in the request body.
Body Attributes
Parameter | Description |
---|---|
key | Your API Key used for request authorization |
prompt | Text prompt with description of the things you want in the image to be generated |
init_image | Link to the initial image |
steps | Number of denoising steps |
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",
"steps" : 50,
"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",
"steps" : 50,
"guidance_scale" : 7
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://stablediffusionapi.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",
"steps" => 50,
"guidance_scale" => 7
];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://stablediffusionapi.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://stablediffusionapi.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",
"steps" : 50,
"guidance_scale" : 7
})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
import json
url = "https://stablediffusionapi.com/api/v5/interior"
payload = json.dumps({
"key": "",
"init_image" : "https://huggingface.co/lllyasviel/sd-controlnet-mlsd/resolve/main/images/room.png",
"prompt" : "room",
"steps" : 50,
"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 \"steps\" : 50,\n \"guidance_scale\" : 7\n}");
Request request = new Request.Builder()
.url("https://stablediffusionapi.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.352862119674683,
"id": 14756394,
"output": [
"https://pub-8b49af329fae499aa563997f5d4068a4.r2.dev/generations/3124f636-efb2-46b8-a0d1-0580eeff8653-0.png"
],
"meta": {
"prompt": " room",
"model_id": "realistic-vision-v13",
"controlnet_model": "mlsd",
"controlnet_type": "mlsd",
"negative_prompt": "",
"scheduler": "EulerAncestralDiscreteScheduler",
"safetychecker": "no",
"auto_hint": "yes",
"guess_mode": "no",
"strength": 0.55,
"W": 512,
"H": 512,
"guidance_scale": 3,
"seed": 3969949281,
"multi_lingual": "no",
"init_image": "https://huggingface.co/lllyasviel/sd-controlnet-mlsd/resolve/main/images/room.png",
"mask_image": null,
"steps": 50,
"full_url": "no",
"upscale": "no",
"n_samples": 1,
"embeddings": null,
"lora": null,
"outdir": "out",
"file_prefix": "3124f636-efb2-46b8-a0d1-0580eeff8653"
}
}