Try On Outfit
Generate a realistic image of a person wearing an outfit, from a reference image and/or description. Guardrails are enforced by Nano Banana 2.
Endpoint
Section titled “Endpoint”POST /try_on_outfitRequest 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 |
outfit_base64 | string | No | Base64-encoded reference clothing image (alternative to clothing_image_url) |
mode | string | Yes | "reference_environment" (match the reference image scene) or "model_shot" (clean white background) |
store_image | boolean | No | If true, image is stored permanently. If false (default), image auto-deletes after 24 hours. |
Example request
Section titled “Example request”curl -X POST https://mcll3bnfubyazfg6wekv3xc6fi0dgpyk.lambda-url.us-east-1.on.aws/try_on_outfit \ -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": "model_shot" }'With clothing reference image
Section titled “With clothing reference image”curl -X POST https://mcll3bnfubyazfg6wekv3xc6fi0dgpyk.lambda-url.us-east-1.on.aws/try_on_outfit \ -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": "reference_environment" }'Response
Section titled “Response”| Field | Type | Description |
|---|---|---|
image_url | string | Direct URL of the generated image. Auto-deletes after 24 hours when store_image=false (default), permanent when true. |
image_id | string | Unique image identifier (e.g. "img_a1b2c3d4e5f6..."). Use with GET /images/:id to retrieve metadata. |
mime_type | string | Image MIME type (e.g. "image/jpeg") |
Example response
Section titled “Example response”{ "image_url": "https://superstyle-user-images.s3.us-east-1.amazonaws.com/temp/ss_abc123/generate-image/20260228T153000Z_a1b2c3.jpg", "image_id": "img_a1b2c3d4e5f6a1b2c3d4e5f6", "mime_type": "image/jpeg"}model_shot
Section titled “model_shot”Generates the person against a clean white studio background. Best for product photography and professional headshots.
reference_environment
Section titled “reference_environment”Places the person into the scene and environment of the reference image. Best for lifestyle imagery where you want to match the vibe of an inspiration photo.
- 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"}