Ray

ray

Luma Ray is a model that fast, high quality text-to-video and image-to-video (Also known as Dream Machine)

Fast Inference
REST API

Model Information

Response Time~40 sec
StatusActive
Version
0.0.1
Updated26 days ago

Prerequisites

  • Create an API Key from the Eachlabs Console
  • Install the required dependencies for your chosen language (e.g., requests for Python)

API Integration Steps

1. Create a Prediction

Send a POST request to create a new prediction. This will return a prediction ID that you'll use to check the result. The request should include your model inputs and API key.

import requests
import time
API_KEY = "YOUR_API_KEY" # Replace with your API key
HEADERS = {
"X-API-Key": API_KEY,
"Content-Type": "application/json"
}
def create_prediction():
response = requests.post(
"https://api.eachlabs.ai/v1/prediction/",
headers=HEADERS,
json={
"model": "ray",
"version": "0.0.1",
"input": {
"loop": false,
"prompt": "your prompt here",
"aspect_ratio": "16:9",
"end_video_id": "your end video id here",
"end_image_url": "your end image url here",
"start_video_id": "your start video id here",
"start_image_url": "your start image url here"
}
}
)
prediction = response.json()
if prediction["status"] != "success":
raise Exception(f"Prediction failed: {prediction}")
return prediction["predictionID"]

2. Get Prediction Result

Poll the prediction endpoint with the prediction ID until the result is ready. The API uses long-polling, so you'll need to repeatedly check until you receive a success status.

def get_prediction(prediction_id):
while True:
result = requests.get(
f"https://api.eachlabs.ai/v1/prediction/{prediction_id}",
headers=HEADERS
).json()
if result["status"] == "success":
return result
elif result["status"] == "error":
raise Exception(f"Prediction failed: {result}")
time.sleep(1) # Wait before polling again

3. Complete Example

Here's a complete example that puts it all together, including error handling and result processing. This shows how to create a prediction and wait for the result in a production environment.

try:
# Create prediction
prediction_id = create_prediction()
print(f"Prediction created: {prediction_id}")
# Get result
result = get_prediction(prediction_id)
print(f"Output URL: {result['output']}")
print(f"Processing time: {result['metrics']['predict_time']}s")
except Exception as e:
print(f"Error: {e}")

Additional Information

  • The API uses a two-step process: create prediction and poll for results
  • Response time: ~40 seconds
  • Rate limit: 60 requests/minute
  • Concurrent requests: 10 maximum
  • Use long-polling to check prediction status until completion

Overview

Ray is a video model designed for creating dynamic and visually compelling video outputs by leveraging customizable inputs. It supports fine-tuning of visual and temporal elements, enabling users to generate unique and high-quality videos tailored to various creative needs.

Technical Specifications

  • Advanced Visual Rendering: Built on a robust framework that synthesizes high-resolution video sequences with intricate details.
  • Input Flexibility: Supports a diverse range of inputs, including text prompts and multimedia references, for tailored outputs.
  • Transition Control: Allows precise customization of start and end visuals using video IDs and image URLs.
  • Aspect Ratio Adaptability: Ensures outputs are compatible with various display formats, from widescreen to square.
  • Looping Capability: Designed for continuous playback without visible breaks, ideal for certain creative contexts.

Key Considerations

  • Input Quality: High-quality image URLs and coherent prompts significantly enhance the output.
  • Aspect Ratio Selection: Mismatched aspect ratios might lead to unintended visual results. Always verify compatibility with the target medium.
  • Looping: While enabling loop, ensure the content supports seamless repetition to avoid perceptible breaks.
  • Start and End Points: Ensure the start_video_id and end_video_id or corresponding image URLs align with the intended narrative or visual flow.


Legal Information for Ray

By using this Ray, you agree to:

Tips & Tricks

  • Prompt Design:
    • Keep prompts concise and descriptive. Use vivid language to guide the model effectively.
    • Avoid ambiguous terms that might lead to generic or unintended visuals.
  • Aspect Ratio:
    • Use 1:1 for square videos, ideal for platforms like Instagram feed posts.
    • Use 9:16 for vertical videos, best for stories and mobile-first content.
    • Use 16:9 for widescreen videos, suitable for YouTube or cinematic presentations.
    • Use 4:3 for a more traditional look in professional or educational contexts.
    • Use 3:4, 9:21, or 21:9 for unique framing, ensuring the subject fits well within the chosen ratio.
  • Transition Elements:
    • Use start_image_url and end_image_url for static introductory and concluding frames.
    • Combine start_video_id and end_video_id for dynamic transitions that enhance storytelling.
  • Looping:
    • Enable the loop feature for outputs intended for repeated viewing, ensuring the start and end visuals naturally align.

Capabilities

Visual Output Customization for Ray

  • Dynamic Video Creation: Generate tailored video sequences using prompts and reference inputs.
  • Transition Design: Seamlessly integrate start and end visuals for cohesive storytelling.
  • Aspect Ratio Flexibility: Produce videos optimized for various formats, from widescreen to vertical.
  • Looping: Create videos suitable for continuous playback without noticeable disruptions.

Enhancements and Features for Ray

  • Smooth transitions between visuals and videos.
  • High-definition rendering with attention to detail.
  • Adaptability for different creative and professional contexts.

What can I use for?

  • Storytelling: Craft engaging narratives by combining prompts with start and end visuals.
  • Social Media Content: Ray generates videos tailored for platforms with specific aspect ratio requirements.
  • Educational Materials: Ray creates visually compelling content for presentations or tutorials.
  • Branding: Develop unique visual assets that align with brand aesthetics and goals.
  • Seamless Loops: Ray designs continuous loops for displays, exhibitions, or immersive experiences.

Things to be aware of

  • Experiment with different aspect_ratio values to see how the framing impacts the subject's focus and overall composition.
  • Combine prompt with start_image_url and end_image_url for a visually rich narrative.
  • Use the loop option to test how well the video transitions into seamless playback.
  • Select contrasting start_video_id and end_video_id for dynamic and engaging transitions.

Limitations

  • Input Dependency: Outputs are heavily influenced by the quality and relevance of provided inputs.
  • Loop Seamlessness: Achieving a perfect loop might require fine-tuning of start and end elements.
  • Aspect Ratio Constraints: Outputs might not fully adapt to extreme or unconventional aspect ratios.
  • Prompt Interpretation: The model might interpret vague prompts in unexpected ways, leading to less precise results.

Output Format: MP4

Related AI Models

lcm-animation

LCM animation Time Lapse Generator

lcm-animation

Text to Video
mochi-1

Mochi-1

mochi-1

Text to Video
ray-2-540p

Luma Ray2 540p

ray-2-540p

Text to Video
wan-2.1-1.3b

Wan 2.1-1.3B

wan-2-1-1-3b

Text to Video