Luma Ray Image to Video Serverless API

With Luma's Ray2 image-to-video, transform your static images into cinematic dynamic videos.

~125.19s
$1.6 per generation
 1import requests
 2import json
 3
 4url = "https://api.segmind.com/v1/luma-ray-img-2-video"
 5headers = {
 6    "x-api-key": "YOUR_API_KEY",
 7    "Content-Type": "application/json"
 8}
 9
10data = {
11    "prompt": "A couple locks eyes, gradually moving closer. Their expressions soften with affection. They lean in, sharing a gentle kiss, capturing a moment of genuine connection.",
12    "start_frame": "https://segmind-resources.s3.amazonaws.com/input/0bf45723-c1e2-4349-adcd-9dd48509622a-i2v_01_first_frame.jpg",
13    "loop": false,
14    "resolution": "720p",
15    "aspect_ratio": "1:1"
16}
17
18response = requests.post(url, headers=headers, json=data)
19
20if response.status_code == 200:
21    result = response.json()
22    print(json.dumps(result, indent=2))
23else:
24    print(f"Error: {response.status_code}")
25    print(response.text)

API Endpoint

POSThttps://api.segmind.com/v1/luma-ray-img-2-video

Parameters

promptrequired
string

Prompt to render

aspect_ratiooptional
string

An enumeration.

Default: "1:1"
Allowed values :
"1:1""16:9""2:3""3:2""4:5""5:4""9:16""9:21""21:9"
conceptsoptional
string[]

List of camera concepts to apply

Array items:
aerialoptional
any
aerial_droneoptional
any
bolt_camoptional
any
crane_downoptional
any
crane_upoptional
any
dolly_zoomoptional
any
elevator_doorsoptional
any
eye_leveloptional
any
ground_leveloptional
any
handheldoptional
any
high_angleoptional
any
low_angleoptional
any
orbit_leftoptional
any
orbit_rightoptional
any
over_the_shoulderoptional
any
overheadoptional
any
pan_leftoptional
any
pan_rightoptional
any
pedestal_downoptional
any
pedestal_upoptional
any
povoptional
any
pull_outoptional
any
push_inoptional
any
roll_leftoptional
any
roll_rightoptional
any
selfieoptional
any
staticoptional
any
tilt_downoptional
any
tilt_upoptional
any
tiny_planetoptional
any
truck_leftoptional
any
truck_rightoptional
any
zoom_inoptional
any
zoom_outoptional
any
loopoptional
boolean

Whether to loop the video

Default: false
resolutionoptional
string

An enumeration.

Default: "720p"
Allowed values :
"720p""540p"
start_frameoptional
string (uri)

The frame 0 of the generation

Default: "https://segmind-resources.s3.amazonaws.com/input/0bf45723-c1e2-4349-adcd-9dd48509622a-i2v_01_first_frame.jpg"

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