Segmind SegFit v1.2 Serverless API
SegFit v1.2 creates hyper-realistic virtual try-on images, transforming fashion retail engagement and conversion rates.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/segfit-v1.2"
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/others/c63e9544-10da-45cd-81f9-725fb98ca0c0-090a11c5-4e9a-42f2-8cf7-d74de7e1ebcf.png",
12 "model_image": "https://segmind-resources.s3.amazonaws.com/others/be81a5a2-a928-47d2-927e-cdc4cf25cb96-model_1.png",
13 "model_type": "Balanced",
14 "cn_strength": 0.35,
15 "cn_end": 0.35,
16 "image_format": "png",
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) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/segfit-v1.2"
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/others/c63e9544-10da-45cd-81f9-725fb98ca0c0-090a11c5-4e9a-42f2-8cf7-d74de7e1ebcf.png",
12 "model_image": "https://segmind-resources.s3.amazonaws.com/others/be81a5a2-a928-47d2-927e-cdc4cf25cb96-model_1.png",
13 "model_type": "Balanced",
14 "cn_strength": 0.35,
15 "cn_end": 0.35,
16 "image_format": "png",
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
https://api.segmind.com/v1/segfit-v1.2Parameters
model_imagerequiredstring (uri)Image of the model for try-on. Example: front-facing, well-lit image.
outfit_imagerequiredstring (uri)Image of the outfit to be fitted. Example: a dress or suit.
base64optionalbooleanReturn image as base64 string instead of URL.
falsecn_endoptionalnumberEndpoint for ControlNet's effect. Controls the model body shape, Higher the value, higher the control
0.35Range: 0 - 1cn_strengthoptionalnumberStrength of ControlNet's influence. Maintains the shape of the model.
0.35Range: 0 - 1image_formatoptionalstringOutput image format. 'PNG' is versatile, 'JPEG' compresses well.
"png""png""jpeg""webp"image_qualityoptionalintegerDetermine image quality (1-100). Use 100 for best detail, lower for smaller file size.
90Range: 1 - 100model_typeoptionalstringChoose the generation model type. Use 'Speed' for fast results, 'Quality' for high detail.
"balanced""Speed""Balanced""Quality"seedoptionalintegerEnsures reproducibility. Set to -1 for random variation.
42Range: -1 - 999999Response Type
Returns: Image
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out