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
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')
api_key = "YOUR_API_KEY"
url = "https://api.segmind.com/v1/segfit-v1.1"
# Request payload
data = {
"outfit_image": image_url_to_base64("https://segmind-inference-inputs.s3.ap-south-1.amazonaws.com/a8b0d0b4-8b45-4ff4-b42e-66c96c0070ee.jpeg"), # Or use image_file_to_base64("IMAGE_PATH")
"background_description": "aesthetic studio shoot",
"aspect_ratio": "2:3",
"model_type": "Balanced",
"controlnet_type": "Depth",
"cn_strength": 0.3,
"cn_end": 0.3,
"image_format": "png",
"image_quality": 95,
"seed": -1,
"upscale": False,
"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
Image of the outfit to be fitted on a model
Optional image of the model to use for fitting
Optional mask for the model image
Description of the cloth or outfit
Description of the model (gender, nationality, etc.)
Description of the background setting
Aspect ratio of the output image
Allowed values:
Type of model to use for generation
Allowed values:
Type of ControlNet to use
Allowed values:
Strength of the ControlNet effect (0-1)
min : 0,
max : 1
End value for ControlNet effect (0-1)
min : 0,
max : 1
Format of the output image
Allowed values:
Quality of the output image (1-100)
min : 1,
max : 100
Seed for reproducible results (-1 for random)
min : -1,
max : 999999
Enable upscaling of the output image
Return image as base64 string
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.
SegFIT Virtual Try-on v1.1
SegFIT v1.1 by Segmind, is a cutting-edge AI model designed to simplify virtual try-on for fashion e-commerce brands, startups, and creators. This innovative technology requires only a product image to generate photorealistic try-on results, eliminating the need for complex setups or model photos. Its speed, flexibility, and ease of use make it an ideal solution for businesses looking to enhance customer engagement and provide a modern shopping experience through AI-powered virtual try-on capabilities.
Key Features of SegFIT Virtual Try-on v1.1
-
Smarter Automatic Masking - The advanced AI engine intelligently detects garment boundaries, shape, and drape from just a product image, automatically creating accurate masks without requiring manual input or reference model images. This significantly streamlines the workflow and reduces the effort needed to prepare clothing items for virtual try-on.
-
AI Model Generation - When a model image is not provided, SegFIT v1.1 can generate a photorealistic model based on an optional description of the desired person (e.g., age, ethnicity, style). This feature offers unparalleled flexibility and allows users to visualize their clothing on diverse virtual models without the need for actual photoshoots.
-
Flexible Quality Modes - Users can choose from Fast, Balanced, or Quality modes to optimize the generation speed and level of detail based on their specific needs, whether it's for quick previews or high-resolution production visuals. This adaptability ensures that users can efficiently create try-on images for various purposes.
-
Control Output Layout with Aspect Ratios - SegFIT v1.1 allows users to generate try-on outputs in portrait, square, or landscape aspect ratios, making it easy to adapt visuals for different platforms like Instagram posts, product carousels, or website banners. This feature ensures that the generated content is optimized for its intended use, enhancing visual appeal and engagement.
-
Advanced Vision and Generative Systems - Under the hood, SegFIT v1.1 utilizes sophisticated vision models and prompt-based generative AI to accurately detect fabric types, predict body posture and drape, match or create model images, and seamlessly blend lighting and skin tones for realistic results. This complex process is simplified into a single click, eliminating the need for manual editing.
-
Ease of Use - SegFIT is designed with a user-friendly step-by-step guide that simplifies the entire try-on generation process, requiring minimal technical expertise. Optional features like model and cloth descriptions allow for further customization and improved accuracy, while adhering to best practices like using high-resolution images ensures optimal results.
Best practices to use the SegFIT Virtual Try-on v1.1 effectively
Do's:
-
Use high-resolution outfit images with plain backgrounds. This likely helps the AI engine to accurately detect the garment boundaries and fabric type without interference from complex backgrounds.
-
Upload model images where the torso/full body is visible. This provides the AI with sufficient information about body posture and drape position if you choose to upload a reference model.
-
Add descriptions when results look off. Providing more context about the cloth or the desired model can help the system generate more accurate and satisfactory try-on results.
-
Use portrait/square/landscape depending on your ad format. Choosing the correct aspect ratio ensures that the generated try-on visuals are optimized for their intended use, such as Instagram posts (portrait), product listing carousels (square), or website banners (landscape).
Don'ts:
-
Avoid blurry or low-res cloth images. Low-quality images can hinder the AI's ability to accurately interpret the garment details.
-
Don’t use cropped face-only photos. If you are providing a model image, it needs to show the torso or full body for the AI to understand the body shape and how the garment should fit.
-
Don’t use overly cluttered or styled images. Complex backgrounds or heavily styled clothing in the input images might confuse the AI's detection and prediction processes.
-
Don’t use non-apparel items or poorly lit photos. SegFIT v1.1 is designed for virtual try-on of clothing, and poor lighting can obscure crucial details of the garment.
By following these do's and don'ts, you can maximize the quality and realism of the try-on results generated by SegFIT v1.
Use Cases
-
Fashion E-commerce Brands - Enhance online product listings by embedding interactive virtual try-on previews directly on product pages, allowing customers to visualize themselves wearing the clothes before making a purchase, potentially increasing conversion rates and reducing returns.
-
Instagram-first Clothing Labels - Generate engaging and shareable influencer-style visuals effortlessly, showcasing clothing items on diverse virtual models for social media marketing campaigns and attracting a wider audience.
-
UGC & Creator Brands - Empower fans and content creators to visualize themselves in your brand's apparel, fostering community engagement and generating user-generated content for marketing and brand building initiatives.
-
Startups & AI Creators - Leverage SegFIT's robust API to integrate its AI virtual try-on capabilities into custom applications and styling engines, opening up new possibilities for innovative fashion-tech solutions.
-
Marketing and Advertising - Create compelling visuals for online advertisements and marketing materials in various aspect ratios, showcasing the fit and style of clothing items on different virtual models without the logistical complexities and costs of traditional photoshoots.
SegFIT v1.1 provides a streamlined and efficient AI model for virtual try-on, enabling businesses to create realistic visualizations from just a product image. Its intuitive design and powerful features offer significant benefits for fashion e-commerce, marketing, and content creation by enhancing customer experience and simplifying visual content production.
Other Popular Models
sadtalker
Audio-based Lip Synchronization for Talking Head Video

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

faceswap-v2
Take a picture/gif and replace the face in it with a face of your choice. You only need one image of the desired face. No dataset, no training

codeformer
CodeFormer is a robust face restoration algorithm for old photos or AI-generated faces.
