Top.Mail.Ru
Главная icon
Главная
Галерея icon
Галерея
Unitool Labs icon
Unitool Labs
Блог icon
Блог
MCP icon
MCP
← Все модели

Luma Ray 3.2

luma-ray-3-2 · Видео · unitool

Видеомодель Luma нового поколения: генерация по тексту и картинке, переход из первого кадра в последний, монтаж готового ролика по промпту, смена формата кадра, HDR и бесшовный цикл.

Генерация асинхронная: создание, ожидание или опрос, результат по ссылке на 7 дней. Подробно: Генерации медиа

Генерация видео

Режим t2v · luma-ray-3-2:t2v

Цена

Зависит от параметров: 48 токенов на примере ниже, база 48. Точную цену своего запроса узнайте через POST /v1/quotes.

Состав цены (pricing из GET /v1/models/{id})
JSON
{
  "unit": "tokens",
  "kind": "by_parameters",
  "base": 48,
  "example_price": 48,
  "matrix": [
    {
      "when": {
        "duration": "5",
        "resolution": "360p"
      },
      "price": 10
    },
    {
      "when": {
        "duration": "10",
        "resolution": "360p"
      },
      "price": 29
    },
    {
      "when": {
        "duration": "5",
        "resolution": "540p"
      },
      "price": 24
    },
    {
      "when": {
        "duration": "10",
        "resolution": "540p"
      },
      "price": 73
    },
    {
      "when": {
        "duration": "5",
        "resolution": "720p"
      },
      "price": 48
    },
    {
      "when": {
        "duration": "10",
        "resolution": "720p"
      },
      "price": 145
    },
    {
      "when": {
        "duration": "5",
        "resolution": "1080p"
      },
      "price": 193
    },
    {
      "when": {
        "duration": "10",
        "resolution": "1080p"
      },
      "price": 577
    }
  ],
  "addons": [
    {
      "when": {
        "hdr": true
      },
      "multiply": 2
    }
  ]
}

Параметры

ПараметрТипОписание
promptобязательныйstring
aspect_ratio16:9 | 9:16 | 1:1 | 4:3 | 3:4 | 21:9Соотношение сторонПо умолчанию "16:9"
resolution360p | 540p | 720p | 1080pКачествоПо умолчанию "720p"
duration5 | 10ДлительностьПо умолчанию "5"
hdrbooleanHDR. 16-битный цвет и расширенный динамический диапазон. Только 720p или 1080p и только 5 секунд. Дороже вдвое. Cannot be combined with: loop.По умолчанию false
loopbooleanЗациклить. Конец сшивается с началом — видео крутится без склейки. Только 5 секунд, несовместимо с HDR. Cannot be combined with: hdr.По умолчанию false
image_urlsarray of file (≤ 1)A file_ref (asset:… or attachment:…), an https URL or a data: URL.

Пример запроса

curl
curl https://api.unitool.ai/v1/generations \
  -H "Authorization: Bearer $UNITOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Prefer: wait=60" \
  -d '{
  "model": "luma-ray-3-2",
  "mode": "t2v",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "duration": "5",
    "hdr": false,
    "loop": false
  }
}'
Python (requests)
import json, os, time, uuid, requests

API = "https://api.unitool.ai/v1"
headers = {"Authorization": f"Bearer {os.environ['UNITOOL_API_KEY']}"}
body = json.loads(r'''{
  "model": "luma-ray-3-2",
  "mode": "t2v",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "duration": "5",
    "hdr": false,
    "loop": false
  }
}''')
gen = requests.post(f"{API}/generations", json=body,
                    headers={**headers, "Idempotency-Key": str(uuid.uuid4()), "Prefer": "wait=60"}).json()
while gen["status"] in ("queued", "running"):
    time.sleep(5)
    gen = requests.get(f"{API}/generations/{gen['id']}", headers=headers).json()
print(gen["status"], [o["url"] for o in gen["outputs"]])
JavaScript (fetch)
const API = "https://api.unitool.ai/v1";
const headers = { Authorization: `Bearer ${process.env.UNITOOL_API_KEY}`, "Content-Type": "application/json" };
const body = {
  "model": "luma-ray-3-2",
  "mode": "t2v",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "duration": "5",
    "hdr": false,
    "loop": false
  }
};
let gen = await (await fetch(`${API}/generations`, {
  method: "POST", body: JSON.stringify(body),
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID(), Prefer: "wait=60" },
})).json();
while (gen.status === "queued" || gen.status === "running") {
  await new Promise((resolve) => setTimeout(resolve, 5000));
  gen = await (await fetch(`${API}/generations/${gen.id}`, { headers })).json();
}
console.log(gen.status, gen.outputs.map((output) => output.url));

Из первого кадра в последний

Режим frames · luma-ray-3-2:frames

Цена

Зависит от параметров: 48 токенов на примере ниже, база 48. Точную цену своего запроса узнайте через POST /v1/quotes.

