如何使用 Kling 4.0 Flash Reference to Video
-
收集素材:提供 image_urls(最多 10 个)、video_urls(最多 5 个;与视频元素合计时为 2-20 秒)和 elements(最多 7 个,其中带视频的最多 3 个)。
-
在提示词中提及素材:@image_1、@video_1 按数组顺序对应;@Hero 使用某个元素的 name。每次提及都必须与请求中的素材匹配。
-
配置输出:设置 duration(3-20 秒)、aspect_ratio(auto、16:9、9:16、1:1、21:9)和 keep_original_sound。输出始终为 720p。
-
提交并获取结果:轮询 /api/v1/predictions/{request_id}/result,或传入 webhook_url。
curl -X POST https://api.muapi.ai/api/v1/kling-4.0-flash-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 the camera", "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", "voice_url": "https://example.com/hero-voice.mp3"}], "duration": 10}'