如何使用 Kling 4.0 参考生视频
-
收集素材:提供任意 image_urls(最多 10 个)、video_urls(最多 5 个,每个 2-30s,合计 30s)、elements(最多 7 个)和 voices(最多 3 个)。
-
在提示词中提及素材:@image_1、@video_1 按数组顺序对应素材;@Hero 或 @Narrator 使用元素或音色的 name。每个提及项都必须与请求中的素材匹配。
-
配置输出:设置 duration(3-30s)、resolution(720p 或 1080p)、aspect_ratio(auto、16:9、9:16、1:1、21:9)和 keep_original_sound。
-
提交并获取结果:此端点为异步接口——轮询 /api/v1/predictions/{request_id}/result,或传入 webhook_url。
curl -X POST https://api.muapi.ai/api/v1/kling-4.0-reference-to-video \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{"prompt": "@Hero sits at the desk, picks up the doll from @image_1, and greets using @Narrator", "image_urls": ["https://example.com/doll.png"], "elements": [{"name": "Hero", "image_urls": ["https://example.com/hero-front.jpg", "https://example.com/hero-side.jpg"], "tag": "character"}], "voices": [{"name": "Narrator", "audio_url": "https://example.com/narrator.mp3"}], "duration": 10, "resolution": "1080p"}'