Segmind SegFit v1.1 Serverless API
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.
POST /v2/segfit-v1.1 · submit + poll 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3import segmind
4
5# Async (v2): submit to the queue and block until COMPLETED.
6# run() returns the final result dict (600s deadline, 1.0s poll by default).
7result = segmind.run(
8 "segfit-v1.1",
9 outfit_image="https://segmind-inference-inputs.s3.ap-south-1.amazonaws.com/a8b0d0b4-8b45-4ff4-b42e-66c96c0070ee.jpeg",
10 background_description="aesthetic studio shoot",
11 aspect_ratio="2:3",
12 model_type="Balanced",
13 controlnet_type="Depth",
14 cn_strength=0.3,
15 cn_end=0.3,
16 image_format="png",
17 image_quality=95,
18 seed=-1,
19 upscale=False,
20 base64=False,
21)
22print(result["status"]) # COMPLETED
23print(result.get("output")) # model output (e.g. media URL)
24print(result["metrics"]["inference_time"]) # server compute seconds
25
26# --- Or submit + poll manually (track request_id, control the cadence) ---
27from segmind import SegmindClient, InferenceFailed, InferenceTimeout
28
29client = SegmindClient() # reads SEGMIND_API_KEY
30payload = {
31 "outfit_image": "https://segmind-inference-inputs.s3.ap-south-1.amazonaws.com/a8b0d0b4-8b45-4ff4-b42e-66c96c0070ee.jpeg",
32 "background_description": "aesthetic studio shoot",
33 "aspect_ratio": "2:3",
34 "model_type": "Balanced",
35 "controlnet_type": "Depth",
36 "cn_strength": 0.3,
37 "cn_end": 0.3,
38 "image_format": "png",
39 "image_quality": 95,
40 "seed": -1,
41 "upscale": False,
42 "base64": False,
43}
44job = client.submit_async("segfit-v1.1", **payload)
45print(job.request_id) # available immediately
46try:
47 result = job.wait(timeout=600, interval=1.0)
48except InferenceTimeout as e:
49 print("still running:", e.request_id)
50except InferenceFailed as e:
51 print("failed:", e.detail) 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3import segmind
4
5# Async (v2): submit to the queue and block until COMPLETED.
6# run() returns the final result dict (600s deadline, 1.0s poll by default).
7result = segmind.run(
8 "segfit-v1.1",
9 outfit_image="https://segmind-inference-inputs.s3.ap-south-1.amazonaws.com/a8b0d0b4-8b45-4ff4-b42e-66c96c0070ee.jpeg",
10 background_description="aesthetic studio shoot",
11 aspect_ratio="2:3",
12 model_type="Balanced",
13 controlnet_type="Depth",
14 cn_strength=0.3,
15 cn_end=0.3,
16 image_format="png",
17 image_quality=95,
18 seed=-1,
19 upscale=False,
20 base64=False,
21)
22print(result["status"]) # COMPLETED
23print(result.get("output")) # model output (e.g. media URL)
24print(result["metrics"]["inference_time"]) # server compute seconds
25
26# --- Or submit + poll manually (track request_id, control the cadence) ---
27from segmind import SegmindClient, InferenceFailed, InferenceTimeout
28
29client = SegmindClient() # reads SEGMIND_API_KEY
30payload = {
31 "outfit_image": "https://segmind-inference-inputs.s3.ap-south-1.amazonaws.com/a8b0d0b4-8b45-4ff4-b42e-66c96c0070ee.jpeg",
32 "background_description": "aesthetic studio shoot",
33 "aspect_ratio": "2:3",
34 "model_type": "Balanced",
35 "controlnet_type": "Depth",
36 "cn_strength": 0.3,
37 "cn_end": 0.3,
38 "image_format": "png",
39 "image_quality": 95,
40 "seed": -1,
41 "upscale": False,
42 "base64": False,
43}
44job = client.submit_async("segfit-v1.1", **payload)
45print(job.request_id) # available immediately
46try:
47 result = job.wait(timeout=600, interval=1.0)
48except InferenceTimeout as e:
49 print("still running:", e.request_id)
50except InferenceFailed as e:
51 print("failed:", e.detail)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
Asynchronous requests (v2)
Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.
- 1
POST /v2/segfit-v1.1Submit — returns request_id, status_url, response_url
- 2
GET /v2/requests/{id}/statusPoll — until COMPLETED or FAILED
- 3
GET /v2/requests/{id}Result — final response body
Status states
- A FAILED request is served as HTTP 422 — the body still carries the error detail.
- An unknown or expired request_id returns HTTP 404.
- Results are retained for 1 hour, then expire.
- Content / RAI blocks surface as FAILED, not a separate state.
- Track completion by polling the status endpoint.
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