SegFIT: Segmind Fashion and Immersive Try-on

SegFIT by Segmind is a cutting-edge virtual try-on (VTON) model that enables ultra-realistic clothing visualization on custom fashion models.

~55.18s
~$0.541
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/segfit"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "outfit_image": "https://segmind-inference-inputs.s3.ap-south-1.amazonaws.com/a8b0d0b4-8b45-4ff4-b42e-66c96c0070ee.jpeg",
12    "gender": "woman",
13    "nationality": "indian",
14    "location": "garden",
15    "prompt_clothing": "cloth,dress,stripes,lace",
16    "seed": 42,
17    "image_format": "png",
18    "image_quality": 95,
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

Parameters

outfit_imagerequired
string (uri)

URL of the outfit image to use as reference

base64optional
boolean

Return image as base64 string

Default: false
genderoptional
string

Gender of the model

image_formatoptional
string

Format of the output image

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

Quality of the output image (1-100)

Default: 90Range: 1 - 100
locationoptional
string

Background location for the image

model_imageoptional
string (uri)

url or base64 of the model image (optional)

Default: null
model_maskoptional
string (uri)

url or base64 of the model mask (optional)

Default: null
nationalityoptional
string

Nationality of the model

prompt_clothingoptional
string

Cloth details, use it when model image/mask is not provided

seedoptional
integer

Seed for image generation

Default: -1Range: -1 - 999999999999999

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