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.2"
# Request payload
data = {
"outfit_image": image_url_to_base64("https://segmind-resources.s3.amazonaws.com/others/c63e9544-10da-45cd-81f9-725fb98ca0c0-090a11c5-4e9a-42f2-8cf7-d74de7e1ebcf.png"), # Or use image_file_to_base64("IMAGE_PATH")
"model_image": image_url_to_base64("https://segmind-resources.s3.amazonaws.com/others/be81a5a2-a928-47d2-927e-cdc4cf25cb96-model_1.png"), # Or use image_file_to_base64("IMAGE_PATH")
"model_type": "Balanced",
"cn_strength": 0.35,
"cn_end": 0.35,
"image_format": "png",
"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
Image of the outfit to be fitted. Example: a dress or suit.
Image of the model for try-on. Example: front-facing, well-lit image.
Choose the generation model type. Use 'Speed' for fast results, 'Quality' for high detail.
Allowed values:
Strength of ControlNet's influence. Maintains the shape of the model.
min : 0,
max : 1
Endpoint for ControlNet's effect. Controls the model body shape, Higher the value, higher the control
min : 0,
max : 1
Output image format. 'PNG' is versatile, 'JPEG' compresses well.
Allowed values:
Determine image quality (1-100). Use 100 for best detail, lower for smaller file size.
min : 1,
max : 100
Ensures reproducibility. Set to -1 for random variation.
min : -1,
max : 999999
Return image as base64 string instead of URL.
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.
Leveraging Segmind's SegFit v1.2 for Enhanced Fashion Virtual Try-On
Segmind's SegFit v1.2 is a state-of-the-art model in the SegFIT suite, enabling the creation of lifelike virtual try-on experiences for the fashion industry. With its ability to generate photorealistic try-on images using both product and model photos, SegFit v1.2 eliminates the need for physical photoshoots, enhancing engagement and conversions for e-commerce, marketing, and content creation.
Understanding SegFit v1.2 Capabilities
High-Precision Visualization
SegFit excels in mapping garments onto virtual models, offering ultra-realistic visualizations that capture the garment's boundaries, shape, and drape with precision. This feature ensures a believable and immersive try-on experience.
Smart Garment Masking
The model's AI-driven automatic masking differentiates between clothing and the background, accurately identifying garment edges. This capability reduces manual input preparation, streamlining the try-on process.
Flexible and Configurable
With support for various input types such as flat lay photos for garments and required model images, SegFit v1.2 provides configurable output options such as aspect ratios and quality modes, catering to diverse content needs.
Advanced Recognition and Customization
SegFit identifies multiple garments within a single image and simulates texture and movement, reflecting realistic draping on model images. Customizable virtual models ensure output is tailored to target demographics, enhancing inclusivity.
Seamless Integration
Offered as a serverless API, SegFit enables easy integration into digital workflows, ideal for e-commerce and creative pipelines.
Effective Use of SegFit v1.2
To maximize the potential of SegFit, utilize high-quality product and model photography and leverage the API for bulk processing. Customize virtual models for broader market appeal and iterate using segmented workflow features for precision. Combining SegFit outputs with other creative models can produce comprehensive marketing visuals, streamlining the fashion retail experience.
Other Popular Models
idm-vton
Best-in-class clothing virtual try on in the wild

illusion-diffusion-hq
Monster Labs QrCode ControlNet on top of SD Realistic Vision v5.1

face-to-many
Turn a face into 3D, emoji, pixel art, video game, claymation or toy

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
