Enterprise: Decorator Endpoint
Overview
This endpoint helps to decorate a room according to prompt passed
Request
--request POST 'https://modelslab.com/api/v1/enterprise/interior/room_decorator' \
Make a POST
request to https://modelslab.com/api/v1/enterprise/interior/room_decorator 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 | The text prompt describing the content you want in the generated image | string |
init_image | Link to the Initial Image of the room | string |
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 | Prompt strength when using init_image 1.0 corresponds to full destruction of information in the init image. | float |
base64 | Get response as base64 string, default: false | boolean options: true or false |
num_inference_steps | The number of denoising steps. The acceptable values are 21, 31, or 41 | integer (21, 31, or 41) |
guidance_scale | The scale for classifier-free guidance. The minimum is 1 and the maximum is 20 | integer (1 to 20) |
temp | Create temp image link. This link is valid for 24 hours. | 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. | int |
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 value |
Example
Body
Body
{
"key":"",
"init_image": "https://upcdn.io/12a1yeE/raw/WhatsApp%20Image%202024-04-04%20at%208.06.42%20AM.jpeg",
"prompt": "luxury badroom, table, red carpet, wodden floor",
"negative_prompt": "bad quality",
"seed": 0,
"guidance_scale": 8,
"strength": 0.99,
"num_inference_steps": 51,
"base64": false,
"temp": false,
"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://upcdn.io/12a1yeE/raw/WhatsApp%20Image%202024-04-04%20at%208.06.42%20AM.jpeg",
"prompt": "luxury badroom, table, red carpet, wodden floor",
"negative_prompt": "bad quality",
"seed": 0,
"guidance_scale": 8,
"strength": 0.99,
"num_inference_steps": 51,
"base64": false,
"temp": false,
"webhook":null,
"track_id": null
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://modelslab.com/api/v1/enterprise/interior/room_decorator", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
<?php
$payload = [
"key" => "",
"init_image" => "https://upcdn.io/12a1yeE/raw/WhatsApp%20Image%202024-04-04%20at%208.06.42%20AM.jpeg",
"prompt" => "luxury badroom, table, red carpet, wodden floor",
"negative_prompt" => "bad quality",
"seed" => 0,
"guidance_scale" => 8,
"strength" => 0.99,
"num_inference_steps" => 51,
"base64"=> false,
"temp" => false,
"webhook" => null,
"track_id" => null
];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://modelslab.com/api/v1/enterprise/interior/room_decorator',
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/interior/room_decorator',
'headers': {
'Content-Type': 'application/json'
},
body: JSON.stringify({
"key":"",
"init_image": "https://upcdn.io/12a1yeE/raw/WhatsApp%20Image%202024-04-04%20at%208.06.42%20AM.jpeg",
"prompt": "luxury badroom, table, red carpet, wodden floor",
"negative_prompt": "bad quality",
"seed": 0,
"guidance_scale": 8,
"strength": 0.99,
"num_inference_steps": 51,
"base64": false,
"temp": false,
"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/interior/room_decorator"
payload = json.dumps({
"key":"",
"init_image": "https://upcdn.io/12a1yeE/raw/WhatsApp%20Image%202024-04-04%20at%208.06.42%20AM.jpeg",
"prompt": "luxury badroom, table, red carpet, wodden floor",
"negative_prompt": "bad quality",
"seed": 0,
"guidance_scale": 8,
"strength": 0.99,
"num_inference_steps": 51,
"base64": false,
"temp": false,
"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 \"init_image\": \"https://upcdn.io/12a1yeE/raw/WhatsApp%20Image%202024-04-04%20at%208.06.42%20AM.jpeg\",\n \"prompt\": \"luxury badroom, table, red carpet, wodden floor\",\n \"negative_prompt\": \"bad quality\",\n \"seed\": 0,\n \"guidance_scale\": 8,\n \"strength\": 0.99,\n \"num_inference_steps\": 51,\n \"base64\": false,\n \"temp\": false,\n \"webhook\":null,\n \"track_id\": null\n}");
Request request = new Request.Builder()
.url("https://modelslab.com/api/v1/enterprise/interior/room_decorator")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.addHeader("X-API-Key", "{{token}}")
.build();
Response response = client.newCall(request).execute();
Response
Example Response
{
"status": "success",
"generationTime": 10.1,
"id": 278,
"output": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/3ffcf7b3-34e2-4fcf-8c61-7b60bf81df37.png"
],
"proxy_links": [
"https://cdn2.stablediffusionapi.com/generations/3ffcf7b3-34e2-4fcf-8c61-7b60bf81df37.png"
],
"meta": {
"room_image": "https://upcdn.io/12a1yeE/raw/WhatsApp%20Image%202024-04-04%20at%208.06.42%20AM.jpeg",
"prompt": "luxury badroom, table, red carpet, wodden floor",
"seed": 3750372664,
"guidance_scale": 8,
"strength": 0.99,
"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"
}
}