# Precision

This precision endpoint is designed for filling in missing objects or replacing parts of a design. It requires two images: the actual image and a masked image. You'll need to create functionality for masking the image to indicate the areas that need inpainting.

## ENDPOINT

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

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

{% hint style="info" %} <mark style="color:blue;">Use this to automatically fill in the missing or damaged part of the design.</mark>&#x20;
{% 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 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><p><mark style="color:red;"><strong><code>design_type</code></strong></mark></p><p><mark style="color:green;"><code>string</code></mark></p></td><td>Interior, Exterior, Garden</td><td>Specifies the type of area you want to design. API users must specify whether they are designing an interior space, an exterior area, or a garden. <strong>(Required Parameter)</strong></td></tr><tr><td><p><mark style="color:red;"><strong><code>no_design</code></strong></mark> </p><p><mark style="color:green;"><code>integer</code></mark></p></td><td>Min - 1, Max - 4</td><td>Specifies the number of design variations you want the API to generate. The minimum is 1 and the maximum is 4. <strong>(Required Parameter)</strong></td></tr><tr><td><p><mark style="color:red;"><strong><code>design_style</code></strong></mark></p><p><mark style="color:green;"><code>string</code></mark></p></td><td>Design style should be as per design type. </td><td><p>Defines the overall aesthetic style you want to achieve, such as 'Bohemian', 'Industrial', 'Scandinavian', etc. </p><p><strong>(Required Parameter)</strong></p><p>Here you can see the more design styles.</p><p><a href="/pages/hlpt4St15vcflR1t0g6p">Interior Design Styles</a></p><p><a href="/pages/hlpt4St15vcflR1t0g6p">Exterior Design Styles </a><br><a href="/pages/tcu0MAfYZU86XuQ2WNk1">Garden Design Styles</a></p></td></tr><tr><td><p><mark style="color:red;"><strong><code>room_type</code></strong></mark>  </p><p> <mark style="color:green;"><code>string</code></mark></p></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.<br><br><a href="/pages/1IXJoKeg6ULX6nvsTHfi">Click here</a> to see more room types.</td></tr><tr><td><mark style="color:red;"><strong><code>house_angle</code></strong></mark>  <mark style="color:green;"><code>string</code></mark> </td><td>House angle should be as per design type</td><td>Required if design_type is Exterior, Indicates the angle of house for which the design is intended, like Side of House, Front of House, Back of House.<br><br><a href="/pages/cN6kJ8nYAAKpEHpDbbU1">Click here</a> to see more house angles.</td></tr><tr><td><mark style="color:red;"><strong><code>garden_type</code></strong></mark>   <mark style="color:green;"><code>string</code></mark></td><td>Garden type should be as per design type</td><td>Required if design_type is Garden, Indicates the type of garden for which the design is intended, like 'Backyard', 'Front Yard', 'Courtyard', etc.<br><br><a href="/pages/DxYYfPi6zoGtknbbOa1F">Click here</a> to see more garden types.</td></tr><tr><td><p><mark style="color:red;"><strong><code>prompt</code></strong></mark> </p><p> <mark style="color:green;"><code>null</code></mark>  or  <mark style="color:green;"><code>string</code></mark></p></td><td>Write a Custom Prompt</td><td>An optional text prompt that can guide the AI in generating the design. This could be something like "Create a cozy and warm living room".</td></tr><tr><td><mark style="color:red;"><strong><code>strength</code></strong></mark> <mark style="color:green;"><code>integer</code></mark></td><td></td><td>The strength field must be between 1 and 10</td></tr></tbody></table>
{% endtab %}

{% tab title="Errors" %}

### Parameters & Errors

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

<table><thead><tr><th width="289">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="289">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 786X786.</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_type`**</mark>

<table><thead><tr><th width="289">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>Design_type field required</td><td>Design type not provided</td></tr><tr><td>Design_type value is not a valid enumeration member; permitted: 'Interior', 'Exterior', 'Garden'</td><td>design type not provided properly</td></tr></tbody></table>

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

<table><thead><tr><th width="289">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>room_type field required when design_type is Interior</td><td>room_type not provided</td></tr><tr><td>room_type should be in ['Living room', 'Bedroom', 'Bathroom'...] this array will replaced dynamically as per your design_type</td><td>room_type not provided properly</td></tr></tbody></table>

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

<table><thead><tr><th width="289">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>house_angle field required when design_type is Exterior</td><td>house_angle not provided</td></tr><tr><td>house_angle should be in ['Side of House', 'Front of House', 'Back of House'...] this array will replaced dynamically as per your design_type</td><td>house_angle not provided properly</td></tr></tbody></table>

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

<table><thead><tr><th width="289">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>garden_type field required when design_type is Garden</td><td>garden_type not provided</td></tr><tr><td>garden_type should be in ['Backyard', 'Patio', 'Terrace'...] this array will replaced dynamically as per your design_type</td><td>garden_type not provided properly</td></tr></tbody></table>

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

<table><thead><tr><th width="289">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;">**`no_design`**</mark>

<table><thead><tr><th width="289">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>no_design field required</td><td>no_design not provided</td></tr><tr><td>no_design value is not a valid enumeration member; permitted: 1, 2, 3, 4</td><td>no_design not provided properly</td></tr></tbody></table>

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

<table><thead><tr><th width="289">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>prompt field required</td><td>prompt not provided</td></tr></tbody></table>

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

<table><thead><tr><th width="289">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>If you selected strength field then required</td><td>The strength field must be between 1 and 10.</td></tr></tbody></table>
{% endtab %}

{% tab title="Response" %}

```json
//Output should be in list of array depends on no of designs as shown below:

{
    "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",
            "https://storage.googleapis.com/generativebucketapi/UserGenerations/cristian/20230901-085649876484-2.png",
            "https://storage.googleapis.com/generativebucketapi/UserGenerations/cristian/20230901-085649876484-3.png"
    ]
}
```

{% endtab %}
{% endtabs %}

## [What is Masked Image?](/homedesignsai-api-documentation/others/what-is-masked-image.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.homedesigns.ai/homedesignsai-api-documentation/core-apis/precision.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
