typetext
{
"language": "en",
"speaker_reference": "https://replicate.delivery/pbxt/MNFXdPaUPOwYCZjZM4azsymbzE2TCV2WJXfGpeV2DrFWaSq8/example_en.wav",
"text": "With tenure, Suzie'd have all the more leisure for yachting, but her publications are no good."
}npm install replicate
REPLICATE_API_TOKEN environment variable:export REPLICATE_API_TOKEN=r8_NHA**********************************
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 ttsds/xtts_2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
const output = await replicate.run(
"ttsds/xtts_2:a125885ec67a4482bc10c292e59b33aeb1be75042f606916c0ea692e4ff13e84",
{
input: {
language: "en",
speaker_reference: "https://replicate.delivery/pbxt/MNFXdPaUPOwYCZjZM4azsymbzE2TCV2WJXfGpeV2DrFWaSq8/example_en.wav",
text: "With tenure, Suzie'd have all the more leisure for yachting, but her publications are no good."
}
}
);
// 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_NHA**********************************
This is your API token. Keep it to yourself.
import replicate
Run ttsds/xtts_2 using Replicate’s API. Check out the model's schema for an overview of inputs and outputs.
output = replicate.run(
"ttsds/xtts_2:a125885ec67a4482bc10c292e59b33aeb1be75042f606916c0ea692e4ff13e84",
input={
"language": "en",
"speaker_reference": "https://replicate.delivery/pbxt/MNFXdPaUPOwYCZjZM4azsymbzE2TCV2WJXfGpeV2DrFWaSq8/example_en.wav",
"text": "With tenure, Suzie'd have all the more leisure for yachting, but her publications are no good."
}
)
# 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_NHA**********************************
This is your API token. Keep it to yourself.
Run ttsds/xtts_2 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 $'{
"version": "ttsds/xtts_2:a125885ec67a4482bc10c292e59b33aeb1be75042f606916c0ea692e4ff13e84",
"input": {
"language": "en",
"speaker_reference": "https://replicate.delivery/pbxt/MNFXdPaUPOwYCZjZM4azsymbzE2TCV2WJXfGpeV2DrFWaSq8/example_en.wav",
"text": "With tenure, Suzie\'d have all the more leisure for yachting, but her publications are no good."
}
}' \
https://api.replicate.com/v1/predictions
To learn more, take a look at Replicate’s HTTP API reference docs.
{
"id": "m8k947v1w1rj20cnavvs0jvn0c",
"model": "ttsds/xtts_2",
"version": "a125885ec67a4482bc10c292e59b33aeb1be75042f606916c0ea692e4ff13e84",
"input": {
"language": "en",
"speaker_reference": "https://replicate.delivery/pbxt/MNFXdPaUPOwYCZjZM4azsymbzE2TCV2WJXfGpeV2DrFWaSq8/example_en.wav",
"text": "With tenure, Suzie'd have all the more leisure for yachting, but her publications are no good."
},
"logs": "",
"output": "https://replicate.delivery/yhqm/cObEVnjpZ17UAhZCRYqP2G0Cie0LN2z9JVJ3o5LFFdrPUQKKA/output.wav",
"data_removed": false,
"error": null,
"source": "web",
"status": "succeeded",
"created_at": "2025-03-02T13:06:47.904Z",
"started_at": "2025-03-02T13:07:41.413759Z",
"completed_at": "2025-03-02T13:07:43.722098Z",
"urls": {
"cancel": "https://api.replicate.com/v1/predictions/m8k947v1w1rj20cnavvs0jvn0c/cancel",
"get": "https://api.replicate.com/v1/predictions/m8k947v1w1rj20cnavvs0jvn0c",
"stream": "https://stream.replicate.com/v1/files/yswh-qpmv75dicyuljwjiynvt5tdi6vlw2sk76k4wjlvboab7sgvtpkoq",
"web": "https://replicate.com/p/m8k947v1w1rj20cnavvs0jvn0c"
},
"metrics": {
"predict_time": 2.30833876,
"total_time": 55.818098
}
}