วิธีใช้ 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 or 1080p), aspect_ratio (auto, 16:9, 9:16, 1:1, 21:9) และ keep_original_sound.
-
ส่งคำขอและรับผลลัพธ์: ปลายทาง API ทำงานแบบอะซิงโครนัส — ตรวจสอบผลที่ /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"}'