Luma API
Luma API on WaveSpeedAI — Ray 3.2 text-to-video, image-to-video, video edit and video reframing, earlier Ray 2 and Ray 1.6 models, and Uni v1 and Photon image generation and editing, all through one REST API.
Use Luma's Ray 3.2 for cinematic text-to-video and image-to-video with controllable aspect ratio, resolution and duration, re-render or reframe existing footage with video edit and video reframing, and generate or edit images with Uni v1 and Photon. Ray 2 and Ray 1.6 stay available for earlier workflows.
Tổng quan
Giới thiệu về Luma API
Luma làm được gì, nằm ở đâu trong dòng mô hình của Luma AI, và vì sao các đội ngũ chọn nó.
Luma là mô hình tạo video từ Luma AI, có sẵn qua REST API của WaveSpeedAI. Luma API on WaveSpeedAI — Ray 3.2 text-to-video, image-to-video, video edit and video reframing, earlier Ray 2 and Ray 1.6 models, and Uni v1 and Photon image generation and editing, all through one REST API.
Use Luma's Ray 3.2 for cinematic text-to-video and image-to-video with controllable aspect ratio, resolution and duration, re-render or reframe existing footage with video edit and video reframing, and generate or edit images with Uni v1 and Photon. Ray 2 and Ray 1.6 stay available for earlier workflows.
Họ Luma trên WaveSpeedAI cung cấp 6 endpoint REST bao gồm 5 quy trình Video-To-Video, Image-To-Video, Text-To-Video, Image-To-Image, Text-To-Image. Mỗi biến thể có giá, các tham số điều chỉnh và kết quả mẫu riêng — hãy chọn biến thể phù hợp với dạng đầu vào và ràng buộc sản xuất của bạn, hoặc gọi nhiều biến thể từ cùng một API key để ghép các pipeline nhiều bước.
Chạy Luma bằng cùng API key, tài khoản thanh toán và hạn mức tốc độ bạn dùng cho hơn 1.000 mô hình AI khác trên WaveSpeedAI. Không cần thiết lập nhà cung cấp riêng, không cần SDK cho từng nhà cung cấp, không có hạn mức tốc độ riêng của từng hãng — một lần tích hợp bao quát mọi thứ, từ text-to-image và text-to-video đến tổng hợp âm thanh, tạo 3D, nâng cấp và chỉnh sửa.
Endpoint
Tất cả endpoint API Luma
6 endpoint Luma hiện có sẵn trên WaveSpeedAI — hãy chọn biến thể phù hợp với quy trình của bạn.
/filters:quality(82)/media/images/1782717317688496873_qX6fpyHQ.webp)
Ray 3.2 Video Edit
Luma Ray 3.2 Video Edit is a fast AI video-to-video editing model that re-renders an existing source video from a text prompt while preserving the original motion and timing. Ready-to-use REST inference API for video restyling, creative edits, product videos, advertising creatives, social media clips, visual storytelling, and professional video editing workflows with simple integration, no coldstarts, and affordable pricing.
/filters:quality(82)/media/images/1782717390795771980_eQLU3clv.webp)
Ray 3.2 Video Reframing
Luma Ray 3.2 Video Reframing is a fast AI video reframing model that changes an existing video’s aspect ratio and fills the newly exposed canvas from a prompt while preserving the source footage. Ready-to-use REST inference API for aspect ratio conversion, social media resizing, cinematic reframing, video outpainting, creator content, advertising creatives, and professional video editing workflows with simple integration, no coldstarts, and affordable pricing.
/filters:quality(82)/media/images/1781079452793266676_0T2d6enx.webp)
Ray 3.2 Image To Video
Luma Ray 3.2 Image to Video is a fast AI image-to-video generation model that animates a source image into cinematic video guided by a text prompt, with controllable aspect ratio, resolution, and duration. Ready-to-use REST inference API for image animation, cinematic clips, product videos, social media content, advertising creatives, visual storytelling, and professional image-to-video workflows with simple integration, no coldstarts, and affordable pricing.
/filters:quality(82)/media/images/1781079292182866010_NdMW5fpz.webp)
Ray 3.2 Text To Video
Luma Ray 3.2 Text to Video is a fast AI video generation model that creates cinematic videos from text prompts with controllable aspect ratio, resolution, and duration. Ready-to-use REST inference API for cinematic clips, storytelling videos, social media content, advertising creatives, product visuals, concept videos, and professional text-to-video workflows with simple integration, no coldstarts, and affordable pricing.
/filters:quality(82)/media/images/1781079512370971296_kmKPCCyz.webp)
Uni v1 Edit
Luma Uni v1 Edit is a fast AI image editing model that reworks source images from text instructions while preserving composition and supporting optional reference images. Ready-to-use REST inference API for photo editing, product image updates, creative retouching, marketing assets, brand visuals, style changes, and professional image editing workflows with simple integration, no coldstarts, and affordable pricing.
/filters:quality(82)/media/images/1781079484942032323_VCwGPY8i.webp)
Uni v1 Text To Image
Luma Uni v1 Text to Image is a fast AI image generation model that creates high-fidelity images from prompts with flexible aspect ratios, visual style control, and optional reference-image guidance. Ready-to-use REST inference API for creative design, marketing visuals, product mockups, brand assets, social media content, concept art, and professional text-to-image workflows with simple integration, no coldstarts, and affordable pricing.
Ví dụ
Xem Luma hoạt động
Kết quả thật do API Luma tạo ra. Rê chuột lên video để xem trước, nhấp để mở trình xem kích thước đầy đủ.
Hướng dẫn
Cách dùng API Luma
Bốn bước từ đăng ký đến khi có kết quả. Ví dụ đầy đủ bằng Python, Node.js và cURL nằm ở phần API bên dưới.
- 01
Lấy API key
Đăng ký tài khoản WaveSpeedAI và sao chép API key từ bảng điều khiển. Tài khoản mới được tặng credit dùng thử miễn phí — đủ để chạy playground vài chục lần trước khi bắt đầu tính phí.
- 02
Gửi một prediction
POST đầu vào của bạn dưới dạng JSON tới https://api.wavespeed.ai/api/v3/luma/ray-3.2/text-to-video. Endpoint trả về prediction id ngay lập tức — việc tạo là bất đồng bộ nên bạn không phải giữ kết nối mở trong lúc suy luận.
- 03
Poll để chờ hoàn tất
GET https://api.wavespeed.ai/api/v3/predictions/{request_id}/result. Trả về kết quả khi completed; dừng và báo lỗi khi failed, cancelled, timeout hoặc deleted; tiếp tục poll với mọi trạng thái khác.
- 04
Đọc URL kết quả
Khi status là "completed", đọc URL từ data.outputs[0]. URL trỏ tới media bạn đã tạo trên CDN của WaveSpeedAI — ảnh, video, âm thanh hoặc tệp 3D tùy biến thể Luma bạn đã gọi.
Trường hợp sử dụng
Bạn có thể xây dựng gì với Luma
Các quy trình phổ biến mà nhà phát triển và người sáng tạo dùng API Luma cho.
Cinematic text-to-video
luma/ray-3.2/text-to-video generates cinematic videos from text prompts with controllable aspect ratio, resolution, duration and optional reference images.
Animate a still image
luma/ray-3.2/image-to-video animates a source image into video guided by a text prompt, with the same aspect ratio, resolution and duration controls.
Restyle footage and keep the motion
luma/ray-3.2/video-edit re-renders an existing source video from a text prompt while preserving the source motion and timing.
Reframe video to a new aspect ratio
luma/ray-3.2/video-reframing changes a video's aspect ratio and fills the newly exposed canvas from a prompt while preserving the source footage.
Image generation and editing
luma/uni-v1/text-to-image generates images with aspect ratio, style, format and reference-image guidance; luma/uni-v1/edit transforms an input image from a text instruction while preserving composition.
Mẹo
Mẹo viết prompt cho Luma
Lời khuyên thực tế để có kết quả tốt hơn từ Luma — rút ra từ các mẫu hiệu quả trên các mô hình video trong các pipeline sản xuất.
- 01
Nêu cụ thể các động tác máy quay
Hãy dùng từ vựng quay phim cụ thể — orbit, dolly-in, push-in, pan-left, crane shot, handheld follow. Prompt chung chung cho ra góc máy tĩnh hoặc tùy tiện; các động tác máy quay có tên gọi ánh xạ trực tiếp tới ý đồ chuyển động trong dữ liệu huấn luyện của mô hình và cải thiện rõ rệt chất lượng cảnh quay.
- 02
Neo danh tính nhân vật bằng ảnh tham chiếu
Nếu prompt phụ thuộc vào một người, nhân vật hoặc sản phẩm cụ thể, hãy tải lên ảnh tham chiếu cùng prompt. Không có tham chiếu, danh tính sẽ trôi giữa các khung hình và các cảnh quay — cùng một nhân vật trông hơi khác đi sau mỗi lần tạo.
- 03
Mô tả ánh sáng và thời điểm trong ngày
Gợi ý ánh sáng như 'golden hour, soft warm directional light' hoặc 'overcast diffused light, slate-grey sky' cải thiện chất lượng và tính nhất quán hơn nhiều so với các từ bổ nghĩa chất lượng mơ hồ. Ánh sáng là một trong những tiên nghiệm mạnh nhất mà mô hình dựa vào.
- 04
Dùng negative prompt để hạn chế các lỗi thường gặp
Negative hữu ích cho video: 'frame flicker, motion blur, watermark, text artifacts, distorted hands, low resolution, jpeg compression'. Negative prompt không tốn gì và giảm đáng kể số lần bạn phải tạo lại.
- 05
Chọn thời lượng ngắn nhất đủ diễn đạt nhịp của bạn
Hầu hết prompt hiệu quả nhất ở 5-8 giây. Clip dài hơn khuếch đại sự thiếu nhất quán theo thời gian (chủ thể biến dạng, môi trường trôi). Nếu cần chuỗi 20 giây, hãy tạo ba clip 6-8 giây rồi ghép lại — chất lượng vẫn cao hơn một lần tạo dài.
- 06
Chọn tỷ lệ khung hình phù hợp nền tảng ngay từ đầu
9:16 cho TikTok / Reels / Shorts, 16:9 cho feed ngang và YouTube, 1:1 cho lưới bài đăng. Mô hình được huấn luyện hơi khác nhau theo từng tỷ lệ — cắt 16:9 thành 9:16 sau đó làm mất cả độ trung thực lẫn bố cục mà mô hình định tạo.
Giá
Giá API Luma
Giá tính theo từng kết quả đầu ra. Khoản phí cuối cùng thay đổi theo các tham số bạn đặt trong playground của từng biến thể (độ phân giải, thời lượng, số kết quả, tham chiếu).
| Endpoint | Loại | Giá khởi điểm |
|---|---|---|
| luma/ | video-to-video | $0.144 |
| luma/ | video-to-video | $0.06 |
| luma/ | image-to-video | $0.10 |
| luma/ | text-to-video | $0.10 |
| luma/ | image-to-image | $0.042 |
| luma/ | text-to-image | $0.042 |
API
Gọi API Luma
Đăng ký API key tại wavespeed.ai/accesskey, rồi gửi prediction qua REST. Playground tạo sẵn mã mẫu có thể dán ngay cho mọi tổ hợp đầu vào.
POSThttps://api.wavespeed.ai/api/v3/luma/ray-3.2/text-to-video
# 1. Submit the prediction.
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
-X POST "https://api.wavespeed.ai/api/v3/luma/ray-3.2/text-to-video" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $WAVESPEED_API_KEY" \
-d '{
"prompt": "A cinematic shot of a city at sunset, soft golden light",
"size": "16:9",
"resolution": "540p",
"duration": 5
}')
TASK=$(printf '%s' "$SUBMIT_RESPONSE" | jq 'if has("data") then .data else . end')
PREDICTION_ID=$(printf '%s' "$TASK" | jq -r '.id')
if [ -z "$PREDICTION_ID" ] || [ "$PREDICTION_ID" = "null" ]; then
printf 'Submission response did not contain a prediction id
' >&2
exit 1
fi
RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/$PREDICTION_ID/result"
# 2. Poll until the prediction finishes.
while true; do
RESPONSE=$(curl --silent --show-error --fail-with-body "$RESULT_URL" \
-H "Authorization: Bearer $WAVESPEED_API_KEY")
RESULT=$(printf '%s' "$RESPONSE" | jq 'if has("data") then .data else . end')
STATUS=$(printf '%s' "$RESULT" | jq -r '.status')
case "$STATUS" in
completed) printf '%s\n' "$RESULT" | jq '.outputs'; break ;;
failed|cancelled|timeout|deleted) printf '%s\n' "$RESULT" | jq . >&2; exit 1 ;;
*) sleep 2 ;;
esac
doneconst submitUrl = "https://api.wavespeed.ai/api/v3/luma/ray-3.2/text-to-video";
const apiKey = process.env.WAVESPEED_API_KEY;
if (!apiKey) throw new Error('Set WAVESPEED_API_KEY');
async function requestJson(url, options = {}) {
const response = await fetch(url, options);
if (!response.ok) throw new Error(await response.text());
return response.json();
}
// 1. Submit the prediction.
const body = await requestJson(submitUrl, {
method: "POST",
headers: {
"Authorization": `Bearer ${apiKey}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"prompt": "A cinematic shot of a city at sunset, soft golden light",
"size": "16:9",
"resolution": "540p",
"duration": 5
}),
});
const task = body.data ?? body;
const resultUrl = `https://api.wavespeed.ai/api/v3/predictions/${task.id}/result`;
// 2. Poll until the prediction finishes.
while (true) {
const resultBody = await requestJson(resultUrl, {
headers: { "Authorization": `Bearer ${apiKey}` },
});
const result = resultBody.data ?? resultBody;
if (result.status === "completed") {
console.log(result.outputs);
break;
}
if (["failed", "cancelled", "timeout", "deleted"].includes(result.status)) throw new Error(JSON.stringify(result));
await new Promise(resolve => setTimeout(resolve, 2000));
}import json
import os
import time
from urllib.request import Request, urlopen
api_key = os.environ["WAVESPEED_API_KEY"]
headers = {"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"}
payload = {
"prompt": "A cinematic shot of a city at sunset, soft golden light",
"size": "16:9",
"resolution": "540p",
"duration": 5
}
def request_json(url, data=None):
request = Request(url, data=data, headers=headers, method="POST" if data else "GET")
with urlopen(request) as response:
return json.load(response)
# 1. Submit the prediction.
body = request_json("https://api.wavespeed.ai/api/v3/luma/ray-3.2/text-to-video", json.dumps(payload).encode())
task = body.get("data", body)
result_url = f"https://api.wavespeed.ai/api/v3/predictions/{task['id']}/result"
# 2. Poll until the prediction finishes.
while True:
result_body = request_json(result_url)
result = result_body.get("data", result_body)
status = result.get("status")
if status == "completed":
print(result.get("outputs", []))
break
if status in {"failed", "cancelled", "timeout", "deleted"}:
raise RuntimeError(result)
time.sleep(2)So sánh
Luma so với các lựa chọn khác
Khi nào nên chọn Luma thay vì các mô hình tương tự trên WaveSpeedAI.
Luma so với Kling 3.0
Kling 3.0 offers Standard, Pro and 4K tiers with native audio. Luma Ray 3.2 adds video edit and video reframing endpoints for working on existing footage.
Luma so với Veo 3.1
Veo 3.1 is Google's video model with synchronized audio. Luma Ray 3.2 is a separate family with optional reference images and footage-level edit and reframing endpoints.
Câu hỏi thường gặp
Luma API — Câu hỏi thường gặp
Giá, giấy phép, tích hợp — những câu hỏi phổ biến về việc chạy Luma trên WaveSpeedAI.
API Luma là gì?
Luma là mô hình tạo video của Luma AI, được cung cấp dưới dạng REST API trên WaveSpeedAI. Luma API on WaveSpeedAI — Ray 3.2 text-to-video, image-to-video, video edit and video reframing, earlier Ray 2 and Ray 1.6 models, and Uni v1 and Photon image generation and editing, all through one REST API. Bạn có thể gọi bằng lập trình hoặc thử từ playground ở liên kết phía trên.
Làm sao để gọi API Luma?
Đăng ký tài khoản WaveSpeedAI, sao chép API key từ /accesskey, rồi POST tới https://api.wavespeed.ai/api/v3/luma/ray-3.2/text-to-video với đầu vào dưới dạng JSON. Endpoint trả về prediction id. Hãy poll endpoint kết quả khoảng mỗi 2 giây, tăng khoảng cách với các tác vụ chạy lâu, và dừng ở bất kỳ trạng thái kết thúc nào. Ví dụ Python / Node.js / cURL hướng tới môi trường production ở phía trên.
API Luma có giá bao nhiêu?
Luma bắt đầu từ $0.042. Chi phí chính xác thay đổi theo các tham số bạn đặt (độ phân giải, thời lượng, số kết quả, tham chiếu). Phần xem trước chi phí trực tiếp cạnh nút Tạo trong playground hiển thị giá chính xác cho đầu vào hiện tại của bạn.
Có những biến thể Luma nào?
WaveSpeedAI cung cấp 6 endpoint Luma đang hoạt động: luma/ray-3.2/video-edit, luma/ray-3.2/video-reframing, luma/ray-3.2/image-to-video, luma/ray-3.2/text-to-video, luma/uni-v1/edit, luma/uni-v1/text-to-image. Mỗi biến thể có trang playground và giá riêng.
Tôi có thể dùng kết quả của Luma cho mục đích thương mại không?
Quyền sử dụng thương mại tuân theo giấy phép mô hình của Luma AI. Hầu hết mô hình của Luma AI cho phép dùng kết quả đầu ra cho mục đích thương mại; hãy xem trang playground của từng mô hình để biết tóm tắt giấy phép cụ thể, và Điều khoản dịch vụ của WaveSpeedAI cho các điều kiện cấp nền tảng.
Tại sao dùng Luma trên WaveSpeedAI thay vì gọi trực tiếp?
Một API key + một tài khoản thanh toán cho Luma VÀ hơn 1.000 mô hình AI khác từ các nhà cung cấp khác. Không cần thiết lập SDK cho từng hãng, không có hạn mức tốc độ riêng, không phải viết lại mã tích hợp cho từng hãng. Giá thường ngang bằng hoặc thấp hơn API trực tiếp của Luma AI.
Bắt đầu xây dựng với Luma trên WaveSpeedAI
Tặng credit dùng thử miễn phí khi đăng ký. Một API key cho hơn 1.000 mô hình AI từ Luma AI và mọi nhà cung cấp khác.
/filters:quality(82)/examples/7090bb21305b0b99db644a0756b3a4ca/1783684141735187042_eUGQZ8ir.webp)