Como usar Kling 4.0 Reference to Video
-
Reúna os materiais: forneça qualquer combinação de image_urls (até 10), video_urls (até 5, de 2-30s cada, 30s no total), elements (até 7) e voices (até 3).
-
Mencione-os no prompt: @image_1, @video_1 seguem a ordem dos arrays; @Hero ou @Narrator usam o name de um elemento ou voz. Cada menção deve corresponder a um material incluído na solicitação.
-
Configure a saída: duration (3-30s), resolution (720p ou 1080p), aspect_ratio (auto, 16:9, 9:16, 1:1, 21:9) e keep_original_sound.
-
Envie a solicitação e obtenha o resultado: o endpoint é assíncrono — consulte /api/v1/predictions/{request_id}/result ou informe um 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"}'