Skip to main content
Use luma_2/uni-1 with the Comfy Router API. Luma 2 provides the model; Router gives it the shared authentication and request route below.

Quick start

Create a key at platform.comfy.org/profile/api-keys 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_2/uni-1 Endpoint: POST https://api.comfy.org/v2/models/luma_2/uni-1

Schema

Input

string
Output aspect ratio. The ray-3.2 video models support the subset 9:16, 3:4, 1:1, 4:3, 16:9, 21:9.Possible values: 3:1, 2:1, 21:9, 16:9, 3:2, 4:3, 1:1, 3:4, 2:3, 9:16, 1:2, 1:3
object[]
Reference images for style/content guidance. Up to 9 for type ‘image’, up to 8 for type ‘image_edit’.
string
Base64-encoded image or video data
string
UUID of a prior completed generation to reuse as the source. Used by ray-3.2 video_edit / video_reframe.
string
MIME type. Required with data (and with url for video sources, e.g. video/mp4 on video_edit / video_reframe).
string
Publicly accessible image or video URL
string
Model to use. uni-1 / uni-1-max for image generation, ray-3.2 for video generation, editing, and reframing.
string
Output image formatPossible values: png, jpeg
string
required
Text prompt
object
Reference to an image or video. Used for style/content guidance, guided generation, video-edit/video-reframe sources, and guide keyframes. Provide exactly one of generation_id, url, or data.
string
Base64-encoded image or video data
string
UUID of a prior completed generation to reuse as the source. Used by ray-3.2 video_edit / video_reframe.
string
MIME type. Required with data (and with url for video sources, e.g. video/mp4 on video_edit / video_reframe).
string
Publicly accessible image or video URL
string
Style presetPossible values: auto, manga
string
The kind of generation to perform. image/image_edit are produced by the uni-1 / uni-1-max models; video/video_edit/video_reframe are produced by the ray-3.2 model.Possible values: image, image_edit, video, video_edit, video_reframe
object
Video output settings for ray-3.2. Only the fields that affect validation and billing are modelled here; additional fields (edit controls, end_frame, loop, source_position) are forwarded to Luma untouched.
string
Clip duration for ray-3.2 video / video_edit. Defaults to 5s. HDR generation (type video) is restricted to 5s.Possible values: 5s, 10s
boolean
Export an EXR file alongside the MP4. Requires hdr true. Rejected for video_reframe.
boolean
Render in HDR. Requires 720p/1080p. Rejected for video_reframe.
object[]
Guide-frame images. A single keyframe makes a type “video” request a single-keyframe extend, which always bills as one 5s block.
string
Base64-encoded image or video data
string
UUID of a prior completed generation to reuse as the source. Used by ray-3.2 video_edit / video_reframe.
string
MIME type. Required with data (and with url for video sources, e.g. video/mp4 on video_edit / video_reframe).
string
Publicly accessible image or video URL
boolean
Loop the generated clip. Create-only (type video).
string
Output resolution for ray-3.2 video. Defaults to 720p. 360p is the draft tier. HDR requires 720p or 1080p.Possible values: 360p, 540p, 720p, 1080p
object
Reference to an image or video. Used for style/content guidance, guided generation, video-edit/video-reframe sources, and guide keyframes. Provide exactly one of generation_id, url, or data.
string
Base64-encoded image or video data
string
UUID of a prior completed generation to reuse as the source. Used by ray-3.2 video_edit / video_reframe.
string
MIME type. Required with data (and with url for video sources, e.g. video/mp4 on video_edit / video_reframe).
string
Publicly accessible image or video URL
Enable web search grounding
Generated from the schema Router serves at GET /v2/models/luma_2/uni-1/openapi.json, the same document it validates a call against before the request reaches the provider.

Output

string
Creation timestamp
string
Machine-readable failure code for programmatic handlingPossible values: content_moderated, generation_failed, budget_exhausted, output_not_found
string
Human-readable failure description, populated only on a FAILED generation. null on a successful one.
string
Generation identifier
string
Model used
object[]
A generated output entry
string
Media type (e.g. image)
string
Presigned URL (1hr expiry)
string
Current state of the generationPossible values: queued, processing, completed, failed
string
The kind of generation to perform. image/image_edit are produced by the uni-1 / uni-1-max models; video/video_edit/video_reframe are produced by the ray-3.2 model.Possible values: image, image_edit, video, video_edit, video_reframe

Examples

Input

Output

Before you ship

Save one Idempotency-Key for each call and reuse it for retries. Router can hold the connection for up to 10 minutes. The SDKs handle authentication; raw HTTP clients send the headers themselves. Use X-Comfy-Error-Type to classify a failure. 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

Find models, inspect schemas, and retry safely.

Limitations

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