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
const axios = require('axios');
const fs = require('fs');
const path = require('path');
async function toB64(imgPath) {
const data = fs.readFileSync(path.resolve(imgPath));
return Buffer.from(data).toString('base64');
}
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/segfit-v1.3";
const data = {
"outfit_image": "toB64('https://segmind-resources.s3.amazonaws.com/output/217c8192-d055-4fec-b1cf-82325c9cb0b2-segfit-v1.3-outfit.JPG')",
"model_image": "toB64('https://segmind-resources.s3.amazonaws.com/output/d3539958-a892-455e-b00f-aa46e7cfa70b-segfit-v1.3-ip.png')",
"mask_image": "toB64('null')",
"model_type": "Quality",
"cn_strength": 0.8,
"cn_end": 0.5,
"image_format": "jpeg",
"image_quality": 90,
"seed": 42,
"base64": false
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();
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.
SegFit v1.3 is a virtual try-on model by Segmind, built for fashion try-on applications. With improved garment segmentation and photorealistic rendering, it takes any outfit image and puts it onto a huaman model photo with natural looking draping, accurate edges, all thanks to the smart automatic masking. SegFit v1.3 streamlines digital workflows, no physical photoshoots required.
Segfit v1.3 introduces a range of improvements in output quality and processing speed:
Improved Auto Prompting: Accurate and context aware prompt enhancement for better outputs.
New Cloth Segmentation and automasking method: The updated segmentation pipeline help in accurate clothing detection and segmentation. This leads ot accurate masking for upper wear, lower wear and full-body outfits, with smarter hand and feet coverage based on the type of clothing.
**Faster Generation Speed: ** Optimized model inference performance for quicker generation without affecting quality.
Fixes for Inpainting Artifacts: Resolved issues such as black borders around inpainted areas for cleaner results.
This version update focuses on delivering higher visual fidelity, improved automation (no masks), and a faster UX across workflows.
outfit_image
(required): Clear, front-facing picture of the garment.model_image
(required): Well lit, focused photo of the model. Can be generated by AI (eg. Flux Pro or Qwen-Image)
• mask_image
(optional): Custom mask for precise and accurate tryon.outfit_image
and model_image
.image_quality
(default 90) to balance file size and fidelity, ideal for web ready images.How do I integrate SegFit v1.3 into my workflow?
Use our serverless API endpoint or create a customer workflow on Pixelflow.
What image formats are supported?
SegFit v1.3 supports png
, jpeg
, and webp
. PNG is recommended for lossless quality and precise alpha channel support.
Is background removal automatic?
Absolutely. Automatic garment masking detects clothing edges and separates them from any background, reducing manual editing time.
How do I reproduce the same result?
Set the seed
parameter to a fixed integer (e.g., 777). Use -1
for a random seed on each and every request.