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
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/video-tryon";
const data = {
"prompt": "A woman dressed in a Superman costume poses in a futuristic city.",
"reference_img": "toB64('https://segmind-resources.s3.amazonaws.com/input/e8601820-8a4a-4fff-81fb-2c21f77363c3-f9162e73-0c8b-4c77-997f-87ec85fc8c02.png')",
"input_video": "https://segmind-resources.s3.amazonaws.com/input/28386d68-f3d4-435d-8ab0-b07bb3609fb9-clideo_editor_7880b044c8704498ae9c43258a503d92.mp4",
"base_64": 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);
}
})();
Guides video modification.
URL of the first frame of the video. This should be a modified version of the original first frame, it will be used to guide the video modification.
The source video URL. Use short MP4s under 50 seconds
Base64 encoding of the output
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.
Video Tryon by Segmind redefines virtual try-on technology, offering the most advanced AI-powered video solution for fashion and e-commerce. Instantly generate hyper-realistic videos to visualize any garment on any person—with seamless motion, perfect face and lip sync, and photorealistic details. Powered by Segmind’s proprietary architecture, Video Tryon supports up to 50 seconds per video (industry’s highest), enabling brands, retailers, and individual creators to showcase apparel, try outfits virtually, and enhance user engagement without the need for manual model photography or video shoots. Stand out with Video Tryon’s superior garment fitting, accurate style transfer, and next-gen video fidelity. Get unparalleled realism, flexibility, and speed—making Segmind Video Tryon the #1 choice for online fashion experiences, product visualization, and creative content generation. Optimize your fashion campaigns, boost conversion rates, and future-proof your business with the most trusted name in AI video virtual try-on technology.