# Virtual staging

Virtual staging is a technique used to generate images that add furniture, decor, and other elements to empty or outdated spaces, creating a more appealing and visually attractive representation of the property

## ENDPOINT

<mark style="color:green;">**`POST`**</mark>  <mark style="color:purple;">**`/virtual_staging`**</mark>  &#x20;

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

{% hint style="info" %} <mark style="color:blue;">Instantly stage spaces with realistic furniture and decor to visualize their potential.</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><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</td><td>Specifies the type of area you want to design. API users must specify whether they are designing an interior space. <strong>(Required Parameter)</strong></td></tr><tr><td><p><mark style="color:red;"><strong><code>ai_intervention</code></strong></mark></p><p><mark style="color:green;"><code>string</code></mark></p></td><td>Very Low, Low, Mid, Extreme</td><td>Indicates the level of AI intervention in the design process. "Very Low" means minimal changes, while "Extreme" allows for significant alterations to the original design. <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="../design-scope/exteriors/design-styles-for-exteriors">Interior Design Styles</a></p><p><br></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="../design-scope/interiors/room-types">Click here</a> to see more room types.</td></tr><tr><td><p><mark style="color:red;"><code>custom_instruction</code></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></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;">**`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.'</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;">**`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;">**`ai_intervention`**</mark>

<table><thead><tr><th width="289">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>ai_intervention field required</td><td>ai_intervention not provided</td></tr><tr><td>ai_intervention value is not a valid enumeration member; permitted: 'Very Low', 'Low', 'Mid', 'Extreme'</td><td>ai_intervention 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;">**`status_check`**</mark>&#x20;

<table><thead><tr><th width="289">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>Please Enter a Valid Queue ID</td><td>Invalid queue ID or <strong><code>queue_id</code> is valid for the 30 minutes if you try after then showing error {</strong>Please Enter a Valid Queue ID}</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 %}

#### Process for Using `/virtual_staging` and `/status_check` Endpoints

<mark style="background-color:green;">**`GET`**</mark>  [https://homedesigns.ai/api/v2/virtual\_staging/status\_check/](https://homedesigns.ai/api/v2/virtual_staging/status_check/0dc62f7f-85f1-4d50-94e2-b5040375d96f-u1)<mark style="color:blue;">ag61df25b20-e263-4bae-vbgbae8-ecccaafgbbd687-ugf1</mark>

1. **Step 1: Pass Required Parameters to `/virtual_staging`**
   * When you send a request to the `/virtual_staging` endpoint with all required parameters, it will generate a `queue_id`.
   * Example response from `/virtual_staging`:

     ```json
     {
         "id": "ag61df25b20-e263-4bae-vbgbae8-ecccaafgbbd687-ugf1",
         "status": "IN_QUEUE"
     }
     ```
   * The `queue_id` (`id` value) from this response will be used in subsequent requests.\
     \&#xNAN;**`queue_id` is valid for the 30 minutes if you try after then showing error {**&#x50;lease Enter a Valid Queue ID}\
     ![](https://2806262628-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUQBvuff51gXfTbQ9Glvk%2Fuploads%2FNue0DOEYI7HQ0EYtbGrl%2Fimage.png?alt=media\&token=c61dca5e-d44b-4252-adeb-0017a6e9a68a)

***

2. **Step 2: Use `queue_id` in `/status_check` Endpoint**
   * Append the generated `queue_id` to the `/status_check` endpoint to check the processing status.
   * Example request:

     ```bash
     GET /virtual_staging/status_check/ag61df25b20-e263-4bae-vbgbae8-ecccaafgbbd687-ugf1
     ```

***

3. **Step 3: Review the Status Response**
   * The `/status_check` endpoint will return the current status of the process. Initially, the status might indicate that the process is still in IN\_QUEUE, wait a few moments and send the request again.
   * Example response:

     ```json
     {
         "data": {
             "delayTime": 747,
             "id": "ag61df25b20-e263-4bae-vbgbae8-ecccaafgbbd687-ugf1",
             "status": "IN_QUEUE",
             "workerId": "y2sfmofed1df23jp26ho"
         },
         "http_status": 200
     }


     ```
   * The **`/virtual_staging`**`/status_check` endpoint will return the current status of the process. Initially, the status might indicate that the process is still in `"starting"` wait a few moments and send the request again.     \
     Example response:     \
     {     \
     "created\_at": "2025-05-26T12:39:19.094Z",     \
     "status": "starting"     \
     }
   * If the status is still pending "`IN_PROGRESS"`, wait a few moments and send the request again.
   * Example response:
   * ```
     {
         "data": {
             "delayTime": 747,
             "id": "ag61df25b20-e263-4bae-vbgbae8-ecccaafgbbd687-ugf1",
             "status": "IN_PROGRESS",
             "workerId": "y2sfmofed1df23jp26ho"
         },
         "http_status": 200
     }
     ```
   * Once all the statuses marked as `IN_QUEUE` and `IN_PROGRESS` are completed, after hitting the requests one by one, you will see the results as follows:

     ```
     //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"
         ]
     }
     ```

***

4. **Step 4: Get the Final Result**
   * Continue checking the status by resending the request to the `/status_check` endpoint until the status changes to `"SUCCESS"`.
   * When the status is `"SUCCESS"`, you will receive the final result in the response.

\ <br>
