Skip to main content

Room Decorator Endpoint

Overview

This endpoint helps decorate a room according to the prompt provided.

Request

--request POST 'https://modelslab.com/api/v6/interior/room_decorator' \

Make a POST request to https://modelslab.com/api/v6/interior/room_decorator endpoint and pass the required parameters in the request body.

Body Attributes

ParameterDescriptionValues
keyYour API Key used for authenticating your request.String
promptA text prompt describing the content you want in the generated room decor image.String
init_imageA URL to the initial image of the room to base the design on.URL
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
strengthThe degree to which the prompt influences the initial image. 1.0 corresponds to full destruction of the initial image details.float
base64Specifies whether the response should be returned as a base64 string. Defaults to false.boolean options: true or false
num_inference_stepsThe number of denoising steps. Acceptable values are 21, 31, or 41.Integer (21, 31, or 41)
guidance_scaleThe scale for classifier-free guidance. Minimum is 1, and maximum is 20.Integer (1 to 20)
tempIndicates if temporary links should be used, valid for 24 hours. Defaults to false.boolean options: true/false
seedSeed for reproducibility. The same seed generates the same image. Use null for a random seed.Integer or null
webhookA URL to receive a POST API call once the image generation is complete.URL
track_idAn ID returned in the API response, 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

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