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)

API Endpoint

POSThttps://api.segmind.com/v1/segfit-v1.1

Parameters

outfit_imagerequired
string (uri)

Image of the outfit to be fitted on a model

aspect_ratiooptional
string

Aspect ratio of the output image

Default: "2:3"
Allowed values (13 total):
"1:1""2:3""3:4""5:8""9:16""9:19""9:21""3:2""4:3""8:5"+3 more
background_descriptionoptional
string

Description of the background setting

Default: "aesthetic studio shoot"
base64optional
boolean

Return image as base64 string

Default: false
cloth_descriptionoptional
string

Description of the cloth or outfit

Default: ""
cn_endoptional
number

End value for ControlNet effect (0-1)

Default: 0.3Range: 0 - 1
cn_strengthoptional
number

Strength of the ControlNet effect (0-1)

Default: 0.3Range: 0 - 1
controlnet_typeoptional
string

Type of ControlNet to use

Default: "Depth"
Allowed values :
"None""Depth""Canny""Openpose"
image_formatoptional
string

Format of the output image

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

Quality of the output image (1-100)

Default: 95Range: 1 - 100
model_descriptionoptional
string

Description of the model (gender, nationality, etc.)

Default: ""
model_imageoptional
string (uri)

Optional image of the model to use for fitting

Default: null
model_maskoptional
string (uri)

Optional mask for the model image

Default: null
model_typeoptional
string

Type of model to use for generation

Default: "balanced"
Allowed values :
"Speed""Balanced""Quality"
seedoptional
integer

Seed for reproducible results (-1 for random)

Default: -1Range: -1 - 999999
upscaleoptional
boolean

Enable upscaling of the output image

Default: false

Response 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. 1
    POST /v2/segfit-v1.1

    Submitreturns request_id, status_url, response_url

  2. 2
    GET /v2/requests/{id}/status

    Polluntil COMPLETED or FAILED

  3. 3
    GET /v2/requests/{id}

    Resultfinal response body

Status states

QUEUEDAccepted, waiting for a worker
PROCESSINGRunning on a worker
COMPLETEDDone — result body is ready
FAILEDErrored (incl. content/RAI blocks)
  • 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.

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