Segmind SegFit v1.3 Serverless API

SegFit v1.3 enables hyper-realistic virtual try-ons, enhancing online fashion retail experiences without physical photoshoots.

~37.18s
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/segfit-v1.3"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "outfit_image": "https://segmind-resources.s3.amazonaws.com/output/217c8192-d055-4fec-b1cf-82325c9cb0b2-segfit-v1.3-outfit.JPG",
12    "model_image": "https://segmind-resources.s3.amazonaws.com/output/d3539958-a892-455e-b00f-aa46e7cfa70b-segfit-v1.3-ip.png",
13    "model_type": "Quality",
14    "cn_strength": 0.8,
15    "cn_end": 0.5,
16    "image_format": "jpeg",
17    "image_quality": 90,
18    "seed": 42,
19    "base64": false
20}
21
22response = requests.post(url, headers=headers, json=data)
23
24if response.status_code == 200:
25    result = response.json()
26    print(json.dumps(result, indent=2))
27else:
28    print(f"Error: {response.status_code}")
29    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/segfit-v1.3

Parameters

model_imagerequired
string

Provide the model's image. Ensure good lighting and clear focus.

Exactly one of:
Option 1optional
string (uri)
outfit_imagerequired
string

Upload the outfit image for try-on. Use clear images.

Exactly one of:
Option 1optional
string (uri)
base64optional
boolean

Decide if output is base64 encoded. Set true if needed.

Default: false
cn_endoptional
number

Endpoint of ControlNet effect. Higher values give more influence.

Default: 0.5Range: 0 - 1
cn_strengthoptional
number

Set ControlNet's influence strength. Use higher for more detail.

Default: 0.8Range: 0 - 1
image_formatoptional
string

Select the format for the generated image

Default: "png"
Allowed values :
"png""jpeg""webp"
image_qualityoptional
integer

Adjust image quality. Use 90 for best balance of size and detail.

Default: 90Range: 1 - 100
mask_imageoptional
string

Optional mask image. Use if needed for more control over tryon

Exactly one of:
Option 1optional
string (uri)
model_typeoptional
string

Choose 'Speed' for fast output or 'Quality' for detail.

Default: "Quality"
Allowed values :
"Speed""Balanced""Quality"
seedoptional
integer

Set seed for reproducibility. Use -1 for a random seed.

Default: 42Range: -1 - 999999

Response Type

Returns: Image

Common Error Codes

The API returns standard HTTP status codes. Detailed error messages are provided in the response body.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out