Состав цены (pricing из GET /v1/models/{id})
JSON
{
  "unit": "tokens",
  "kind": "by_parameters",
  "base": 48,
  "example_price": 48,
  "matrix": [
    {
      "when": {
        "resolution": "360p"
      },
      "price": 10
    },
    {
      "when": {
        "resolution": "540p"
      },
      "price": 24
    },
    {
      "when": {
        "resolution": "720p"
      },
      "price": 48
    },
    {
      "when": {
        "resolution": "1080p"
      },
      "price": 193
    }
  ],
  "addons": [
    {
      "when": {
        "hdr": true
      },
      "multiply": 2
    }
  ]
}

Параметры

ПараметрТипОписание
promptstring
last_frame_urlобязательныйfileПоследний кадр. Обязателен: кадр, которым видео закончится. Первый кадр прикрепите скрепкой к сообщению. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
aspect_ratio16:9 | 9:16 | 1:1 | 4:3 | 3:4 | 21:9Соотношение сторонПо умолчанию "16:9"
resolution360p | 540p | 720p | 1080pКачествоПо умолчанию "720p"
hdrbooleanHDR. 16-битный цвет. Только 720p или 1080p. Дороже вдвое.По умолчанию false
image_urlsобязательныйarray of file (≤ 1)A file_ref (asset:… or attachment:…), an https URL or a data: URL.

Пример запроса

curl
curl https://api.unitool.ai/v1/generations \
  -H "Authorization: Bearer $UNITOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Prefer: wait=60" \
  -d '{
  "model": "luma-ray-3-2",
  "mode": "frames",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "hdr": false,
    "last_frame_url": "https://example.com/input.png",
    "image_urls": [
      "https://example.com/input.png"
    ]
  }
}'
Python (requests)
import json, os, time, uuid, requests

API = "https://api.unitool.ai/v1"
headers = {"Authorization": f"Bearer {os.environ['UNITOOL_API_KEY']}"}
body = json.loads(r'''{
  "model": "luma-ray-3-2",
  "mode": "frames",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "hdr": false,
    "last_frame_url": "https://example.com/input.png",
    "image_urls": [
      "https://example.com/input.png"
    ]
  }
}''')
gen = requests.post(f"{API}/generations", json=body,
                    headers={**headers, "Idempotency-Key": str(uuid.uuid4()), "Prefer": "wait=60"}).json()
while gen["status"] in ("queued", "running"):
    time.sleep(5)
    gen = requests.get(f"{API}/generations/{gen['id']}", headers=headers).json()
print(gen["status"], [o["url"] for o in gen["outputs"]])
JavaScript (fetch)
const API = "https://api.unitool.ai/v1";
const headers = { Authorization: `Bearer ${process.env.UNITOOL_API_KEY}`, "Content-Type": "application/json" };
const body = {
  "model": "luma-ray-3-2",
  "mode": "frames",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "16:9",
    "resolution": "720p",
    "hdr": false,
    "last_frame_url": "https://example.com/input.png",
    "image_urls": [
      "https://example.com/input.png"
    ]
  }
};
let gen = await (await fetch(`${API}/generations`, {
  method: "POST", body: JSON.stringify(body),
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID(), Prefer: "wait=60" },
})).json();
while (gen.status === "queued" || gen.status === "running") {
  await new Promise((resolve) => setTimeout(resolve, 5000));
  gen = await (await fetch(`${API}/generations/${gen.id}`, { headers })).json();
}
console.log(gen.status, gen.outputs.map((output) => output.url));

Монтаж готового видео

Режим edit · luma-ray-3-2:edit

Цена

Зависит от параметров: 1 токенов на примере ниже, база 35. Точную цену своего запроса узнайте через POST /v1/quotes.

Состав цены (pricing из GET /v1/models/{id})
JSON
{
  "unit": "tokens",
  "kind": "by_parameters",
  "base": 35,
  "example_price": 1,
  "matrix": [
    {
      "when": {
        "resolution": "360p"
      },
      "rate": 18,
      "per": "video_url_duration_sec"
    },
    {
      "when": {
        "resolution": "540p"
      },
      "rate": 24,
      "per": "video_url_duration_sec"
    },
    {
      "when": {
        "resolution": "720p"
      },
      "rate": 35,
      "per": "video_url_duration_sec"
    },
    {
      "when": {
        "resolution": "1080p"
      },
      "rate": 70,
      "per": "video_url_duration_sec"
    }
  ]
}

Параметры

ПараметрТипОписание
promptstring
video_urlобязательныйfileИсходное видео. Ролик до 18 секунд и до 200 МБ. Цена считается за каждую секунду исходника. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
resolution360p | 540p | 720p | 1080pКачествоПо умолчанию "720p"

Пример запроса

curl
curl https://api.unitool.ai/v1/generations \
  -H "Authorization: Bearer $UNITOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Prefer: wait=60" \
  -d '{
  "model": "luma-ray-3-2",
  "mode": "edit",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "resolution": "720p",
    "video_url": "https://example.com/input.mp4"
  }
}'
Python (requests)
import json, os, time, uuid, requests

