任务:拓展视频
luma 视频拓展接口,用于对已生成任务进行视频拓展。
概览
- 请求方法:
POST - 请求路径:
/luma/generations/{task_id}/extend - 内容类型:
application/json - 分类:视频模型(Video)/luma视频
认证方式
- Header:
Authorization: Bearer <token>
路径参数
| 参数 | 类型 | 必填 | 描述 |
|---|---|---|---|
| task_id | string | 是 | 已生成视频的任务 ID |
请求参数
JSON 请求体字段
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
| user_prompt | string | 是 | 拓展提示词 |
| expand_prompt | boolean | 否 | 是否开启 prompt 优化 |
| image_url | string | 否 | 参考图,支持第三方图片地址或 Base64 |
| image_end_url | string | 否 | 关键帧图,支持第三方图片地址或 Base64 |
| notify_hook | string | 否 | 回调地址 |
请求示例
curl 示例
bash
curl -X POST "https://api.gpt.ge/luma/generations/your_task_id/extend" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $YOUR_TOKEN" \
-d '{
"user_prompt": "add cat",
"expand_prompt": true,
"image_url": "https://example.com/reference.png",
"image_end_url": "https://example.com/keyframe.png",
"notify_hook": "https://example.com/hook"
}'JavaScript (fetch) 示例
javascript
fetch('https://api.gpt.ge/luma/generations/your_task_id/extend', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
},
body: JSON.stringify({
user_prompt: 'add cat',
expand_prompt: true,
image_url: 'https://example.com/reference.png',
image_end_url: 'https://example.com/keyframe.png',
notify_hook: 'https://example.com/hook'
})
})
.then(res => res.json())
.then(console.log)Python 示例(requests)
python
import requests
resp = requests.post(
'https://api.gpt.ge/luma/generations/your_task_id/extend',
headers={
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
},
json={
'user_prompt': 'add cat',
'expand_prompt': True,
'image_url': 'https://example.com/reference.png',
'image_end_url': 'https://example.com/keyframe.png',
'notify_hook': 'https://example.com/hook'
}
)
print(resp.json())返回字段说明
| 字段 | 类型 | 描述 |
|---|---|---|
| id | string | 任务 ID |
| prompt | string | 提交的提示词 |
| state | string | 任务状态 |
| created_at | string | 创建时间 |
| video | null | 视频结果,暂未生成时为 null |
| liked | null | 点赞信息,当前为 null |
| estimate_wait_seconds | null | 预计等待时间,当前为 null |
返回示例(200)
json
{
"id": "9d4b7516-77e5-481a-b015-48313946f33b",
"prompt": "cat dance",
"state": "pending",
"created_at": "2024-07-01T07:35:13.498660Z",
"video": null,
"liked": null,
"estimate_wait_seconds": null
}