API Documentation
  • Introduction
  • API Reference
  • 🔐Authentication
  • Core APIs
    • Perfect Redesign
    • Beautiful Redesign
    • Creative Redesign
    • Sketch to Render
    • Virtual staging
    • Precision
    • Fill Spaces
    • Decor Staging
    • Furniture Removal
    • Colors & Textures
    • Furniture Finder
    • Full HD
    • Text to design
    • Furniture Creator
    • Design Advisor
    • Sky Colors
    • Design Transfer
    • Floor Editor
    • Paint Visualizer
    • Material Swap
    • Room Composer
    • Design Critique
    • Create Mask Image
    • Download Generated Images
    • Smart Home AI
  • DESIGN SCOPE
    • Interiors
      • Design Styles for Interiors
      • Room Types
      • Colors in Interior Design
      • Explore Material Options for Interior Designs
    • Exteriors
      • Design Styles for Exteriors
      • Copy of Design Styles for Exteriors
      • House angles
      • Exterior Colors
      • Material Options for Exterior Designs
    • Gardens
      • Design Styles for Gardens
      • Garden Types
      • Explore Color Options for Garden Designs
      • Material Options for Garden Designs
  • Data
    • User Details
    • Design Scope
  • Others
    • What is Masked Image?
Powered by GitBook
On this page

Was this helpful?

  1. Core APIs

Material Swap

PreviousPaint VisualizerNextRoom Composer

Last updated 4 months ago

Was this helpful?

This could involve changing the type of material used for a particular element, such as switching from wood to metal for a furniture piece or from traditional tiles to marble for a flooring surface.

ENDPOINT

POST /material_swap

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

Replace materials on surfaces to explore different textures and finishes.

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)

masked_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. to generate a mask image (Required Parameter)

no_design

integer

Min - 2, Max - 5

Specifies the number of design variations you want the API to generate. The minimum is 2 and the maximum is 5. (Required Parameter)

texture_image

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

The texture image should be uploaded according to your preference.

The image to be processed by the API.

(Required Parameter)

no_of_texture

The number of textures must be either The number of textures must be either 1 X 1, 2 X 2, 3 X 3, 4 X 4, 5 X 5.

The number of textures can be changed according to your preference. (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.

masked_image

Error Messages
Reason

masked_image field required

masked_image not provided

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

masked_image Size must be greater than 512x512.

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

masked_image Format not valid.

no_design

Error Messages
Reason

no_design field required

no_design not provided

no_design value is not a valid enumeration member; permitted: 2, 3, 4, 5.

no_design not provided properly

texture_image

Error Messages
Reason

The texture_image field is required.

whether the texture_image is required to get the results.

The texture_image field must be a file of type: jpeg, png, jpg

Image Format is not valid.

no_of_texture

Error Messages
Reason

no_of_texture field required

no_of_texture not provided

no_of_texture value is not a valid enumeration member; permitted: 1 X 1, 2 X 2, 3 X 3, 4 X 4, 5 X 5.

no_of_texture not provided properly


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

{
    "input_image": "https://storage.googleapis.com/generativeartbucket/UserGenerations/cristian/input-9a87be38-4cbf-4a6f-9e8c-434c0a8f73ef-2024-05-30-11-08-30.png",
    "output_images": [
            "https://storage.googleapis.com/generativeartbucket/UserGenerations/cristian/output-9a87be38-4cbf-4a6f-9e8c-434c0a8f73ef-1.png",
            "https://storage.googleapis.com/generativeartbucket/UserGenerations/cristian/output-9a87be38-4cbf-4a6f-9e8c-434c0a8f73ef-2.png",
            "https://storage.googleapis.com/generativeartbucket/UserGenerations/cristian/output-9a87be38-4cbf-4a6f-9e8c-434c0a8f73ef-2.png"
    ]
}


Click Here
Video Tutorial.
Page cover image