# Magic redesign

Magic Redesign lets you re imagine any space in seconds. Just upload a photo and type what you’d like to change; our conversational AI will instantly transform furniture, layout, colors, materials, and more based on your request. Whether you're exploring new styles or planning real updates, it's a fast and intuitive way to see your ideas come to life.

## ENDPOINT

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

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

{% hint style="info" %} <mark style="color:$primary;">Use this endpoint to transform your space effortlessly by describing your requirements. Our Magic Redesign API uses conversational AI to instantly generate redesigned visuals based on your input.</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="301">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;"><code>design_action</code></mark></p><p><mark style="color:green;"><code>string</code></mark></p><p></p></td><td>The design_action should be in [Redesign, Virtual Staging, Remodel, Renovate, Remove Furniture, Paint Walls, Landscaping, Exterior Design, Others].</td><td>Magic Redesign uses advanced AI to generate stunning designs based on your instructions.<strong>(Required Parameter)</strong></td></tr><tr><td><mark style="color:red;"><code>custom_instruction</code></mark><br><mark style="color:green;"><code>string</code></mark></td><td>           -</td><td>This field allows users to describe what kind of image they want to generate.<br>The AI will process the prompt and generate an image accordingly.<strong>(Required Parameter)</strong></td></tr><tr><td><mark style="color:red;"><code>optimizePrompt</code></mark><br><mark style="color:green;"><code>string</code></mark></td><td>Should be Either True or False</td><td>Not required, It will take the value as true by default.</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_action`**</mark>

<table><thead><tr><th width="289">Error Messages</th><th>Reason</th></tr></thead><tbody><tr><td>design_action field required</td><td>design_action not provided</td></tr><tr><td>design_action value is not a valid enumeration member; permitted: 'Renovate'</td><td>design_action not provided properly <br>The design_action should be in [Redesign, Virtual Staging, Remodel, Renovate, Remove Furniture, Paint Walls, Landscaping, Exterior Design, Others]</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.</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 <mark style="color:blue;">`/magic_redesign`</mark> and  <mark style="color:blue;">`/magic_redesign/status_check`</mark> Endpoints

<mark style="background-color:green;">**`GET`**</mark>  <https://homedesigns.ai/api/v2/magic_redesign/status_check/k6rgnd3yh1rmt0cx8c4txnz6fg>

1. **Step 1: Pass Required Parameters to&#x20;**<mark style="color:$info;">**`/magic_redesign`**</mark>
   * When you send a request to the <mark style="color:$info;">**`/magic_redesign`**</mark>endpoint with all required parameters, it will generate a `queue_id`.
   * Example response from <mark style="color:$info;">**`/magic_redesign`**</mark>:

     ```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.

***

2. **Step 2: Use `queue_id` in&#x20;**<mark style="color:$info;">**`/magic_redesign/status_check`**</mark>**Endpoint**
   * Append the generated `queue_id` to the <mark style="color:$info;">**`/magic_redesign/status_check`**</mark>endpoint to check the processing status.
   * Example request:

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

***

3. **Step 3: Review the Status Response**
   * The <mark style="color:$info;">**`/magic_redesign/status_check`**</mark> 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:

     ```json
     {
         "created_at": "2025-05-26T12:39:19.094Z",
         "status": "starting"
     }
     ```
   * If the status is still pending **`"processing"`**, wait a few moments and send the request again.
   * Example response:
   * ```
     {
         "created_at": "2026-03-31T09:54:38.303Z",
         "started_at": "2026-03-31T09:54:38.322847005Z",
         "status": "processing"
     }
     ```
   * Once all the statuses marked as `IN_QUEUE`  **`"starting"`** and **`processing`** 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/generativeartbucket/UserGenerations/cristian/input-10584fd0-c9f1-40b3-bd3d-3272157b56d3-2026-03-31-08-36-27.png",
         "output_images": ["https://storage.googleapis.com/generativeartbucket/UserGenerations/cristian/output-10584fd0-c9f1-40b3-bd3d-3272157b56d3-2026-03-31-08-36-27-1.png"
         ]
     }
     ```

***

4. **Step 4: Get the Final Result**
   * Continue checking the status by re sending the request to the <mark style="color:blue;">`/magic_redesign/status_check`</mark> endpoint until the status changes to `"SUCCESS"`.
   * When the status is `"SUCCESS"`, you will receive the final result in the response.

\ <br>


---

# 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/magic-redesign.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.
