Stable Video Diffusion Serverless API
Takes image as input and returns a video.
~29.64s
~$0.166
1import requests
2import json
3
4url = "https://api.segmind.com/v1/svd"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "image": "https://segmind-sd-models.s3.amazonaws.com/outputs/svd_input.png",
12 "fps": 7,
13 "motion": 127,
14 "seed": 452361789,
15 "cond_aug": 0.1,
16 "frames": "14",
17 "resize_method": "maintain_aspect_ratio",
18 "base64": false
19}
20
21response = requests.post(url, headers=headers, json=data)
22
23if response.status_code == 200:
24 result = response.json()
25 print(json.dumps(result, indent=2))
26else:
27 print(f"Error: {response.status_code}")
28 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/svd"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "image": "https://segmind-sd-models.s3.amazonaws.com/outputs/svd_input.png",
12 "fps": 7,
13 "motion": 127,
14 "seed": 452361789,
15 "cond_aug": 0.1,
16 "frames": "14",
17 "resize_method": "maintain_aspect_ratio",
18 "base64": false
19}
20
21response = requests.post(url, headers=headers, json=data)
22
23if response.status_code == 200:
24 result = response.json()
25 print(json.dumps(result, indent=2))
26else:
27 print(f"Error: {response.status_code}")
28 print(response.text)API Endpoint
POST
https://api.segmind.com/v1/svdParameters
imagerequiredstring (uri)Input Image.
base64optionalbooleanBase64 encoding of the output video.
Default:
falsecond_augoptionalnumbernoise added to the conditioning image
Default:
0.2Range: 0 - 1fpsoptionalintegerNumber of frames per second
Default:
7Range: 1 - 60framesoptionalintegerNo of frames in output video
Default:
14Allowed values :
1425motionoptionalintegerto control the motion of the generated video
Default:
127Range: 1 - 180resize_methodoptionalstringDecides the output video dimensions
Default:
"maintain_aspect_ratio"Allowed values :
"maintain_aspect_ratio""crop_to_16_9"seedoptionalintegerSeed for video generation.
Default:
-1Range: -1 - 999999999999999Response Type
Returns: Video
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
400
Bad Request
Invalid parameters or request format
401
Unauthorized
Missing or invalid API key
403
Forbidden
Insufficient permissions
404
Not Found
Model or endpoint not found
406
Insufficient Credits
Not enough credits to process request
429
Rate Limited
Too many requests
500
Server Error
Internal server error
502
Bad Gateway
Service temporarily unavailable
504
Timeout
Request timed out