Skip to main content

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

ParameterDescriptionValues
keyYour API Key used for request authorizationstring
promptThe text prompt describing the content you want in the generated imagestring
init_imageLink to the Initial Image of the roomstring
negative_promptNegative 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
strengthPrompt strength when using init_image 1.0 corresponds to full destruction of information in the init image.float
base64Get response as base64 string, default: falseboolean options: true or false
num_inference_stepsThe number of denoising steps. The acceptable values are 21, 31, or 41integer (21, 31, or 41)
guidance_scaleThe scale for classifier-free guidance. The minimum is 1 and the maximum is 20integer (1 to 20)
tempCreate temp image link. This link is valid for 24 hours.boolean options: true/false
seedSeed is used to reproduce results, same seed will give you same image in return again. Pass null for a random number.int
webhookProvide a URL to receive a POST API call once the image generation is completeURL
track_idThis ID is returned in the response to the webhook API call and will be used to identify the webhook requestinteger 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

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));

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"
}
}