Appearance
🎬 视频模型 pika
- 2024.10.16 本站已经支持 视频模型
pika
pika
本身无api, 跟GPTs 一样是通过逆向得来,- 支持
文生视频
图生视频
- 计费是按次数,一次一个视频
- 如何使用 访问 https://pika.ddaiai.com 看下面的
在线测试
在线测试
1.访问 https://pika.ddaiai.com (如果被墙了,换下二级域名前缀 suibian
)
2.如果发现被墙了 可以自己换地址 https://suibian.ddaiai.com
把 suibian
换其他的 如 https://2025.ddaiai.com
都能访问
在线测试
- 打开 https://pika.ddaiai.com
- 下图相应的地方设置
- OpenAi接口地址:https://api.openai-hk.com
- OpenAi KEY: hk-你的apiKey
- 得到效果
PIKA API
- 约定 header 需要带上 Authorization: Bearer hk-你的key
- 接口地址 https://api.openai-hk.com/pika
创建视频任务
shell
curl 'https://api.openai-hk.com/pika/generate' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer hk-你的key' \
--data '{"pikaffect":"","promptText":"moving","model":"1.5","options":{"aspectRatio":1.7777777777777777,"frameRate":24,"camera":{},"parameters":{"guidanceScale":12,"motion":1,"negativePrompt":""},"extend":false}}'
curl 'https://api.openai-hk.com/pika/generate' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer hk-你的key' \
--data '{"pikaffect":"","promptText":"moving","model":"1.5","options":{"aspectRatio":1.7777777777777777,"frameRate":24,"camera":{},"parameters":{"guidanceScale":12,"motion":1,"negativePrompt":""},"extend":false}}'
请求体
json
{
"pikaffect": "",
"promptText": "moving",
"model": "1.5",
"options": {
"aspectRatio": 1.7777777777777777,
"frameRate": 24,
"camera": {},
"parameters": {
"guidanceScale": 12,
"motion": 1,
"negativePrompt": ""
},
"extend": false
}
,"image":""
}
{
"pikaffect": "",
"promptText": "moving",
"model": "1.5",
"options": {
"aspectRatio": 1.7777777777777777,
"frameRate": 24,
"camera": {},
"parameters": {
"guidanceScale": 12,
"motion": 1,
"negativePrompt": ""
},
"extend": false
}
,"image":""
}
关键字段说明
字段 | 类型 | 说明 |
---|---|---|
pikaffect | string | 官方视频效果,可以留空 当配置上效果后有配音Levitate Decapitate Eye-pop Ta-da Deflate Crumble Dissolve Squish Inflate Melt Crush Cake-ify Explode 后续官方可能还会增加 |
promptText | string | 提示词 |
image | string | 存在就必须有值,可以是base64 或者图片url |
model | string | 模型版本 1.5 |
options | object | 视频设置 |
options.aspectRatio | number | 宽高比例 如果是图片这个要去掉 |
options.parameters.negativePrompt | string | 不出现的物体 |
返回体 返回的id我们称之为 taskId
在后面的步骤中用到
json
{
"id": "c1d16f47-16c2-4798-8733-5ed9903885cc"
}
{
"id": "c1d16f47-16c2-4798-8733-5ed9903885cc"
}
查看任务状态
curl
shell
curl 'https://api.openai-hk.com/pika/feed/66e0818e-05fb-454e-b246-a6f253e9ffbf' \
-H 'Authorization: Bearer hk-你的key'
curl 'https://api.openai-hk.com/pika/feed/66e0818e-05fb-454e-b246-a6f253e9ffbf' \
-H 'Authorization: Bearer hk-你的key'
返回体
json
{
"id": "66e0818e-05fb-454e-b246-a6f253e9ffbf",
"promptText": "Plane fly",
"videos": [
{
"id": "66e0818e-05fb-454e-b246-a6f253e9ffbf",
"status": "finished",
"seed": 3183047765,
"resultUrl": "https://cdn.pika.art/v1/66e0818e-05fb-454e-b246-a6f253e9ffbf/Plane_fly_seed3183047765.mp4",
"sharingUrl": "https://cdn.pika.art/v1/66e0818e-05fb-454e-b246-a6f253e9ffbf/Plane_fly_seed3183047765_share.mp4",
"videoPoster": "https://cdn.pika.art/v1/66e0818e-05fb-454e-b246-a6f253e9ffbf/poster.jpg",
"imageThumb": "https://cdn.pika.art/v1/66e0818e-05fb-454e-b246-a6f253e9ffbf/thumbnail.jpg",
"duration": 5,
"error": "",
"progress": 100
}
]
}
{
"id": "66e0818e-05fb-454e-b246-a6f253e9ffbf",
"promptText": "Plane fly",
"videos": [
{
"id": "66e0818e-05fb-454e-b246-a6f253e9ffbf",
"status": "finished",
"seed": 3183047765,
"resultUrl": "https://cdn.pika.art/v1/66e0818e-05fb-454e-b246-a6f253e9ffbf/Plane_fly_seed3183047765.mp4",
"sharingUrl": "https://cdn.pika.art/v1/66e0818e-05fb-454e-b246-a6f253e9ffbf/Plane_fly_seed3183047765_share.mp4",
"videoPoster": "https://cdn.pika.art/v1/66e0818e-05fb-454e-b246-a6f253e9ffbf/poster.jpg",
"imageThumb": "https://cdn.pika.art/v1/66e0818e-05fb-454e-b246-a6f253e9ffbf/thumbnail.jpg",
"duration": 5,
"error": "",
"progress": 100
}
]
}
返回关键字段说明
字段 | 类型 | 说明 |
---|---|---|
id | string | 任务id |
promptText | string | 提示词 |
videos | array | 视频数组 |
videos[].id | string | 视频id |
videos[].status | string | 视频状态 finished 为完成 error 为错误 |
videos[].seed | number | 视频种子 |
videos[].resultUrl | string | 视频地址 |
videos[].videoPoster | string | 封面图片 |
videos[].sharingUrl | string | 视频分享地址 |
videos[].error | string | 当状态为error 有错误说明 |
videos[].progress | number | 进度 |