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.
labelsstring
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
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.
//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" ]}
List of objects that our model used to identify objects inside in image and create a mask image accordingly.