Style Transfer
Generate stunning interior architectural designs with AI. Transform building images into photorealistic interior renderings.
Endpoint
HTTP Method
POST https://api.mnmlai.dev/v1/style/transfer
Request
Send a POST request with multipart/form-data containing your building image and design specifications.
Required Parameters
Parameter | Type | Description |
---|---|---|
image | File | The source image to apply style to (multipart/form-data) |
reference_image | File | The style reference image (multipart/form-data) |
Optional Parameters
Parameter | Type | Default | Description |
---|---|---|---|
prompt | String | "Optional" | Apply artistic watercolor style |
strength | Number | 0.7 | Style transfer strength (0-1) |
preserve_structure | Boolean | true | Preserve the original structure of the source image |
color_preservation | Number | 0.3 | Color preservation strength (0-1) |
Response
The Style Transfer endpoint processes your image asynchronously. You'll receive a request ID that you can use to check the status and retrieve the generated design.
Success Response (200 OK)
{
"status": "success",
"id": "b09ssvpzzhrj00cmzt1bykjzp1",
"prompt": "Modern interior design with glass facade"
}
Examples
Basic Example
curl -X POST https://api.mnmlai.dev/v1/style/transfer \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "image=@/path/to/building.jpg" \
-F "reference_image=@/path/to/reference.jpg" \
-F "prompt=Modern interior design with glass facade"
Advanced Example with All Parameters
curl -X POST https://api.mnmlai.dev/v1/style/transfer \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "image=@/path/to/building.jpg" \
-F "reference_image=@/path/to/style.jpg" \
-F "prompt=Apply artistic watercolor style" \
-F "strength=0.7" \
-F "preserve_structure=true" \
-F "color_preservation=0.3"
Node.js Example
const FormData = require('form-data');
const fs = require('fs');
const axios = require('axios');
const form = new FormData();
form.append('image', fs.createReadStream('building.jpg'));
form.append('reference_image', fs.createReadStream('style.jpg'));
form.append('prompt', 'Apply artistic watercolor style');
form.append('strength', '0.7');
form.append('preserve_structure', 'true');
form.append('color_preservation', '0.3');
const response = await axios.post(
'https://api.mnmlai.dev/v1/style/transfer',
form,
{
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
...form.getHeaders()
}
}
);
console.log('Request ID:', response.data.id);
Python Example
import requests
url = 'https://api.mnmlai.dev/v1/style/transfer'
files = {
'image': open('building.jpg', 'rb')
'reference_image': open('style.jpg', 'rb')
}
data = {
'prompt': 'Apply artistic watercolor style',
'strength': '0.7',
'preserve_structure': 'true',
'color_preservation': '0.3'
}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post(url, headers=headers, files=files, data=data)
result = response.json()
print(f"Request ID: {result['id']}")
Processing Status
After submitting your request, use the Status Check endpoint with the returned ID to monitor processing progress:
Status Check Endpoint
GET https://api.mnmlai.dev/v1/status/{id}
Error Handling
Common Error Responses
// 400 Bad Request - Missing required parameters
{
"error": "Missing required field: image"
}
// 401 Unauthorized - Invalid API key
{
"error": "Invalid authentication credentials"
}
// 413 Payload Too Large - File size exceeded
{
"error": "File size exceeds maximum limit of 10MB"
}
// 429 Too Many Requests - Rate limit exceeded
{
"error": "Rate limit exceeded. Please try again later"
}