Video Tryon Serverless API
Video Tryon is Segmind’s next-generation AI video model for instant virtual try-on, allowing users to visualize any outfit on any person in high-quality, fully-preserved motion up to 50 seconds.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/video-tryon"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "A woman dressed in a Superman costume poses in a futuristic city.",
12 "reference_img": "https://segmind-resources.s3.amazonaws.com/input/e8601820-8a4a-4fff-81fb-2c21f77363c3-f9162e73-0c8b-4c77-997f-87ec85fc8c02.png",
13 "input_video": "https://segmind-resources.s3.amazonaws.com/input/28386d68-f3d4-435d-8ab0-b07bb3609fb9-clideo_editor_7880b044c8704498ae9c43258a503d92.mp4",
14 "base_64": false
15}
16
17response = requests.post(url, headers=headers, json=data)
18
19if response.status_code == 200:
20 result = response.json()
21 print(json.dumps(result, indent=2))
22else:
23 print(f"Error: {response.status_code}")
24 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/video-tryon"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "prompt": "A woman dressed in a Superman costume poses in a futuristic city.",
12 "reference_img": "https://segmind-resources.s3.amazonaws.com/input/e8601820-8a4a-4fff-81fb-2c21f77363c3-f9162e73-0c8b-4c77-997f-87ec85fc8c02.png",
13 "input_video": "https://segmind-resources.s3.amazonaws.com/input/28386d68-f3d4-435d-8ab0-b07bb3609fb9-clideo_editor_7880b044c8704498ae9c43258a503d92.mp4",
14 "base_64": false
15}
16
17response = requests.post(url, headers=headers, json=data)
18
19if response.status_code == 200:
20 result = response.json()
21 print(json.dumps(result, indent=2))
22else:
23 print(f"Error: {response.status_code}")
24 print(response.text)API Endpoint
https://api.segmind.com/v1/video-tryonParameters
input_videorequiredstring (uri)The source video URL. Use short MP4s under 50 seconds
"https://segmind-resources.s3.amazonaws.com/input/28386d68-f3d4-435d-8ab0-b07bb3609fb9-clideo_editor_7880b044c8704498ae9c43258a503d92.mp4"promptrequiredstringGuides video modification.
reference_imgrequiredstring (uri)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.
"https://segmind-resources.s3.amazonaws.com/input/e8601820-8a4a-4fff-81fb-2c21f77363c3-f9162e73-0c8b-4c77-997f-87ec85fc8c02.png"base_64optionalbooleanBase64 encoding of the output
falseResponse Type
Returns: Video
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out