Segmind SegFit v1.3 Serverless API
SegFit v1.3 enables hyper-realistic virtual try-ons, enhancing online fashion retail experiences without physical photoshoots.
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) 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
https://api.segmind.com/v1/segfit-v1.3Parameters
model_imagerequiredstringProvide the model's image. Ensure good lighting and clear focus.
Option 1optionalstring (uri)outfit_imagerequiredstringUpload the outfit image for try-on. Use clear images.
Option 1optionalstring (uri)base64optionalbooleanDecide if output is base64 encoded. Set true if needed.
falsecn_endoptionalnumberEndpoint of ControlNet effect. Higher values give more influence.
0.5Range: 0 - 1cn_strengthoptionalnumberSet ControlNet's influence strength. Use higher for more detail.
0.8Range: 0 - 1image_formatoptionalstringSelect the format for the generated image
"png""png""jpeg""webp"image_qualityoptionalintegerAdjust image quality. Use 90 for best balance of size and detail.
90Range: 1 - 100mask_imageoptionalstringOptional mask image. Use if needed for more control over tryon
Option 1optionalstring (uri)model_typeoptionalstringChoose 'Speed' for fast output or 'Quality' for detail.
"Quality""Speed""Balanced""Quality"seedoptionalintegerSet seed for reproducibility. Use -1 for a random seed.
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