Segmind SegFit v1.3
SegFit v1.3 enables hyper-realistic virtual try-ons, enhancing online fashion retail experiences without physical photoshoots.
API
If you're looking for an API, you can choose from your desired programming language.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import requests
import base64
# Use this function to convert an image file from the filesystem to base64
def image_file_to_base64(image_path):
with open(image_path, 'rb') as f:
image_data = f.read()
return base64.b64encode(image_data).decode('utf-8')
# Use this function to fetch an image from a URL and convert it to base64
def image_url_to_base64(image_url):
response = requests.get(image_url)
image_data = response.content
return base64.b64encode(image_data).decode('utf-8')
# Use this function to convert a list of image URLs to base64
def image_urls_to_base64(image_urls):
return [image_url_to_base64(url) for url in image_urls]
api_key = "YOUR_API_KEY"
url = "https://api.segmind.com/v1/segfit-v1.3"
# Request payload
data = {
"outfit_image": image_url_to_base64("https://segmind-resources.s3.amazonaws.com/output/217c8192-d055-4fec-b1cf-82325c9cb0b2-segfit-v1.3-outfit.JPG"), # Or use image_file_to_base64("IMAGE_PATH")
"model_image": image_url_to_base64("https://segmind-resources.s3.amazonaws.com/output/d3539958-a892-455e-b00f-aa46e7cfa70b-segfit-v1.3-ip.png"), # Or use image_file_to_base64("IMAGE_PATH")
"model_type": "Quality",
"cn_strength": 0.8,
"cn_end": 0.5,
"image_format": "jpeg",
"image_quality": 90,
"seed": 42,
"base64": False
}
headers = {'x-api-key': api_key}
response = requests.post(url, json=data, headers=headers)
print(response.content) # The response is the generated image
Attributes
Upload the outfit image for try-on. Use clear images.
Provide the model's image. Ensure good lighting and clear focus.
Optional mask image. Use if needed for more control over tryon
Choose 'Speed' for fast output or 'Quality' for detail.
Allowed values:
Set ControlNet's influence strength. Use higher for more detail.
min : 0,
max : 1
Endpoint of ControlNet effect. Higher values give more influence.
min : 0,
max : 1
Select the format for the generated image
Allowed values:
Adjust image quality. Use 90 for best balance of size and detail.
min : 1,
max : 100
Set seed for reproducibility. Use -1 for a random seed.
min : -1,
max : 999999
Decide if output is base64 encoded. Set true if needed.
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Resources to get you started
Everything you need to know to get the most out of Segmind SegFit v1.3
SegFit v1.3 – Quickstart & Best Practices
SegFit v1.3 is a serverless API that lets you virtually “try on” any garment with photorealistic draping, automatic masking and high-fidelity rendering. Use this guide to choose the right parameters for your use case, and get crisp, consistent results every time.
1. Getting Started
- •Collect two high-resolution images (≥1024 px):
• outfit_image: Front-facing, well-lit garment shot.
• model_image: Portrait with neutral background and good lighting. - •Send a multipart/form-data POST to the SegFit endpoint, including these images plus any optional mask or config fields.
- •Receive a ready-to-use PNG/JPEG/WebP with the try-on result.
2. Core Parameters
- •image_format (
png
/jpeg
/webp
):
• PNG for lossless RGBA; WebP for web-optimized files; JPEG for photos. - •image_quality (1–100, default 90):
• 90 yields crisp edges with moderate file size. Lower to reduce bytes. - •seed (integer or –1):
• Fixed seed for reproducible outputs; –1 for random variations.
3. Advanced Controls (optional)
- •mask_image: Supply custom mask to isolate sleeves, collars or accessories.
4. Use-Case Parameter Sets
- •E-commerce Catalogs
• image_format: png
• image_quality: 90
• seed: 42 - •Marketing Banners / Social Media
• image_format: webp
• image_quality: 80
• seed: –1 - •Virtual Fitting Rooms (real-time)
• image_format: jpeg
• image_quality: 75
• seed: –1 - •Influencer & Lookbook Content
• image_format: png
• image_quality: 95
5. Pro Tips
- •Shoot on neutral, uncluttered backgrounds for 80% fewer masking artifacts.
- •For consistent batch processing, lock your seed .
- •Reduce image_quality to 60–70 for mobile-optimized assets under 200 KB.
By tuning these parameters, SegFit v1.3 adapts to any retail or creative workflow—whether you need ultra-fast previews or studio-grade renders. Happy styling!
Other Popular Models
Discover other models you might be interested in.
sdxl-img2img
SDXL Img2Img is used for text-guided image-to-image translation. This model uses the weights from Stable Diffusion to generate new images from an input image using StableDiffusionImg2ImgPipeline from diffusers

storydiffusion
Story Diffusion turns your written narratives into stunning image sequences.

fooocus
Fooocus enables high-quality image generation effortlessly, combining the best of Stable Diffusion and Midjourney.

sd1.5-epicrealism
This model corresponds to the Stable Diffusion Epic Realism checkpoint for detailed images at the cost of a super detailed prompt
