Skip to main content

Specific Floor Planning Endpoint

Overview

Generate a rendered image of a floor plan for a room based on the provided input.

Request

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

Make a POST request to https://modelslab.com/api/v6/interior/floor_planning 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 floor plan image.String
init_imageA URL to the initial image of the room to base the floor plan 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 is used to reproduce results, same seed will give you same image in return again. Pass null for a random number.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://i.pinimg.com/564x/f6/73/9d/f6739dc3fec02fa4019d1045fdad4d47.jpg",
"prompt": "rendering floor plan of the apartment layout,top view,white background,masterpiece, kitchen, living room, sofa, chair,bedroom,car best quality, extremely detailed,best illustration, best shadow",
"seed": 0,
"guidance_scale": 8,
"strength": 0.99,
"num_inference_steps": 51,
"base64": false,
"temp": false,
"specific_object": null,
"webhook": null,
"track_id": null
}

Request

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
"key":"",
"init_image": "https://i.pinimg.com/564x/f6/73/9d/f6739dc3fec02fa4019d1045fdad4d47.jpg",
"prompt": "rendering floor plan of the apartment layout,top view,white background,masterpiece, kitchen, living room, sofa, chair,bedroom,car best quality, extremely detailed,best illustration, best shadow",
"seed": 0,
"guidance_scale": 8,
"strength": 0.99,
"num_inference_steps": 51,
"base64": false,
"temp": false,
"specific_object": null,
"webhook": null,
"track_id": null
});

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};

fetch("https://modelslab.com/api/v6/interior/floor_planning", 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": 298,
"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"
}
}