Luma Modify Video

Transform videos seamlessly with high-fidelity generative edits while preserving original actor performances.

~164.85s
~$0.602
 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

POSThttps://api.segmind.com/v1/modify-video

Parameters

video_urlrequired
string (uri)

The source video URL. Use short MP4s under 30 seconds. Maximum video size is 100mb.

first_frame_urloptional
string (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.

modeoptional
string

How 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.

Default: "adhere_1"
Allowed values :
"adhere_1""adhere_2""adhere_3""flex_1""flex_2""flex_3""reimagine_1""reimagine_2""reimagine_3"
promptoptional
string

Guides 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.

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