> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-docs-cms-changelog-node-lifecycle.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Uni 1 Max with Comfy Router

> Call luma_2/uni-1-max through Comfy Router: endpoint, request shape and the response Router returns.

API Reference for `luma_2/uni-1-max`, served by Comfy Router from Luma 2.

## Quick start

Create a key at [platform.comfy.org/profile/api-keys](https://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-max`

**Endpoint:** `POST https://api.comfy.org/v2/models/luma_2/uni-1-max`

<CodeGroup>
  ```python Python theme={null}
  from comfy_sdk import Comfy

  # Reads COMFY_API_KEY from the environment. Each call sends a fresh
  # Idempotency-Key and waits up to 10 minutes for the finished result.
  with Comfy() as client:
      result = client.models.run(
          "luma_2/uni-1-max",
          {
              "prompt": "a red circle on a plain white background",
              "type": "image",
          },
      )

  print(result)
  ```

  ```typescript TypeScript theme={null}
  import { comfy } from "@comfyorg/sdk";

  // Reads COMFY_API_KEY from the environment. Each call sends a fresh
  // Idempotency-Key and waits up to 10 minutes for the finished result.
  const { data } = await comfy.models.run("luma_2/uni-1-max", {
    prompt: "a red circle on a plain white background",
    type: "image",
  });

  console.log(data);
  ```

  ```bash cURL theme={null}
  curl https://api.comfy.org/v2/models/luma_2/uni-1-max \
    -H "X-API-Key: $COMFY_API_KEY" \
    -H "Idempotency-Key: $(uuidgen)" \
    -H "Content-Type: application/json" \
    -d "{\"prompt\": \"a red circle on a plain white background\", \"type\": \"image\"}"
  ```
</CodeGroup>

## Schema

### Input

<ParamField body="aspect_ratio" type="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`
</ParamField>

<ParamField body="image_ref" type="object[]">
  Reference images for style/content guidance. Up to 9 for type 'image', up to 8 for type 'image\_edit'.
</ParamField>

<ParamField body="image_ref[].data" type="string">
  Base64-encoded image or video data
</ParamField>

<ParamField body="image_ref[].generation_id" type="string">
  UUID of a prior completed generation to reuse as the source. Used by ray-3.2 video\_edit / video\_reframe.
</ParamField>

<ParamField body="image_ref[].media_type" type="string">
  MIME type. Required with data (and with url for video sources, e.g. video/mp4 on video\_edit / video\_reframe).
</ParamField>

<ParamField body="image_ref[].url" type="string">
  Publicly accessible image or video URL
</ParamField>

<ParamField body="model" type="string">
  Model to use. uni-1 / uni-1-max for image generation, ray-3.2 for video generation, editing, and reframing.
</ParamField>

<ParamField body="output_format" type="string">
  Output image format

  Possible values: `png`, `jpeg`
</ParamField>

<ParamField body="prompt" type="string" required>
  Text prompt
</ParamField>

<ParamField body="source" type="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.
</ParamField>

<ParamField body="source.data" type="string">
  Base64-encoded image or video data
</ParamField>

<ParamField body="source.generation_id" type="string">
  UUID of a prior completed generation to reuse as the source. Used by ray-3.2 video\_edit / video\_reframe.
</ParamField>

<ParamField body="source.media_type" type="string">
  MIME type. Required with data (and with url for video sources, e.g. video/mp4 on video\_edit / video\_reframe).
</ParamField>

<ParamField body="source.url" type="string">
  Publicly accessible image or video URL
</ParamField>

<ParamField body="style" type="string">
  Style preset

  Possible values: `auto`, `manga`
</ParamField>

<ParamField body="type" type="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`
</ParamField>

<ParamField body="video" type="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.
</ParamField>

<ParamField body="video.duration" type="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`
</ParamField>

<ParamField body="video.exr_export" type="boolean">
  Export an EXR file alongside the MP4. Requires hdr true. Rejected for video\_reframe.
</ParamField>

<ParamField body="video.hdr" type="boolean">
  Render in HDR. Requires 720p/1080p. Rejected for video\_reframe.
</ParamField>

<ParamField body="video.keyframes" type="object[]">
  Guide-frame images. A single keyframe makes a type "video" request a single-keyframe extend, which always bills as one 5s block.
</ParamField>

<ParamField body="video.keyframes[].data" type="string">
  Base64-encoded image or video data
</ParamField>

<ParamField body="video.keyframes[].generation_id" type="string">
  UUID of a prior completed generation to reuse as the source. Used by ray-3.2 video\_edit / video\_reframe.
</ParamField>

<ParamField body="video.keyframes[].media_type" type="string">
  MIME type. Required with data (and with url for video sources, e.g. video/mp4 on video\_edit / video\_reframe).
</ParamField>

<ParamField body="video.keyframes[].url" type="string">
  Publicly accessible image or video URL
</ParamField>

<ParamField body="video.loop" type="boolean">
  Loop the generated clip. Create-only (type video).
</ParamField>

<ParamField body="video.resolution" type="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`
</ParamField>

<ParamField body="video.start_frame" type="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.
</ParamField>

<ParamField body="video.start_frame.data" type="string">
  Base64-encoded image or video data
</ParamField>

<ParamField body="video.start_frame.generation_id" type="string">
  UUID of a prior completed generation to reuse as the source. Used by ray-3.2 video\_edit / video\_reframe.
</ParamField>

<ParamField body="video.start_frame.media_type" type="string">
  MIME type. Required with data (and with url for video sources, e.g. video/mp4 on video\_edit / video\_reframe).
</ParamField>

<ParamField body="video.start_frame.url" type="string">
  Publicly accessible image or video URL
</ParamField>

<ParamField body="web_search" type="boolean">
  Enable web search grounding
</ParamField>

Generated from the schema Router serves at `GET /v2/models/luma_2/uni-1-max/openapi.json`, the same document it validates a call against before the request reaches the provider.

### Output

<ResponseField name="created_at" type="string">
  Creation timestamp
</ResponseField>

<ResponseField name="failure_code" type="string">
  Machine-readable failure code for programmatic handling

  Possible values: `content_moderated`, `generation_failed`, `budget_exhausted`, `output_not_found`
</ResponseField>

<ResponseField name="failure_reason" type="string">
  Human-readable failure description, populated only on a FAILED generation. `null` on a successful one.
</ResponseField>

<ResponseField name="id" type="string">
  Generation identifier
</ResponseField>

<ResponseField name="model" type="string">
  Model used
</ResponseField>

<ResponseField name="output" type="object[]">
  A generated output entry
</ResponseField>

<ResponseField name="output[].type" type="string">
  Media type (e.g. image)
</ResponseField>

<ResponseField name="output[].url" type="string">
  Presigned URL (1hr expiry)
</ResponseField>

<ResponseField name="state" type="string">
  Current state of the generation

  Possible values: `queued`, `processing`, `completed`, `failed`
</ResponseField>

<ResponseField name="type" type="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`
</ResponseField>

## Examples

### Input

```json theme={null}
{
  "prompt": "a red circle on a plain white background",
  "type": "image"
}
```

### Output

```json theme={null}
{
  "created_at": "2027-01-01T00:00:00Z",
  "failure_code": null,
  "failure_reason": null,
  "id": "gen-luma-agents-3f2a7c1e8b40",
  "model": "uni-1",
  "output": [
    {
      "type": "image",
      "url": "https://example.invalid/luma_2/uni-1/generated.png"
    }
  ],
  "state": "completed",
  "type": "image"
}
```

## Before you ship

The snippets above are the shortest working call. Three things are the same for every model and are documented once on the [Comfy Router headers](/development/comfy-router/headers) page: send an `Idempotency-Key` on every paid call and reuse it when you retry, expect the connection to be held up to Router's 10 minute deadline, and keep `X-Comfy-Request-Id` from every response. The SDKs do all three for you; the cURL tab does none of them. On failure, `X-Comfy-Error-Type` names the bucket, and a `422` means the body failed the model's schema and was never billed.

<CardGroup cols={3}>
  <Card title="Headers" icon="list" href="/development/comfy-router/headers">
    Authentication, idempotency, request IDs, error buckets, retry pacing, spend limits.
  </Card>

  <Card title="Quick Start" icon="rocket" href="/development/comfy-router/quickstart">
    Typed error handling in Python and TypeScript, reading the 422, walking the catalog.
  </Card>

  <Card title="Limitations" icon="triangle-exclamation" href="/development/comfy-router/limitations">
    What Router does not do today, and what to use instead.
  </Card>
</CardGroup>
