Cách sử dụng Kling 4.0 Flash Reference to Video
-
Chuẩn bị tư liệu: Cung cấp image_urls (tối đa 10), video_urls (tối đa 5; tổng thời lượng kết hợp với video trong elements là 2-20 giây) và elements (tối đa 7, trong đó nhiều nhất 3 phần tử có video).
-
Đề cập trong prompt: @image_1, @video_1 theo thứ tự trong mảng; @Hero sử dụng name của một phần tử. Mỗi nội dung được đề cập phải khớp với tư liệu trong yêu cầu.
-
Thiết lập đầu ra: duration (3-20s), aspect_ratio (auto, 16:9, 9:16, 1:1, 21:9) và keep_original_sound. Đầu ra luôn ở độ phân giải 720p.
-
Gửi yêu cầu và nhận kết quả: gửi yêu cầu thăm dò đến /api/v1/predictions/{request_id}/result hoặc truyền 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}'