Prompt Generator
Generate AI-optimized prompts for architectural visualization. Upload a building image and get professionally crafted prompts designed specifically for SDXL (Stable Diffusion XL) to achieve stunning architecture renders.
Endpoint
HTTP Method
POST https://api.mnmlai.dev/v1/prompt-generator
Request
Send a POST request with multipart/form-data containing your building image and optional keywords to generate an optimized prompt for architectural visualization.
Required Parameters
Parameter | Type | Description |
---|---|---|
image | File | The building image to analyze and generate prompts for (multipart/form-data) |
Optional Parameters
Parameter | Type | Default | Description |
---|---|---|---|
prompt | String | "" | Keywords or phrases to emphasize in the generated prompt |
Response
The Prompt Generator endpoint analyzes your image and returns an optimized prompt immediately. No status checking is required as the response is synchronous.
Success Response (200 OK)
{
"status": "success",
"message": "Photo of modern residential building with clean geometric facade, large floor-to-ceiling windows, concrete and glass materials, minimalist architectural design, urban residential setting, natural daylight, professional architectural photography, wide-angle perspective, high-resolution exterior view",
"prompt": "modern glass facade"
}
Field | Type | Description |
---|---|---|
status | String | Request status ("success" or "error") |
message | String | The generated SDXL-optimized prompt for architectural visualization |
prompt | String | The original user-provided keywords that were incorporated |
Examples
Basic Example
curl -X POST https://api.mnmlai.dev/v1/prompt-generator \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "image=@/path/to/building.jpg"
Example with Keywords
curl -X POST https://api.mnmlai.dev/v1/prompt-generator \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "image=@/path/to/building.jpg" \
-F "prompt=modern glass facade sustainable design"
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('prompt', 'modern glass facade sustainable design');
const response = await axios.post(
'https://api.mnmlai.dev/v1/prompt-generator',
form,
{
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
...form.getHeaders()
}
}
);
console.log('Generated Prompt:', response.data.message);
console.log('Original Keywords:', response.data.prompt);
Python Example
import requests
url = 'https://api.mnmlai.dev/v1/prompt-generator'
files = {
'image': open('building.jpg', 'rb')
}
data = {
'prompt': 'modern glass facade sustainable design'
}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.post(url, headers=headers, files=files, data=data)
result = response.json()
print(f"Generated Prompt: {result['message']}")
print(f"Original Keywords: {result['prompt']}")
Best Practices
Image Requirements
- • Use clear, well-lit images of buildings or architectural structures
- • Minimum size: 1KB, Maximum size: 8MB
- • Supported formats: JPEG, PNG, GIF, WebP
- • Ensure the architectural elements are clearly visible
Prompt Optimization Tips
- • Provide specific keywords to influence the generated prompt
- • Use architectural terminology (materials, styles, lighting)
- • Keep keyword phrases concise and relevant
- • The AI will incorporate your keywords while maintaining prompt quality
Usage Tips
- • Generated prompts are optimized for SDXL models
- • Prompts focus on architectural visualization and rendering quality
- • Use the generated prompts directly with AI image generation tools
- • Each request consumes 1 credit from your account
Error Handling
Common Error Responses
// 400 Bad Request - Missing image file
{
"status": "error",
"code": "MISSING_IMAGE",
"message": "Image file is required"
}
// 400 Bad Request - Invalid image type
{
"status": "error",
"code": "INVALID_IMAGE_TYPE",
"message": "Invalid image type",
"details": {
"receivedType": "text/plain",
"allowedTypes": ["image/jpeg", "image/png", "image/gif", "image/webp"]
}
}
// 400 Bad Request - Image too large
{
"status": "error",
"code": "IMAGE_TOO_LARGE",
"message": "Image file is too large",
"details": {
"size": 10485760,
"maxSize": 8388608,
"unit": "bytes"
}
}
// 400 Bad Request - Insufficient credits
{
"status": "error",
"code": "NO_CREDITS",
"message": "You do not have enough credits to use this feature",
"details": {
"credits": 0
}
}
// 401 Unauthorized - Invalid API key
{
"status": "error",
"code": "UNAUTHORIZED",
"message": "User ID not found in request"
}
// 500 Internal Server Error - API failure
{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred",
"details": {
"error": "OpenAI API call failed: 429 Too Many Requests",
"timestamp": "2025-07-19T11:27:14.310Z"
}
}
Related Endpoints
Use your generated prompts with these AI-powered design tools: