Generate Image
Generate a realistic image of a person wearing specified clothing.
Endpoint
Section titled “Endpoint”POST /generate_imageRequest body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
selfie_base64 | string | Yes | Base64-encoded selfie image |
clothing_description | string | Yes | Description of clothing to try on |
clothing_image_url | string | No | URL of a reference clothing image |
mode | string | Yes | "studio" (white background) or "environment" (contextual) |
Example request
Section titled “Example request”curl -X POST https://mcll3bnfubyazfg6wekv3xc6fi0dgpyk.lambda-url.us-east-1.on.aws/generate_image \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "selfie_base64": "BASE64_ENCODED_IMAGE", "clothing_description": "Black leather jacket with white t-shirt underneath", "mode": "studio" }'With clothing reference image
Section titled “With clothing reference image”curl -X POST https://mcll3bnfubyazfg6wekv3xc6fi0dgpyk.lambda-url.us-east-1.on.aws/generate_image \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "selfie_base64": "BASE64_ENCODED_IMAGE", "clothing_description": "Oversized denim jacket", "clothing_image_url": "https://example.com/jacket.jpg", "mode": "environment" }'Response
Section titled “Response”| Field | Type | Description |
|---|---|---|
image_base64 | string | Base64-encoded generated image |
mime_type | string | Image MIME type (e.g. "image/jpeg") |
Example response
Section titled “Example response”{ "image_base64": "/9j/4AAQSkZJRgABAQ...", "mime_type": "image/jpeg"}studio
Section titled “studio”Generates the person against a clean white/studio background. Best for product photography and professional shots.
environment
Section titled “environment”Generates the person in a contextual environment (street, office, etc.). Best for lifestyle imagery.
- Processing time: 10-30 seconds depending on complexity
- The selfie should be a clear, well-lit photo showing at least the upper body
- Clothing descriptions that are specific tend to produce better results
- Including a
clothing_image_urlsignificantly improves accuracy
Error responses
Section titled “Error responses”{ "error": "selfie_base64 is required"}{ "error": "clothing_description is required"}