# Create Mask Image

Generate a mask image to isolate specific objects in a photo. The create\_maskimage endpoint allows for a precise selection of areas or items to edit or remove, essential for detailed design work.

## ENDPOINT&#x20;

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

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

{% hint style="info" %} <mark style="color:blue;">Creating a mask image involves creating an image with black and white areas that correspond to the areas you want to be transparent or opaque in the target image.</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 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>labels</code></strong></mark> <mark style="color:green;"><code>string</code></mark></td><td>Select labels based on the options available in the image.</td><td>A string of object names separated by a pipe (|). Each object in the list will be detected in the image, and a corresponding mask will be generated for it. <br><br>For example, floor|wall will detect both "floor" and "wall" in the image.<br><br>For more objects, please check the Objects List Tab         <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;">**`labels`**</mark>

<table><thead><tr><th width="327">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>Labels are required.</td><td>Please select the required parameters.</td></tr><tr><td>Please enter valid labels</td><td>Please ensure you've entered the correct label. Valid labels should match items visible in the image, such as Chair, Sofa, Table, etc.</td></tr></tbody></table>
{% endtab %}

{% tab title="Response" %}

```json
{
    "success": {
        "masked_image": "https://storage.googleapis.com/generativeartbucket/UserGenerations/cristian/mask/input-9b251339-d3ca-4a08-a68a-061b6e7ea554-2025-10-29-09-29-52.png"
    }
}
```

{% endtab %}

{% tab title="Objects List" %}
**List of objects that our model used to identify objects inside in image and create a mask image accordingly.**

```
"wall",
"building",
"sky",
"floor",
"tree",
"ceiling",
"road",
"bed ",
"windowpane",
"grass",
"cabinet",
"sidewalk",
"person",
"earth",
"door",
"table",
"mountain",
"plant",
"curtain",
"chair",
"car",
"water",
"painting",
"sofa",
"shelf",
"house",
"sea",
"mirror",
"rug",
"field",
"armchair",
"seat",
"fence",
"desk",
"rock",
"wardrobe",
"lamp",
"bathtub",
"railing",
"cushion",
"base",
"box",
"column",
"signboard",
"chest of drawers",
"counter",
"sand",
"sink",
"skyscraper",
"fireplace",
"refrigerator",
"grandstand",
"path",
"stairs",
"runway",
"case",
"pool table",
"pillow",
"screen door",
"stairway",
"river",
"bridge",
"bookcase",
"blind",
"coffee table",
"toilet",
"flower",
"book",
"hill",
"bench",
"countertop",
"stove",
"palm",
"kitchen island",
"computer",
"swivel chair",
"boat",
"bar",
"arcade machine",
"hovel",
"bus",
"towel",
"light",
"truck",
"tower",
"chandelier",
"awning",
"streetlight",
"booth",
"television receiver",
"airplane",
"dirt track",
"apparel",
"pole",
"land",
"bannister",
"escalator",
"ottoman",
"bottle",
"buffet",
"poster",
"stage",
"van",
"ship",
"fountain",
"conveyer belt",
"canopy",
"washer",
"plaything",
"swimming pool",
"stool",
"barrel",
"basket",
"waterfall",
"tent",
"bag",
"minibike",
"cradle",
"oven",
"ball",
"food",
"step",
"tank",
"trade name",
"microwave",
"pot",
"animal",
"bicycle",
"lake",
"dishwasher",
"screen",
"blanket",
"sculpture",
"hood",
"sconce",
"vase",
"traffic light",
"tray",
"ashcan",
"fan",
"pier",
"crt screen",
"plate",
"monitor",
"bulletin board",
"shower",
"radiator",
"glass",
"clock",
"flag"
```

{% endtab %}
{% endtabs %}


---

# 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/create-mask-image.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.
