Cách dùng tính năng tạo video từ tham chiếu Kling 4.0
-
Chuẩn bị tư liệu: Cung cấp image_urls (tối đa 10), video_urls (tối đa 5, mỗi video 2-30s, tổng cộng 30s), elements (tối đa 7) và voices (tối đa 3).
-
Nhắc đến tư liệu trong prompt: @image_1, @video_1 tuân theo thứ tự trong mảng; @Hero hoặc @Narrator dùng name của yếu tố hoặc giọng nói. Mỗi tên được nhắc đến phải khớp với một tư liệu trong yêu cầu.
-
Cấu hình đầu ra: duration (3-30s), resolution (720p hoặc 1080p), aspect_ratio (auto, 16:9, 9:16, 1:1, 21:9) và keep_original_sound.
-
Gửi yêu cầu và nhận kết quả: Endpoint xử lý bất đồng bộ — thăm dò /api/v1/predictions/{request_id}/result hoặc cung cấp 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"}'