ConcurredConcurred API

Fashion API

AI-powered fashion image generation — virtual try-on, model creation, background editing, and more

The Fashion API gives you access to 10 AI-powered fashion image generation endpoints through a single Concurred API key. Powered by FASHN, it supports virtual try-on, model creation, background manipulation, image editing, and video generation.

Async Pattern

Unlike the Chat API (which streams text), the Fashion API uses an async submit-and-poll pattern. You submit a job, get a prediction ID, then poll for results. We also provide a convenience subscribe endpoint that handles polling for you via SSE.

Available Models

Model NameDescriptionRequired InputsCreditsSpeed
tryon-v1.6Virtual try-on at 864×1296 resolutionmodel_image, garment_image35-17s
product-to-modelFlat-lay/product image → on-model visualproduct_image3~12s
face-to-modelFace → try-on ready upper-body avatarface_image3~12s
model-createGenerate fashion models from text promptprompt3~12s
model-variationCreate variations of existing model imagesmodel_image38-10s
model-swapReplace model identity, keep clothing/posemodel_image310-12s
reframeSmart aspect ratio adjustment with generative fillimage2~12s
background-changeReplace background with AI-generated sceneimage, prompt2~12s
background-removeRemove background → transparent PNG cutoutimage21-3s
image-to-videoSingle image → fashion video clipimage51-3min

Endpoints Overview

MethodEndpointDescription
POST/api/v1/fashion/runSubmit a generation job (returns prediction ID)
GET/api/v1/fashion/status/:idPoll job status and retrieve results
POST/api/v1/fashion/subscribeSubmit and stream status updates via SSE

Quick Start

# 1. Submit a virtual try-on job
curl -X POST https://agent-heavy.vercel.app/api/v1/fashion/run \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_name": "tryon-v1.6",
    "inputs": {
      "model_image": "https://example.com/person.jpg",
      "garment_image": "https://example.com/shirt.jpg"
    }
  }'
 
# Response: { "data": { "prediction_id": "abc-123", "status": "starting" } }
 
# 2. Poll for results
curl https://agent-heavy.vercel.app/api/v1/fashion/status/abc-123 \
  -H "Authorization: Bearer YOUR_API_KEY"
 
# Response when complete:
# { "data": { "status": "completed", "output": ["https://cdn.fashn.ai/.../output_0.png"] } }

Submit Job

POST /api/v1/fashion/run

Submits a fashion generation job. Returns immediately with a prediction ID.

Request Body

