Appearance
🎬 视频模型 luma
- 2024.06.24 本站已经支持 视频模型
luma
luma
本身无api, 跟GPTs 一样是通过逆向得来,- 支持
文生视频
图生视频
- 计费是按次数,一次一个视频
- 价格分2种
relax
和pro
可查阅版本接入点 - 当前默认
relax
有水印需队列等待,pro
无水印无需队列等待 - 如何使用 访问 https://luma.ddaiai.com 看下面的
在线测试
在线测试
1.访问 https://luma.ddaiai.com (如果被墙了,换下二级域名前缀 suibian
)
2.如果发现被墙了 可以自己换地址 https://suibian.ddaiai.com
把 suibian
换其他的 如 https://2024.ddaiai.com
都能访问
版本接入点
- 默认是relax版本 https://api.openai-hk.com/luma
- pro版本模式 https://api.openai-hk.com/pro/luma
- 2钟模式价格 全按 pro版本计费
- 2024.10.9 停用relax模式(因luma已不提供) 计费按计费
设置
- 打开 https://luma.ddaiai.com
- 下图相应的地方设置
- luma接口地址:https://api.openai-hk.com
- luma pro版本接口地址:https://api.openai-hk.com/pro
- Luma KEY: hk-你的apiKey
效果
得到效果
Luma API
- 约定 header 需要带上
Authorization: Bearer hk-你的key
- relex 版本 接口地址 https://api.openai-hk.com/luma
- pro 版本 接口地址 https://api.openai-hk.com/pro/luma
- 以下是用 relex 作为范例
创建视频任务
shell
curl 'https://api.openai-hk.com/luma/generations/' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer hk-你的key' \
--data '{"aspect_ratio":"16:9","expand_prompt":true,"image_url":"","user_prompt":"特斯拉飞速在公路上"}'
curl 'https://api.openai-hk.com/luma/generations/' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer hk-你的key' \
--data '{"aspect_ratio":"16:9","expand_prompt":true,"image_url":"","user_prompt":"特斯拉飞速在公路上"}'
请求体
json
{
"aspect_ratio": "16:9",
"expand_prompt": true,
"loop": false,
"image_url": "",
"image_end_url": "",
"user_prompt": "特斯拉飞速在公路上"
}
{
"aspect_ratio": "16:9",
"expand_prompt": true,
"loop": false,
"image_url": "",
"image_end_url": "",
"user_prompt": "特斯拉飞速在公路上"
}
字段 | 类型 | 说明 |
---|---|---|
user_prompt | string | 提示词 |
image_url | string | 关键帧 开始图片url 支持 base64 |
image_end_url | string | 关键帧 图片url 支持 base64 |
aspect_ratio | string | 视频宽高比 |
expand_prompt | boolean | 是否扩展提示词 |
loop | boolean | 是否循环 首尾呼应 |
返回体
json
{
"created_at": "2024-06-24T03:40:47.505420Z",
"estimate_wait_seconds": "",
"id": "50deb9e0-d135-4173-a530-82ed3449a7b9",
"liked": "",
"prompt": "特斯拉飞速在公路上",
"state": "pending",
"video": {
"height": 0,
"thumbnail": "",
"url": "",
"download_url": "",
"width": 0
}
}
{
"created_at": "2024-06-24T03:40:47.505420Z",
"estimate_wait_seconds": "",
"id": "50deb9e0-d135-4173-a530-82ed3449a7b9",
"liked": "",
"prompt": "特斯拉飞速在公路上",
"state": "pending",
"video": {
"height": 0,
"thumbnail": "",
"url": "",
"download_url": "",
"width": 0
}
}
延展视频(extend)
shell
curl 'https://api.openai-hk.com/luma/generations/50deb9e0-d135-4173-a530-82ed3449a7b9/extend' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer hk-你的key' \
--data '{ "expand_prompt":true,"image_url":"","user_prompt":"后面跟着一辆卡车"}'
curl 'https://api.openai-hk.com/luma/generations/50deb9e0-d135-4173-a530-82ed3449a7b9/extend' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer hk-你的key' \
--data '{ "expand_prompt":true,"image_url":"","user_prompt":"后面跟着一辆卡车"}'
请求体
json
{
"expand_prompt": true,
"loop": false,
"image_url": "",
"image_end_url": "",
"user_prompt": "后面跟着一辆卡车"
}
{
"expand_prompt": true,
"loop": false,
"image_url": "",
"image_end_url": "",
"user_prompt": "后面跟着一辆卡车"
}
字段 | 类型 | 说明 |
---|---|---|
image_url | string | 关键帧 开始图片url 支持 base64 |
image_end_url | string | 关键帧 图片url 支持 base64 |
aspect_ratio | string | 视频宽高比 |
expand_prompt | boolean | 是否扩展提示词 |
loop | boolean | 是否循环 首尾呼应 |
返回体
json
{
"created_at": "2024-06-24T03:40:47.505420Z",
"estimate_wait_seconds": "",
"id": "50deb9e0-d135-4173-a530-82ed3449a7b9",
"liked": "",
"prompt": "特斯拉飞速在公路上",
"state": "pending",
"video": {
"height": 0,
"thumbnail": "",
"url": "",
"download_url": "",
"width": 0
}
}
{
"created_at": "2024-06-24T03:40:47.505420Z",
"estimate_wait_seconds": "",
"id": "50deb9e0-d135-4173-a530-82ed3449a7b9",
"liked": "",
"prompt": "特斯拉飞速在公路上",
"state": "pending",
"video": {
"height": 0,
"thumbnail": "",
"url": "",
"download_url": "",
"width": 0
}
}
获取无水印视频链接
- 仅支持pro版本
- relex版本也能获取,但还是有水印
- 得到的URL有时效请注意下载保存文件
get https://api.openai-hk.com/pro/luma/generations/{id}/download_video_url
shell
curl 'https://api.openai-hk.com/luma/generations/50deb9e0-d135-4173-a530-82ed3449a7b9/download_video_url' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer hk-your-key'
curl 'https://api.openai-hk.com/luma/generations/50deb9e0-d135-4173-a530-82ed3449a7b9/download_video_url' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer hk-your-key'
返回体
json
{
"url": "https://dc53a917a6f427706a8ca3ecc7d70ea4.r2.cloudflarestorage.com/ai-lumalabs-storage-private/lit_lite_inference_im2vid_v1.0/410586f1-f2b9-447a-9651-66e502cf10da/410586f1-f2b9-447a-9651-66e502cf10da_raw_video_1_video0593ab596eb51488a8f5e00fcb5401b93.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=60bf44f30d45b472f9dd032de33e15d1%2F20240630%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20240630T165615Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=205ac50f173f7f6b260bc5026b9f6b3719c7c690f27fccec8cce0b4b43491750"
}
{
"url": "https://dc53a917a6f427706a8ca3ecc7d70ea4.r2.cloudflarestorage.com/ai-lumalabs-storage-private/lit_lite_inference_im2vid_v1.0/410586f1-f2b9-447a-9651-66e502cf10da/410586f1-f2b9-447a-9651-66e502cf10da_raw_video_1_video0593ab596eb51488a8f5e00fcb5401b93.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=60bf44f30d45b472f9dd032de33e15d1%2F20240630%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20240630T165615Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=205ac50f173f7f6b260bc5026b9f6b3719c7c690f27fccec8cce0b4b43491750"
}
获取任务状态
shell
curl 'https://api.openai-hk.com/luma/generations/50deb9e0-d135-4173-a530-82ed3449a7b9' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer hk-your-key'
curl 'https://api.openai-hk.com/luma/generations/50deb9e0-d135-4173-a530-82ed3449a7b9' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer hk-your-key'
返回体
json
{
"created_at": "2024-06-24T03:40:47.505420Z",
"estimate_wait_seconds": "",
"id": "50deb9e0-d135-4173-a530-82ed3449a7b9",
"liked": "",
"prompt": "特斯拉飞速在公路上",
"state": "processing",
"video": {
"height": 0,
"thumbnail": "",
"url": "",
"download_url": "pro版本无水印在这个地址, 注意保存这个地址可能过期失效",
"width": 0
}
}
{
"created_at": "2024-06-24T03:40:47.505420Z",
"estimate_wait_seconds": "",
"id": "50deb9e0-d135-4173-a530-82ed3449a7b9",
"liked": "",
"prompt": "特斯拉飞速在公路上",
"state": "processing",
"video": {
"height": 0,
"thumbnail": "",
"url": "",
"download_url": "pro版本无水印在这个地址, 注意保存这个地址可能过期失效",
"width": 0
}
}
- 当state状态为
completed
时完成 也就是video.download_url
有链接 - 当state状态为
failed
时 表示生成失败 - pro 版本跟 relax 版本有区别
- download_url 上的视频有无水印,注意保存这个地址可能过期失效
- pro 无需队列等待