Luma Modify Video
Transform videos seamlessly with high-fidelity generative edits while preserving original actor performances.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/modify-video"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "mode": "adhere_1",
12 "prompt": "woman in a yarn doll style",
13 "video_url": "https://segmind-resources.s3.amazonaws.com/input/c08771b9-b671-4c12-9ea7-af4048b9d194-894a8bdf-6064-40ea-a78d-06c1abff262b.mp4",
14 "first_frame_url": "https://segmind-resources.s3.amazonaws.com/input/f2220449-e53a-40d5-aba7-e12c6f562ab5-modify-video-ip.png"
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/modify-video"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "mode": "adhere_1",
12 "prompt": "woman in a yarn doll style",
13 "video_url": "https://segmind-resources.s3.amazonaws.com/input/c08771b9-b671-4c12-9ea7-af4048b9d194-894a8bdf-6064-40ea-a78d-06c1abff262b.mp4",
14 "first_frame_url": "https://segmind-resources.s3.amazonaws.com/input/f2220449-e53a-40d5-aba7-e12c6f562ab5-modify-video-ip.png"
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/modify-videoParameters
video_urlrequiredstring (uri)The source video URL. Use short MP4s under 30 seconds. Maximum video size is 100mb.
first_frame_urloptionalstring (uri)An optional 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.
modeoptionalstringHow closely the output should follow the source video. Adhere: very close, for subtle enhancements. Flex: allows more stylistic change while keeping recognizable elements. Reimagine: loosely follows the source, for dramatic or transformative changes.
"adhere_1""adhere_1""adhere_2""adhere_3""flex_1""flex_2""flex_3""reimagine_1""reimagine_2""reimagine_3"promptoptionalstringGuides video modification.
Response 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