POST
javascript
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); } })();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


outfit_imageimage *

Upload the outfit image for try-on. Use clear images.


model_imageimage *

Provide the model's image. Ensure good lighting and clear focus.


mask_imageimage ( default: 1 )

Optional mask image. Use if needed for more control over tryon


model_typeenum:str ( default: Quality )

Choose 'Speed' for fast output or 'Quality' for detail.

Allowed values:


cn_strengthfloat ( default: 0.8 )

Set ControlNet's influence strength. Use higher for more detail.

min : 0,

max : 1


cn_endfloat ( default: 0.5 )

Endpoint of ControlNet effect. Higher values give more influence.

min : 0,

max : 1


image_formatenum:str ( default: png )

Select the format for the generated image

Allowed values:


image_qualityint ( default: 90 )

Adjust image quality. Use 90 for best balance of size and detail.

min : 1,

max : 100


seedint ( default: 42 )

Set seed for reproducibility. Use -1 for a random seed.

min : -1,

max : 999999


base64boolean ( default: 1 )

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: Our Most Advanced Virtual Try-On Model Yet

What is SegFit v1.3?

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.

What's New in v1.3

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.

Key Features

  • 99.9% consistency: Generates high-fidelity images that preserve the attire design, fabric texture, folds, and lighting.
  • Automatic Garment Masking: Separates clothing from background pixels, reducing manual editing by up to 90%.
  • Flexible Inputs:
    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.

Best Use Cases

  • E-commerce Catalogs: Instantly generate garment previews on a range of body types.
  • Marketing Campaigns: Produce banner images and social media assets with minimal design overhead.
  • Virtual Fitting Rooms: Integrate real-time try-on experiences into retail websites and mobile apps.
  • Content Creation: Streamline lookbooks, blog visuals, and influencer marketing with automated styling.

Prompt Tips and Output Quality

  1. Start with high-resolution images (≥1024px) for both outfit_image and model_image.
  2. Use uniform, uncluttered backgrounds to simplify automatic masking.
  3. Tweak image_quality (default 90) to balance file size and fidelity, ideal for web ready images.

FAQs

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.