For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

POST /create_maskimage

An API URL would be like https://homedesigns.ai/api/v2/create_maskimage

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.

An API request must be in the form-data format.

Request

Parameters & Data Type
Value
Description

image

file[ .jpg, .jpeg, .png] / base64 Image string

-

The image to be processed by the API. The image dimensions must be 512x512 pixels or greater for optimal results. (Required Parameter)

labels string

Select labels based on the options available in the image.

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. For example, floor|wall will detect both "floor" and "wall" in the image. For more objects, please check the Objects List Tab (Required Parameter)

Parameters & Errors

image

Error Messages
Reason

Image field required

Image not provided

Invalid image size. The image width and height must be 512x512 or greater than 512x512 pixels.

Image Size Not Proper.

Invalid image format. Only PNG, JPEG and JPG images are allowed.

Image Format not valid.

labels

Error Messages
Reason

Labels are required.

Please select the required parameters.

Please enter valid labels

Please ensure you've entered the correct label. Valid labels should match items visible in the image, such as Chair, Sofa, Table, etc.

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

List of objects that our model used to identify objects inside in image and create a mask image accordingly.

Last updated