# Room Composer

Arrange and visualize different decor items within a room. The room\_composer endpoint places multiple pieces of furniture and decor into a space, ensuring a cohesive, harmonious design setup.

## ENDPOINT&#x20;

<mark style="color:green;">**`POST`**</mark>  <mark style="color:purple;">**`/room_composer`**</mark>

An API URL would be like <mark style="color:blue;"><https://homedesigns.ai/api/v2/room\\_composer></mark>

{% hint style="info" %} <mark style="color:blue;">Room Composer is a feature within HomeDesignsAI that allows you to create and design interior spaces within a room.</mark>
{% endhint %}

{% tabs %}
{% tab title="Request" %}
{% hint style="info" %} <mark style="color:blue;">An API request must be in the</mark> <mark style="color:orange;">**`form-data`**</mark> <mark style="color:blue;">format.</mark>
{% endhint %}

### Request

<table><thead><tr><th width="232">Parameters &#x26; Data Type</th><th width="181">Value</th><th>Description</th></tr></thead><tbody><tr><td><p><mark style="color:red;"><strong><code>image</code></strong></mark>  </p><p>file[ .jpg, .jpeg, .png] / base64 Image <mark style="color:green;"><code>string</code></mark></p></td><td>-</td><td>The image is to be processed by the API. The image dimensions must be 512x512 pixels or greater for optimal results. <strong>(Required Parameter)</strong></td></tr><tr><td><mark style="color:red;"><strong><code>masked_image</code></strong></mark><br>file[ .jpg, .jpeg, .png] / base64 Image <mark style="color:green;"><code>string</code></mark></td><td>-</td><td>The image to be processed by the API. The image dimensions must be 512x512 pixels or greater for optimal results. <a href="https://homedesigns.ai/get-mask-image">Click Here</a> to generate a mask image <a href="https://youtu.be/2wmHz2ze0t4">Video Tutorial.</a> <strong>(Required Parameter)</strong></td></tr><tr><td><mark style="color:red;"><strong><code>design_style</code></strong></mark></td><td>Design style should be as per design type</td><td>Defines the overall aesthetic style you want to achieve, such as 'Bohemian', 'Industrial', 'Scandinavian', etc. <strong>(Required Parameter)</strong></td></tr><tr><td><mark style="color:red;"><strong><code>room_type</code></strong></mark></td><td>Room style should be as per design type</td><td>Required if design_type is Interior, Indicates the type of room for which the design is intended, like 'Living Room', 'Bedroom', 'Kitchen', etc <strong>(Required Parameter)</strong></td></tr><tr><td><mark style="color:red;"><strong><code>ai_intervention</code></strong></mark></td><td>Mid, Extreme</td><td>indicates the level of AI intervention in the design process. "Mid" means minimal changes, while "Extreme" allows for significant alterations to the original design. <strong>(Required Parameter)</strong></td></tr></tbody></table>
{% endtab %}

{% tab title="Errors" %}

### Parameters & Errors

<mark style="color:red;">**`image`**</mark>

<table><thead><tr><th width="327">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>Image field required</td><td>Image not provided</td></tr><tr><td>Invalid image size. The image width and height must be 512x512 or greater than 512x512 pixels.</td><td>Image Size Not Proper.</td></tr><tr><td>Invalid image format. Only PNG, JPEG and JPG images are allowed.</td><td>Image Format not valid.</td></tr></tbody></table>

<mark style="color:red;">**`masked_image`**</mark>

<table><thead><tr><th width="327">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>masked_image field required</td><td>masked_image not provided</td></tr><tr><td>Invalid image size. The image width and height must be 512x512 or greater than 512x512 pixels.</td><td>masked_image Size must be greater than 512x512.</td></tr><tr><td>Invalid image format. Only PNG, JPEG and JPG images are allowed.</td><td>masked_image Format not valid.</td></tr></tbody></table>

<mark style="color:red;">**`design_style`**</mark>

<table><thead><tr><th width="327">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>design_style field required</td><td>Design_style not provided</td></tr><tr><td>design_style should be in ['No Style', 'Eclectic', 'Modern'...] this array will replaced dynamically as per your design_type</td><td>Design_style not provided properly</td></tr></tbody></table>

<mark style="color:red;">**`room_type`**</mark>

| Error Messages                                                                                                                   | Reason                           |
| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| room\_type field required when design\_type is Interior                                                                          | room\_type not provided          |
| room\_type should be in \['Living room', 'Bedroom', 'Bathroom'...] this array will replaced dynamically as per your design\_type | room\_type not provided properly |

<mark style="color:red;">**`ai_intervention`**</mark>

| Error Messages                                                                        | Reason                                 |
| ------------------------------------------------------------------------------------- | -------------------------------------- |
| ai\_intervention field required                                                       | ai\_intervention not provided          |
| ai\_intervention value is not a valid enumeration member; permitted: 'Mid', 'Extreme' | ai\_intervention not provided properly |
| {% endtab %}                                                                          |                                        |

{% tab title="Response" %}

<pre class="language-json"><code class="lang-json"><strong>
</strong><strong>//Output should be in list of array depends on no of designs as shown below:
</strong>
{
    "input_image": "https://storage.googleapis.com/generativeartbucket/UserGenerations/cristian/input-9a87be38-4cbf-4a6f-9e8c-434c0a8f73ef-2024-05-30-11-08-30.png",
    "output_images": [
            "https://storage.googleapis.com/generativeartbucket/UserGenerations/cristian/output-9a87be38-4cbf-4a6f-9e8c-434c0a8f73ef-1.png",
            "https://storage.googleapis.com/generativeartbucket/UserGenerations/cristian/output-9a87be38-4cbf-4a6f-9e8c-434c0a8f73ef-2.png",
            "https://storage.googleapis.com/generativeartbucket/UserGenerations/cristian/output-9a87be38-4cbf-4a6f-9e8c-434c0a8f73ef-2.png"
    ]
}



</code></pre>

{% endtab %}
{% endtabs %}
