# Floor Editor

Edit or replace flooring within an image with the floor\_editor endpoint. This tool enables users to change floor types and textures, helping them visualize different materials in a given space.

## ENDPOINT&#x20;

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

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

{% hint style="info" %} <mark style="color:blue;">Floor Editor feature of HomeDesignsAI! With the Floor Editor, you can customize and redesign the flooring of your home with ease.</mark>
{% endhint %}

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

### Request

<table><thead><tr><th width="195">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 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>texture_image</code></strong></mark><br>file[ .jpg, .jpeg, .png] </td><td>The texture image should be uploaded according to your preference.</td><td>The image will be processed by the API. (Image size is not required.)    <strong>(Required Parameter)</strong></td></tr><tr><td><mark style="color:red;"><strong><code>no_of_texture</code></strong></mark></td><td>The number of textures must be either 1 X 1, 2 X 2, <br>3 X 3, or 4 X 4.</td><td>The number of textures can be changed according to your preference. <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;">**`texture_image`**</mark>

<table><thead><tr><th width="327">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>The texture_image field is required.</td><td>whether the texture_image is required to get the results.</td></tr><tr><td>The texture_image field must be a file of type: jpeg, png, jpg</td><td>sNoWktPI0bBy-hBiRyrKaDmkk</td></tr></tbody></table>

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

<table><thead><tr><th width="327">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>no_of_texture field required</td><td>no_of_texture not provided</td></tr><tr><td>no_of_texture value is not a valid enumeration member; permitted: <br>1 X 1, 2 X 2, 3 X 3, or 4 X 4.</td><td>sNoWktPI0bBy-hBiRyrKaDmkk</td></tr></tbody></table>
{% 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/generativebucketapi/UserGenerations/cristian/input-20230901-085649876484.png",
    "output_images": [
            "https://storage.googleapis.com/generativebucketapi/UserGenerations/cristian/20230901-085649876484-1.png"
            

    ]
}

</code></pre>

{% endtab %}
{% endtabs %}
