Mixture of Experts (MoE)

⚠️ Deprecated — v4.0 (Mixture of Experts) is being phased out.

Please migrate to ArchDiffusion v4.3-Ultra or v4.3-Fast for continued support and the latest improvements.

Adaptive rendering API for architecture, interiors, exteriors, and landscapes. Automatically applies expert transformations based on image and prompt.

Endpoint

HTTP Method
POST https://api.mnmlai.dev/v1/mixture-of-experts

Request

Send a POST request with multipart/form-data containing your source image and design specifications to transform architectural visualizations across different domains.

Required Parameters

ParameterTypeDescription
imageFileThe source architectural image to transform (multipart/form-data)
promptStringDescription of the desired transformation (max 2000 characters)

Optional Parameters

ParameterTypeDefaultDescription
expert_nameString"exterior"Expert category ("exterior", "interior", "masterplan", "landscape", "plans", "virtual-staging", "edit")
imageTypeString"model"Source image type: "model" or "drawing"
form_controlNumber0.8Style strength override when needed (recommended 0.1–1)
seedNumberRandomRandom seed for reproducible results

Response

The Mixture of Experts (MoE) endpoint processes your architectural image asynchronously. You'll receive a request ID that you can use to check the status and retrieve the generated visualization.

Success Response (200 OK)

{
  "status": "success",
  "id": "b09ssvpzzhrj00cmzt1bykjzp1",
  "prompt": "convert to Mediterranean villa style",
  "credits": 95
}

Examples

Basic Example

curl -X POST https://api.mnmlai.dev/v1/mixture-of-experts \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: multipart/form-data" \
  -F "image=@/path/to/architectural-image.jpg" \
  -F "prompt=convert to Mediterranean villa style"

Advanced Example with All Parameters

curl -X POST https://api.mnmlai.dev/v1/mixture-of-experts \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: multipart/form-data" \
  -F "image=@/path/to/architectural-image.jpg" \
  -F "prompt=convert to Mediterranean villa style" \
  -F "expert_name=exterior" \
  -F "imageType=model" \
  -F "masterplanVersion=3D" \
  -F "formControl=0.8" \
  -F "promptMode=auto" \
  -F "seed=12345"

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('architectural-image.jpg'));
form.append('prompt', 'convert to Mediterranean villa style');
form.append('expert_name', 'exterior');
form.append('imageType', 'model');
form.append('masterplanVersion', '3D');
form.append('formControl', '0.8');
form.append('promptMode', 'auto');
form.append('seed', '12345');

const response = await axios.post(
  'https://api.mnmlai.dev/v1/mixture-of-experts',
  form,
  {
    headers: {
      'Accept': 'application/json',
      'Authorization': 'Bearer YOUR_API_KEY',
      ...form.getHeaders()
    }
  }
);

console.log('Request ID:', response.data.id);
console.log('Remaining credits:', response.data.credits);

Python Example

import requests

url = 'https://api.mnmlai.dev/v1/mixture-of-experts'

files = {
    'image': open('architectural-image.jpg', 'rb')
}

data = {
    'prompt': 'convert to Mediterranean villa style',
    'expert_name': 'exterior',
    'imageType': 'model',
    'masterplanVersion': '3D',
    'formControl': '0.8',
    'promptMode': 'auto',
    'seed': '12345'
}

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']}")
print(f"Remaining credits: {result['credits']}")

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}

Best Practices

Image Guidelines

  • • Use high-quality architectural images for better results
  • • Supported formats: JPEG, PNG, WebP
  • • Maximum file size: 8MB
  • • Images with clear architectural features work best

Prompt Tips

  • • Be specific about architectural styles (e.g., "Mediterranean villa", "modern minimalist")
  • • Include material preferences ("brick facade", "glass curtain wall")
  • • Mention landscape elements ("add softscape to courtyard", "rooftop garden")
  • • Keep prompts under 2000 characters for optimal processing

Performance Tips

  • • Use render_speed=true for faster processing
  • • Adjust expert_strength between 0.5-1.5 for best balance
  • • Use consistent seeds for reproducible results
  • • Choose the appropriate expert_name for your content type

Error Handling

Common Error Responses

// 400 Bad Request - Missing required parameters
{
  "status": "error",
  "code": "MISSING_IMAGE",
  "message": "Image file is required"
}

// 400 Bad Request - Missing prompt
{
  "status": "error",
  "code": "MISSING_PROMPT",
  "message": "Prompt is required"
}

// 400 Bad Request - Insufficient credits
{
  "status": "error",
  "code": "NO_CREDITS",
  "message": "You do not have enough credits to use this feature",
  "details": {
    "credits": 0
  }
}

// 400 Bad Request - File too large
{
  "status": "error",
  "code": "IMAGE_TOO_LARGE",
  "message": "Image file is too large",
  "details": {
    "size": 10485760,
    "maxSize": 8388608,
    "unit": "bytes"
  }
}

// 400 Bad Request - Invalid file type
{
  "status": "error",
  "code": "INVALID_IMAGE_TYPE",
  "message": "Invalid image type",
  "details": {
    "receivedType": "image/bmp",
    "allowedTypes": ["image/jpeg", "image/png", "image/gif", "image/webp"]
  }
}

// 401 Unauthorized - Invalid API key
{
  "status": "error",
  "code": "UNAUTHORIZED",
  "message": "Invalid authentication credentials"
}

// 500 Internal Server Error
{
  "status": "error",
  "code": "INTERNAL_SERVER_ERROR",
  "message": "An unexpected error occurred",
  "details": {
    "error": "Processing failed",
    "timestamp": "2025-01-26T10:30:00.000Z"
  }
}

Related Endpoints

Explore other AI-powered design tools: