typetext
{
"audio_file": "https://replicate.delivery/pbxt/N245edsFrGTRuk6v5OWFet0nsqiahHTlSF8yRfZEbbZCxSzY/replicate-prediction-sz4ehr9vanrme0cpwnp9wr4g8c.mp3",
"video_url": "https://replicate.delivery/xezq/ipjGAn65es3cfkPhe7g3IvYQqDfbHeCfBof1ujrrMvb3rQAXKA/tmptucl_ok3.mp4",
"voice_id": "en_AOT",
"voice_speed": 1
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Yak**********************************
This is your API token. Keep it to yourself.
import Replicate from "replicate";
import fs from "node:fs";
const replicate = new Replicate({
auth: process.env.REPLICATE_API_TOKEN,
});
Run kwaivgi/kling-lip-sync using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const input = {
audio_file: "https://replicate.delivery/pbxt/N245edsFrGTRuk6v5OWFet0nsqiahHTlSF8yRfZEbbZCxSzY/replicate-prediction-sz4ehr9vanrme0cpwnp9wr4g8c.mp3",
video_url: "https://replicate.delivery/xezq/ipjGAn65es3cfkPhe7g3IvYQqDfbHeCfBof1ujrrMvb3rQAXKA/tmptucl_ok3.mp4",
voice_id: "en_AOT",
voice_speed: 1
};
const output = await replicate.run("kwaivgi/kling-lip-sync", { input });
// To access the file URL:
console.log(output.url()); //=> "http://example.com"
// To write the file to disk:
fs.writeFile("my-image.png", output);
To learn more, take a look at the guide on getting started with Node.js.
pip install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Yak**********************************
This is your API token. Keep it to yourself.
import replicate
Run kwaivgi/kling-lip-sync using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"kwaivgi/kling-lip-sync",
input={
"audio_file": "https://replicate.delivery/pbxt/N245edsFrGTRuk6v5OWFet0nsqiahHTlSF8yRfZEbbZCxSzY/replicate-prediction-sz4ehr9vanrme0cpwnp9wr4g8c.mp3",
"video_url": "https://replicate.delivery/xezq/ipjGAn65es3cfkPhe7g3IvYQqDfbHeCfBof1ujrrMvb3rQAXKA/tmptucl_ok3.mp4",
"voice_id": "en_AOT",
"voice_speed": 1
}
)
# To access the file URL:
print(output.url())
#=> "http://example.com"
# To write the file to disk:
with open("my-image.png", "wb") as file:
file.write(output.read())
To learn more, take a look at the guide on getting started with Python.
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_Yak**********************************
This is your API token. Keep it to yourself.
Run kwaivgi/kling-lip-sync using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
curl -s -X POST \
-H "Authorization: Bearer $REPLICATE_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: wait" \
-d $'{
"input": {
"audio_file": "https://replicate.delivery/pbxt/N245edsFrGTRuk6v5OWFet0nsqiahHTlSF8yRfZEbbZCxSzY/replicate-prediction-sz4ehr9vanrme0cpwnp9wr4g8c.mp3",
"video_url": "https://replicate.delivery/xezq/ipjGAn65es3cfkPhe7g3IvYQqDfbHeCfBof1ujrrMvb3rQAXKA/tmptucl_ok3.mp4",
"voice_id": "en_AOT",
"voice_speed": 1
}
}' \
https://api.replicate.com/v1/models/kwaivgi/kling-lip-sync/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "7h6266zjpnrmc0cpxnd9gnt7zr",
"model": "kwaivgi/kling-lip-sync",
"version": "hidden",
"input": {
"audio_file": "https://replicate.delivery/pbxt/N245edsFrGTRuk6v5OWFet0nsqiahHTlSF8yRfZEbbZCxSzY/replicate-prediction-sz4ehr9vanrme0cpwnp9wr4g8c.mp3",
"video_url": "https://replicate.delivery/xezq/ipjGAn65es3cfkPhe7g3IvYQqDfbHeCfBof1ujrrMvb3rQAXKA/tmptucl_ok3.mp4",
"voice_id": "en_AOT",
"voice_speed": 1
},
"logs": "Generating lip sync video...\nGenerated video in 634.3sec\nDownloading 6287351 bytes\nDownloaded 6.00MB in 1.45sec\nOutput video duration: 9.97",
"output": "https://replicate.delivery/xezq/92rRwTYlfo0BLSIIcirPaRwPtJhN0lrl4ww79omyef38rCdpA/tmp2ni84f_5.mp4",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-05-20T11:01:22.741Z",
"started_at": "2025-05-20T11:01:22.76054Z",
"completed_at": "2025-05-20T11:11:58.612841Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/7h6266zjpnrmc0cpxnd9gnt7zr/cancel",
"get": "https://api.replicate.com/v1/predictions/7h6266zjpnrmc0cpxnd9gnt7zr",
"stream": "https://stream.replicate.com/v1/files/bcwr-ay3qisynmiab3fuppaesvosdzgpkgnt7lhnr7mhgtdftupcl5fpq",
"web": "https://replicate.com/p/7h6266zjpnrmc0cpxnd9gnt7zr"
},
"metrics": {
"predict_time": 635.852301416,
"total_time": 635.871841
}
}