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.

~68.66s
~$0.451
 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

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

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