Segmind SegFit v1.1
Segmind's Fashion and Immersive Try-on model. SegFIT offers effortless AI virtual try-on from just a product image. No models needed! Boost engagement & conversions with this flexible and fast try-on model.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/segfit-v1.1"
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 "background_description": "aesthetic studio shoot",
13 "aspect_ratio": "2:3",
14 "model_type": "Balanced",
15 "controlnet_type": "Depth",
16 "cn_strength": 0.3,
17 "cn_end": 0.3,
18 "image_format": "png",
19 "image_quality": 95,
20 "seed": -1,
21 "upscale": false,
22 "base64": false
23}
24
25response = requests.post(url, headers=headers, json=data)
26
27if response.status_code == 200:
28 result = response.json()
29 print(json.dumps(result, indent=2))
30else:
31 print(f"Error: {response.status_code}")
32 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/segfit-v1.1"
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 "background_description": "aesthetic studio shoot",
13 "aspect_ratio": "2:3",
14 "model_type": "Balanced",
15 "controlnet_type": "Depth",
16 "cn_strength": 0.3,
17 "cn_end": 0.3,
18 "image_format": "png",
19 "image_quality": 95,
20 "seed": -1,
21 "upscale": false,
22 "base64": false
23}
24
25response = requests.post(url, headers=headers, json=data)
26
27if response.status_code == 200:
28 result = response.json()
29 print(json.dumps(result, indent=2))
30else:
31 print(f"Error: {response.status_code}")
32 print(response.text)API Endpoint
https://api.segmind.com/v1/segfit-v1.1Parameters
outfit_imagerequiredstring (uri)Image of the outfit to be fitted on a model
aspect_ratiooptionalstringAspect ratio of the output image
"2:3""1:1""2:3""3:4""5:8""9:16""9:19""9:21""3:2""4:3""8:5"+3 morebackground_descriptionoptionalstringDescription of the background setting
"aesthetic studio shoot"base64optionalbooleanReturn image as base64 string
falsecloth_descriptionoptionalstringDescription of the cloth or outfit
""cn_endoptionalnumberEnd value for ControlNet effect (0-1)
0.3Range: 0 - 1cn_strengthoptionalnumberStrength of the ControlNet effect (0-1)
0.3Range: 0 - 1controlnet_typeoptionalstringType of ControlNet to use
"Depth""None""Depth""Canny""Openpose"image_formatoptionalstringFormat of the output image
"png""png""jpeg""webp"image_qualityoptionalintegerQuality of the output image (1-100)
95Range: 1 - 100model_descriptionoptionalstringDescription of the model (gender, nationality, etc.)
""model_imageoptionalstring (uri)Optional image of the model to use for fitting
nullmodel_maskoptionalstring (uri)Optional mask for the model image
nullmodel_typeoptionalstringType of model to use for generation
"balanced""Speed""Balanced""Quality"seedoptionalintegerSeed for reproducible results (-1 for random)
-1Range: -1 - 999999upscaleoptionalbooleanEnable upscaling of the output image
falseResponse 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