---
title: "Luma Ray 2 Text-to-Video API & Playground - Comfy"
description: "Luma Ray 2 Text-to-Video: Generates a 5 or 9 second video from text at 540p to 4K, in seven aspect ratios including 21:9, with an option to loop."
canonical: https://comfy.org/hub/models/luma-ray-2-text-to-video/
lang: en
index: https://comfy.org/llms.txt
---

[Models](https://comfy.org/hub/models/)

Luma

[Generate videos](https://comfy.org/hub/models/?useCase=generate-videos)

# Luma Ray 2 Text-to-Video

Generates a 5 or 9 second video from text at 540p to 4K, in seven aspect ratios including 21:9, with an option to loop.

- Use via API
- [Open in Cloud](https://stagingcloud.comfy.org/)

Cost depends on your settings.

- [text-to-video](https://comfy.org/hub/models/?q=text-to-video)

## Playground

Input

Prompt

First frame

Select or drop an image PNG, JPEG, WEBP ·  up to 25 MiB

Last frame

Select or drop an image PNG, JPEG, WEBP ·  up to 25 MiB

Aspect ratio

Duration

Output type

Resolution

Advanced settings

Loop video

Make the end of the video connect to its beginning.

Output

00:00

Example

## Sample outputs

-

## Call this model from your code

Sends your Playground inputs to Comfy Router.

[API docs (opens in a new tab)](https://docs.comfy.org/development/comfy-router/models#luma)

1. ### Get an API key

  Needs a paid Cloud plan with credits.

  [Get an API key (opens in a new tab)](https://platform.comfy.org/profile/api-keys?onboarding=models&model=luma--ray-2-text-to-video--generate-videos)
2. ### Install the SDK

  Python 3.10+. Also on npm as @comfyorg/sdk.

  pip install comfy-sdk==0.2.0
3. ### Run it

  Calls Comfy Router at this endpoint with your COMFY_API_KEY.

  POST /v2/models/luma/ray-2

Fill in the Playground inputs to generate a request.

## More from Luma

Compare Luma's other models. Price is the default setting; resolution and duration show the full range each model offers.

| Model | Price | Resolution | Duration |
| --- | --- | --- | --- |
| [Luma Uni 1 Image Edit](https://comfy.org/hub/models/luma-uni-1-image-edit/) | — | — | — |
| [Luma Uni 1 Text-to-Image](https://comfy.org/hub/models/luma-uni-1-text-to-image/) | — | — | — |
| [Luma Uni 1 Max Image Edit](https://comfy.org/hub/models/luma-uni-1-max-image-edit/) | — | — | — |
| [Luma Uni 1 Max Text-to-Image](https://comfy.org/hub/models/luma-uni-1-max-text-to-image/) | — | — | — |
| [Luma Photon 1 Text-to-Image](https://comfy.org/hub/models/luma-photon-1-text-to-image/) | 2.19 credits /Run | — | — |
| [Luma Photon 1 Image Edit](https://comfy.org/hub/models/luma-photon-1-image-edit/) | 2.19 credits /Run | — | — |
| [Luma Ray 2 Image-to-Video](https://comfy.org/hub/models/luma-ray-2-image-to-video/) | — | 540p – 4K | 5 – 9s |
| [Luma Photon Flash 1 Text-to-Image](https://comfy.org/hub/models/luma-photon-flash-1-text-to-image/) | 0.57 credits /Run | — | — |
| [Luma Photon Flash 1 Image Edit](https://comfy.org/hub/models/luma-photon-flash-1-image-edit/) | 0.57 credits /Run | — | — |
| [Luma Ray Flash 2 Image-to-Video](https://comfy.org/hub/models/luma-ray-flash-2-image-to-video/) | — | 540p – 4K | 5 – 9s |
| [Luma Ray Flash 2 Text-to-Video](https://comfy.org/hub/models/luma-ray-flash-2-text-to-video/) | — | 540p – 4K | 5 – 9s |
