Virtual Staging
Stage empty spaces with virtual furniture and decor
Endpoint
POST https://api.mnmlai.dev/v1/virtual-staging-ai
Request
Send a POST request with multipart/form-data containing your empty room image and staging specifications.
Required Parameters
Parameter | Type | Description |
---|---|---|
image | File | The empty room image to stage. Must be JPEG, PNG, or GIF. Max 8MB. Min width 256px. |
prompt | String | Description of desired furniture and staging (max 500 characters) |
Optional Parameters
Parameter | Type | Default | Description |
---|---|---|---|
reference_image | File | - | Optional reference image for style guidance |
roomtype | String | - | Type of room (e.g., "living room", "bedroom", "kitchen", "office") |
roomstyle | String | - | Design style (e.g., "modern", "traditional", "minimalist", "luxury") |
scenario | String | "standard" | Staging approach: "creative" for imaginative design or "standard" for realistic staging |
additional_prompt | String | - | Additional details to append to the main prompt |
seed | Number | Random | Seed for reproducible results (0-1000000) |
Response
The Virtual Staging AI endpoint processes your image and generates a staged version. It costs 2 credits per request and returns a base64 encoded image.
Success Response (200 OK)
{
"status": "success",
"message": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...",
"prompt": "Modern living room with sofa and coffee table"
}
Examples
Basic Example
curl -X POST https://api.mnmlai.dev/v1/virtual-staging-ai \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "image=@/path/to/empty_room.jpg" \
-F "reference_image=@/path/to/style_reference.jpg" \
-F "prompt=Modern living room with sofa and coffee table"
Advanced Example with All Parameters
curl -X POST https://api.mnmlai.dev/v1/virtual-staging-ai \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "image=@/path/to/empty_room.jpg" \
-F "reference_image=@/path/to/style_reference.jpg" \
-F "prompt=Comfortable seating area with natural lighting" \
-F "roomtype=living room" \
-F "roomstyle=modern" \
-F "scenario=creative" \
-F "additional_prompt=with plants and warm textures" \
-F "seed=123456"
Example with Reference Image
curl -X POST https://api.mnmlai.dev/v1/virtual-staging-ai \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "image=@/path/to/empty_room.jpg" \
-F "reference_image=@/path/to/style_reference.jpg" \
-F "prompt=Elegant furniture arrangement" \
-F "roomtype=living room" \
-F "roomstyle=luxury" \
-F "scenario=creative"
Node.js Example
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const formData = new FormData();
formData.append('image', fs.createReadStream('/path/to/empty_room.jpg'));
formData.append('reference_image', fs.createReadStream('/path/to/style_reference.jpg'));
formData.append('prompt', 'Modern living room with sofa and coffee table');
formData.append('roomtype', 'living room');
formData.append('roomstyle', 'modern');
formData.append('scenario', 'creative');
formData.append('seed', 123456);
const config = {
method: 'post',
url: 'https://api.mnmlai.dev/v1/virtual-staging-ai',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
...formData.getHeaders()
},
data: formData
};
axios(config)
.then(response => console.log(JSON.stringify(response.data)))
.catch(error => console.log(error));
Python Example
import requests
url = "https://api.mnmlai.dev/v1/virtual-staging-ai"
payload = {
'prompt': 'Modern living room with sofa and coffee table',
'roomtype': 'living room',
'roomstyle': 'modern',
'scenario': 'creative',
'seed': 123456
}
files = {
'image': open('/path/to/empty_room.jpg', 'rb'),
'reference_image': open('/path/to/style_reference.jpg', 'rb')
}
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post(url, headers=headers, data=payload, files=files)
print(response.json())
Best Practices
For best results, use high-quality, well-lit images of empty rooms with clear views of the space to be staged.
Detailed prompts yield better results. Be specific about the furniture style, arrangement, and mood you want to achieve.
Use the roomtype and roomstyle parameters to help the AI understand the space and desired aesthetic.
Use a seed value for reproducible results. Provide the same seed with identical parameters to get consistent outputs.
Upload a reference image along with your empty room to guide the styling and furniture choices.
Error Handling
For detailed information on error responses, status codes, and best practices for handling errors, see our comprehensive API Errors documentation.
Virtual Staging Specific Errors
// 400 Bad Request - Missing required parameters
{
"status": "error",
"code": "MISSING_IMAGE",
"message": "Image file is required"
}
// 400 Bad Request - Prompt validation
{
"status": "error",
"code": "PROMPT_TOO_LONG",
"message": "Prompt must be less than 500 characters",
"details": {
"promptLength": 650,
"maxLength": 500
}
}
// 400 Bad Request - Image too large
{
"status": "error",
"code": "IMAGE_TOO_LARGE",
"message": "Image file is too large",
"details": {
"size": 9437184,
"maxSize": 8388608,
"unit": "bytes"
}
}
// 400 Bad Request - Image too narrow
{
"status": "error",
"code": "IMAGE_TOO_NARROW",
"message": "Image width must be at least 256px",
"details": {
"width": 180,
"minWidth": 256,
"unit": "pixels"
}
}
// 400 Bad Request - Invalid image type
{
"status": "error",
"code": "INVALID_IMAGE_TYPE",
"message": "Invalid image type",
"details": {
"receivedType": "image/bmp",
"allowedTypes": ["image/jpeg", "image/png", "image/gif"]
}
}
// 400 Bad Request - Insufficient credits
{
"status": "error",
"code": "NO_CREDITS",
"message": "You do not have enough credits to use this feature",
"details": {
"credits": 0
}
}
Credits & Limits
Resource Requirements
- Cost: 2 credits per virtual staging request
- Image Size: Maximum 8MB file size
- Image Dimensions: Minimum width of 256px
- Supported Formats: JPEG, PNG, GIF
- Prompt Length: Maximum 500 characters
- Processing Time: Typically 10-30 seconds depending on image complexity