API = "https://api.unitool.ai/v1"
headers = {"Authorization": f"Bearer {os.environ['UNITOOL_API_KEY']}"}
body = json.loads(r'''{
  "model": "luma-ray-3-2",
  "mode": "edit",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "resolution": "720p",
    "video_url": "https://example.com/input.mp4"
  }
}''')
gen = requests.post(f"{API}/generations", json=body,
                    headers={**headers, "Idempotency-Key": str(uuid.uuid4()), "Prefer": "wait=60"}).json()
while gen["status"] in ("queued", "running"):
    time.sleep(5)
    gen = requests.get(f"{API}/generations/{gen['id']}", headers=headers).json()
print(gen["status"], [o["url"] for o in gen["outputs"]])
JavaScript (fetch)
const API = "https://api.unitool.ai/v1";
const headers = { Authorization: `Bearer ${process.env.UNITOOL_API_KEY}`, "Content-Type": "application/json" };
const body = {
  "model": "luma-ray-3-2",
  "mode": "edit",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "resolution": "720p",
    "video_url": "https://example.com/input.mp4"
  }
};
let gen = await (await fetch(`${API}/generations`, {
  method: "POST", body: JSON.stringify(body),
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID(), Prefer: "wait=60" },
})).json();
while (gen.status === "queued" || gen.status === "running") {
  await new Promise((resolve) => setTimeout(resolve, 5000));
  gen = await (await fetch(`${API}/generations/${gen.id}`, { headers })).json();
}
console.log(gen.status, gen.outputs.map((output) => output.url));

Сменить формат кадра

Режим reframe · luma-ray-3-2:reframe

Цена

Зависит от параметров: 1 токенов на примере ниже, база 20. Точную цену своего запроса узнайте через POST /v1/quotes.

Состав цены (pricing из GET /v1/models/{id})
JSON
{
  "unit": "tokens",
  "kind": "by_parameters",
  "base": 20,
  "example_price": 1,
  "matrix": [
    {
      "when": {
        "resolution": "360p"
      },
      "rate": 5,
      "per": "video_url_duration_sec"
    },
    {
      "when": {
        "resolution": "540p"
      },
      "rate": 10,
      "per": "video_url_duration_sec"
    },
    {
      "when": {
        "resolution": "720p"
      },
      "rate": 20,
      "per": "video_url_duration_sec"
    },
    {
      "when": {
        "resolution": "1080p"
      },
      "rate": 58,
      "per": "video_url_duration_sec"
    }
  ]
}

Параметры

ПараметрТипОписание
promptstring
video_urlобязательныйfileИсходное видео. Ролик до 10 секунд и до 200 МБ. Цена считается за каждую секунду исходника. A file_ref (asset:… or attachment:…), an https URL or a data: URL.
aspect_ratio9:16 | 16:9 | 1:1 | 4:3 | 3:4 | 21:9Новый форматПо умолчанию "9:16"
resolution360p | 540p | 720p | 1080pКачествоПо умолчанию "720p"

Пример запроса

curl
curl https://api.unitool.ai/v1/generations \
  -H "Authorization: Bearer $UNITOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Prefer: wait=60" \
  -d '{
  "model": "luma-ray-3-2",
  "mode": "reframe",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "9:16",
    "resolution": "720p",
    "video_url": "https://example.com/input.mp4"
  }
}'
Python (requests)
import json, os, time, uuid, requests

API = "https://api.unitool.ai/v1"
headers = {"Authorization": f"Bearer {os.environ['UNITOOL_API_KEY']}"}
body = json.loads(r'''{
  "model": "luma-ray-3-2",
  "mode": "reframe",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "9:16",
    "resolution": "720p",
    "video_url": "https://example.com/input.mp4"
  }
}''')
gen = requests.post(f"{API}/generations", json=body,
                    headers={**headers, "Idempotency-Key": str(uuid.uuid4()), "Prefer": "wait=60"}).json()
while gen["status"] in ("queued", "running"):
    time.sleep(5)
    gen = requests.get(f"{API}/generations/{gen['id']}", headers=headers).json()
print(gen["status"], [o["url"] for o in gen["outputs"]])
JavaScript (fetch)
const API = "https://api.unitool.ai/v1";
const headers = { Authorization: `Bearer ${process.env.UNITOOL_API_KEY}`, "Content-Type": "application/json" };
const body = {
  "model": "luma-ray-3-2",
  "mode": "reframe",
  "input": {
    "prompt": "A red fox running through fresh snow at sunrise",
    "aspect_ratio": "9:16",
    "resolution": "720p",
    "video_url": "https://example.com/input.mp4"
  }
};
let gen = await (await fetch(`${API}/generations`, {
  method: "POST", body: JSON.stringify(body),
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID(), Prefer: "wait=60" },
})).json();
while (gen.status === "queued" || gen.status === "running") {
  await new Promise((resolve) => setTimeout(resolve, 5000));
  gen = await (await fetch(`${API}/generations/${gen.id}`, { headers })).json();
}
console.log(gen.status, gen.outputs.map((output) => output.url));

Мы используем файлы cookie

Продолжая пользоваться сайтом, вы соглашаетесь с Политикой обработки персональных данных.