应用 Kling 视频特效
通过 CometAPI 使用 Kling 视频特效 API,调用 POST /kling/v1/videos/effects 为视频应用风格化特效并控制特效参数。
选择特效场景
- 单图特效使用
effect_scene,并搭配input.image和input.duration - 双人互动特效使用
effect_scene,并搭配input.images,其中必须正好包含两张图片 - 输入图片必须满足 Kling 的像素要求;过小的缩略图会被生成任务拒绝
- 具体素材结构取决于所选特效,但请求始终将特效设置封装在
input内 - 使用当前在 Kling 中可用的特效场景;CometAPI 会拒绝未知的
effect_scene值 - 不要依赖固定的公开枚举列表;特效可用性会因模型通道和场景系列而变化
任务流程
提交特效请求
effect_scene 以及匹配的 input 对象,并保存返回的任务 id。轮询任务
持久化最终资源
授权
Bearer token authentication. Use your CometAPI key.
请求体
Kling preset effect scene. Single-image effects use input.image; two-person interaction effects use input.images with exactly two images.
Effect-specific input payload. Single-image scenes require image and duration; two-person interaction scenes require exactly two images and duration.
- Single-image effect input
- Two-person interaction effect input
Webhook URL for task status notifications. The server sends a callback when the task status changes.
Optional user-defined task ID for your own tracking. Does not replace the system-generated task ID. Must be unique per account.