{
  "model_name": "tryon-v1.6",
  "inputs": {
    "model_image": "https://example.com/person.jpg",
    "garment_image": "https://example.com/garment.jpg",
    "category": "auto",
    "mode": "balanced"
  }
}
ParameterTypeRequiredDescription
model_namestringYesOne of the 10 model names listed above
inputsobjectYesModel-specific input parameters (see each model's section below)

Response

{
  "success": true,
  "data": {
    "prediction_id": "123a87r9-4129-4bb3-be18-9c9fb5bd7fc1-u1",
    "status": "starting",
    "model_name": "tryon-v1.6",
    "created_at": 1709500000000
  },
  "meta": {
    "requestId": "uuid",
    "timestamp": "2026-03-04T00:00:00.000Z"
  }
}

Poll Status

GET /api/v1/fashion/status/:id

Check the current status of a prediction and retrieve results when complete.

Status Values

StatusDescription
startingJob is being initialized
in_queueWaiting to be processed
processingModel is actively generating
completedDone — output URLs available
failedFailed — check error field

Response (Completed)

{
  "success": true,
  "data": {
    "prediction_id": "123a87r9-4129-4bb3-be18-9c9fb5bd7fc1-u1",
    "status": "completed",
    "output": [
      "https://cdn.fashn.ai/123a87r9/output_0.png"
    ],
    "error": null
  }
}

Response (Failed)

{
  "success": true,
  "data": {
    "prediction_id": "123a87r9-4129-4bb3-be18-9c9fb5bd7fc1-u1",
    "status": "failed",
    "output": null,
    "error": {
      "name": "ImageLoadError",
      "message": "Error loading model image: Invalid URL format"
    }
  }
}

Output Availability

CDN URLs are available for 72 hours after completion. If you use return_base64: true, base64 outputs are available for 60 minutes. Download or cache results promptly.


Subscribe (SSE)

POST /api/v1/fashion/subscribe

Convenience endpoint that submits a job and streams real-time status updates via Server-Sent Events. No manual polling needed.

Request Body

Same as /api/v1/fashion/run.

SSE Events

event: fashion
data: {"type":"job_submitted","prediction_id":"abc-123","model_name":"tryon-v1.6"}

event: fashion
data: {"type":"status_update","prediction_id":"abc-123","status":"processing"}

event: fashion
data: {"type":"completed","prediction_id":"abc-123","status":"completed","output":["https://cdn.fashn.ai/.../output_0.png"],"error":null}

data: [DONE]
Event TypeDescription
job_submittedJob accepted, includes prediction ID
status_updateStatus transitioned (e.g. in_queueprocessing)
completedJob finished, includes output array
failedJob failed, includes error object
errorUnexpected error during polling

JavaScript Example

const response = await fetch(`${BASE_URL}/api/v1/fashion/subscribe`, {
  method: 'POST',
  headers: HEADERS,
  body: JSON.stringify({
    model_name: 'background-remove',
    inputs: { image: 'https://example.com/photo.jpg' },
  }),
});
 
const reader = response.body.getReader();
const decoder = new TextDecoder();
 
while (true) {
  const { done, value } = await reader.read();
  if (done) break;
 
  const text = decoder.decode(value);
  for (const line of text.split('\n')) {
    if (line.startsWith('data: ') && line !== 'data: [DONE]') {
      const event = JSON.parse(line.slice(6));
      console.log(event.type, event);
 
      if (event.type === 'completed') {
        console.log('Output URLs:', event.output);
      }
    }
  }
}

Timeout

The subscribe endpoint has a 2-minute timeout. For long-running jobs like image-to-video (1-3 minutes), use the async /run + /status pattern instead.


Model Reference

Virtual Try-On (tryon-v1.6)

Try a garment on a person. Outputs at 864×1296 resolution.

ParameterTypeRequiredDescription
model_imagestringYesURL or base64 of the person image
garment_imagestringYesURL or base64 of the garment image
categorystringNoauto, tops, bottoms, one-pieces (default: auto)
modestringNoperformance (5s), balanced (8s), quality (12-17s)
garment_photo_typestringNoauto, flat-lay, model
moderation_levelstringNoconservative, permissive, none
num_samplesnumberNo1-4 images per request (default: 1)
segmentation_freebooleanNoDisable clothing segmentation (default: true)
seednumberNo0 to 2³²-1 for reproducibility
output_formatstringNopng or jpeg (default: png)
return_base64booleanNoReturn base64 instead of CDN URL
{
  "model_name": "tryon-v1.6",
  "inputs": {
    "model_image": "https://example.com/person.jpg",
    "garment_image": "https://example.com/tshirt.jpg",
    "category": "tops",
    "mode": "quality"
  }
}

Product to Model (product-to-model)

Transform flat-lay or product-only images into realistic on-model visuals. Supports two modes: generate a new person (default) or add product to an existing model image.

ParameterTypeRequiredDescription
product_imagestringYesURL or base64 of the product
model_imagestringNoPerson image (enables try-on mode)
image_promptstringNoInspiration image for pose/environment
promptstringNoStyling instructions (e.g. "athletic man, studio background")
aspect_ratiostringNo1:1, 2:3, 3:4, 4:5, 5:4, 4:3, 3:2, 16:9, 9:16
resolutionstringNo1k (precise) or 4k (creative)
seednumberNo0 to 2³²-1
output_formatstringNopng or jpeg
return_base64booleanNoReturn base64 instead of CDN URL
{
  "model_name": "product-to-model",
  "inputs": {
    "product_image": "https://example.com/jacket-flatlay.jpg",
    "prompt": "athletic woman, outdoor setting"
  }
}

Face to Model (face-to-model)

Transform a face/selfie into a try-on ready upper-body avatar.

ParameterTypeRequiredDescription
face_imagestringYesURL or base64 of the face image
promptstringNoBody guidance (e.g. "athletic build", "curvy figure")
aspect_ratiostringNo1:1, 4:5, 3:4, 2:3, 9:16 (default: 2:3)
seednumberNo0 to 2³²-1
output_formatstringNopng or jpeg (default: jpeg)
return_base64booleanNoReturn base64 instead of CDN URL
{
  "model_name": "face-to-model",
  "inputs": {
    "face_image": "https://example.com/selfie.jpg",
    "prompt": "athletic build",
    "aspect_ratio": "3:4"
  }
}

Model Create (model-create)

Generate realistic fashion models from text prompts, optionally guided by a reference image.

ParameterTypeRequiredDescription
promptstringYesDescription of desired model, clothing, pose, scene
image_referencestringNoReference image for composition guidance
reference_typestringNopose or silhouette (when image_reference is provided)
aspect_ratiostringNo1:1, 2:3, 3:4, 4:5, 5:4, 4:3, 3:2, 16:9, 9:16
lora_urlstringNoFLUX-compatible LoRA weights URL (.safetensors, max 256MB)
disable_prompt_enhancementbooleanNoUse prompt exactly as-is
seednumberNo0 to 2³²-1
output_formatstringNopng or jpeg
return_base64booleanNoReturn base64 instead of CDN URL
{
  "model_name": "model-create",
  "inputs": {
    "prompt": "Young woman in a red summer dress, standing on a beach at sunset",
    "aspect_ratio": "2:3"
  }
}

Model Variation (model-variation)

Create controlled variations from an existing model image.

ParameterTypeRequiredDescription
model_imagestringYesSource fashion model image
variation_strengthstringNosubtle or strong (default: subtle)
lora_urlstringNoFLUX-compatible LoRA weights URL
seednumberNo0 to 2³²-1
output_formatstringNopng or jpeg
return_base64booleanNoReturn base64 instead of CDN URL
{
  "model_name": "model-variation",
  "inputs": {
    "model_image": "https://example.com/model.jpg",
    "variation_strength": "strong"
  }
}

Model Swap (model-swap)

Replace the model's identity (face, skin tone, hair) while keeping clothing and pose intact.

ParameterTypeRequiredDescription
model_imagestringYesSource image with clothing/pose to preserve
promptstringNoDesired identity description (e.g. "Asian woman with short hair")
background_changebooleanNoAlso change background based on prompt
disable_prompt_enhancementbooleanNoUse prompt exactly as-is
lora_urlstringNoFLUX-compatible LoRA weights URL
seednumberNo0 to 2³²-1
output_formatstringNopng or jpeg
return_base64booleanNoReturn base64 instead of CDN URL
{
  "model_name": "model-swap",
  "inputs": {
    "model_image": "https://example.com/model-in-outfit.jpg",
    "prompt": "Middle-aged man with dark hair and beard"
  }
}

Reframe (reframe)

Adjust image aspect ratios using AI-powered generative fill. Two modes: directional extension or aspect ratio adjustment.

ParameterTypeRequiredDescription
imagestringYesSource image to reframe
modestringNodirection or aspect_ratio
target_aspect_ratiostringNoTarget ratio (for aspect_ratio mode): 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9
target_directionstringNoExpand direction (for direction mode): both, down, up
seednumberNo0 to 2³²-1
output_formatstringNopng or jpeg
return_base64booleanNoReturn base64 instead of CDN URL
{
  "model_name": "reframe",
  "inputs": {
    "image": "https://example.com/portrait.jpg",
    "mode": "aspect_ratio",
    "target_aspect_ratio": "16:9"
  }
}

Background Change (background-change)

Replace the background with an AI-generated scene while preserving the foreground subject.

ParameterTypeRequiredDescription
imagestringYesSource image
promptstringYesDescription of new background (e.g. "beach sunset", "modern office")
disable_prompt_enhancementbooleanNoUse prompt exactly as-is
seednumberNo0 to 2³²-1
output_formatstringNopng or jpeg
return_base64booleanNoReturn base64 instead of CDN URL
{
  "model_name": "background-change",
  "inputs": {
    "image": "https://example.com/model-photo.jpg",
    "prompt": "Luxury boutique interior with warm lighting"
  }
}

Background Remove (background-remove)

Remove the background and create a transparent PNG cutout.

ParameterTypeRequiredDescription
imagestringYesSource image
return_base64booleanNoReturn base64 instead of CDN URL
{
  "model_name": "background-remove",
  "inputs": {
    "image": "https://example.com/product-photo.jpg"
  }
}

Image to Video (image-to-video)

Turn a single image into a short motion clip with fashion-tailored camera work and model movements.

ParameterTypeRequiredDescription
imagestringYesSource image to animate
promptstringNoMotion guidance (keep short, e.g. "raising hand to touch face")
negative_promptstringNoCues to avoid undesirable motion
durationnumberNo5 or 10 seconds (default: 5)
resolutionstringNo480p, 720p, 1080p (default: 1080p)
{
  "model_name": "image-to-video",
  "inputs": {
    "image": "https://example.com/model-photo.jpg",
    "duration": 5,
    "resolution": "1080p"
  }
}

Long Processing Time

Image-to-video takes 1-3 minutes. Use the /run + /status pattern for this model, as /subscribe has a 2-minute timeout.


Image Inputs

All image parameters accept either:

  • URL: Publicly accessible image URL with correct Content-Type headers
  • Base64: Data URI with format prefix, e.g. data:image/jpg;base64,/9j/4AAQ...

Base64 Format

Base64 images must include the proper prefix: data:image/jpg;base64,<YOUR_BASE64> or data:image/png;base64,<YOUR_BASE64>. Omitting the prefix will cause an ImageLoadError.


Credits

ModelBase CostWith face_referenceMultiple Outputs
tryon-v1.63 credits× num_samples
product-to-model3 credits5 credits× num_images
face-to-model3 credits
model-create3 credits5 credits× num_images
model-variation3 credits
model-swap3 credits5 credits× num_images
reframe2 credits× num_images
background-change2 credits
background-remove2 credits
image-to-video5 credits

Failed predictions do not consume credits.


Rate Limits

EndpointLimit
/api/v1/fashion/run30 requests per 60 seconds
/api/v1/fashion/subscribe30 requests per 60 seconds
/api/v1/fashion/status/:id40 requests per 10 seconds

Rate limit headers are included in every response:

  • X-RateLimit-Limit — Max requests allowed
  • X-RateLimit-Remaining — Requests remaining in window
  • X-RateLimit-Reset — Unix timestamp when window resets

Error Handling

API-Level Errors

Returned before a prediction is created (no prediction ID):

CodeErrorSolution
400Validation failedCheck model_name and required inputs fields
401Invalid API keyVerify your Authorization or X-API-Key header
429Rate limit exceededThrottle requests, check Retry-After header
503Service unavailableFashion generation service is not configured on the server

Runtime Errors

Returned when polling /status/:id with status: "failed":

Error NameCauseSolution
ImageLoadErrorCannot fetch/decode input imageUse public URLs with image Content-Type, or valid base64 with prefix
ContentModerationErrorInput violated content policiesAdjust input or set moderation_level to permissive
PoseErrorCannot detect body poseImprove image quality, ensure full body is visible
InputValidationErrorInvalid parameter valuesCheck parameter types and enum values
PipelineErrorInternal processing failureRetry the request
ThirdPartyErrorUpstream service failureRetry with backoff

Failed = Free

Failed predictions do not consume credits. It's safe to retry.