Skip to main content
API Reference for luma/ray-flash-2, served by Comfy Router from Luma.

Quick start

Create a key in your Comfy workspace and export it as COMFY_API_KEY. The Python and TypeScript snippets use the Comfy SDKs (pip install comfy-sdk, npm install @comfyorg/sdk); the cURL snippet is the same call over raw HTTP. Model ID: luma/ray-flash-2 Endpoint: POST https://api.comfy.org/v2/models/luma/ray-flash-2

Schema

Input

string
default:"\"16:9\""
required
The aspect ratio of the generationPossible values: 1:1, 16:9, 9:16, 4:3, 3:4, 21:9, 9:21
string (uri)
The callback URL of the generation, a POST request with Generation object will be sent to the callback URL when the generation is dreaming, completed, or failedFormat: uri
`5s`, `9s` | string
required
string
default:"\"video\""
Possible values: video
object
The keyframes of the generation
object
A keyframe can be either a Generation reference, an Image, or a Video
object
A keyframe can be either a Generation reference, an Image, or a Video
boolean
Whether to loop the video
string
The video model used for the generation. On the Comfy Router route POST /v2/models/luma/{model} this field is supplied from the path and MUST NOT be sent; on the v1 POST /proxy/luma/generations route it is required and constrained to the LumaVideoModel enum (ray-2, ray-flash-2).
string
required
The prompt of the generation
`540p`, `720p`, `1080p`, `4k` | string
required
Generated from the schema Router serves at GET /v2/models/luma/ray-flash-2/openapi.json, the same document it validates a call against before the request reaches the provider.

Output

object
The assets of the generation
string (uri)
The URL of the imageFormat: uri
string (uri)
The URL of the progress videoFormat: uri
string (uri)
The URL of the videoFormat: uri
string (date-time)
The date and time when the generation was createdFormat: date-time
string
The reason for the state of the generation
string
Possible values: video, image
string (uuid)
The ID of the generationFormat: uuid
string
The model used for the generation
object
The request of the generation
string
The state of the generationPossible values: queued, dreaming, completed, failed

Examples

Input

Output

Before you ship

The SDKs create an Idempotency-Key and reuse it for automatic retries. For manual retries, reuse the original key. Router can hold the connection for up to 10 minutes. When a request fails, Router sends an X-Comfy-Error-Type response header explaining why. A 422 means Router rejected the input before calling the provider. Download generated assets promptly because result URLs can expire.

Headers

Authentication, idempotency, request IDs, error buckets, retry pacing, spend limits.

Using the Router API

Model discovery, validation errors, retries, and billing.

Limitations

What Router does not do today, and what to use instead.