Skip to main content

Song Generator Endpoint

Overview

The Song Generator endpoint enables you to generate song by providing a lyrics along with a valid audio URL

Sample Generation


Example 1

Prompt

[00:10.00]Moonlight spills through broken blinds
[00:13.20]Your shadow dances on the dashboard shrine
[00:16.85]Neon ghosts in gasoline rain.


Generated Output


Request

--request POST 'https://modelslab.com/api/v6/voice/song_generator' \

Make a POST request to https://modelslab.com/api/v6/voice/song_generator endpoint and pass the required parameters as a request body.

Body Attributes

ParameterDescriptionValues
keyThe API key used for authenticating your request.String
promptLyrics in LRC format (timestamp + lyrics). The only supported language is English.Text
init_audioURL to the reference audio file to influencestyle.MP3/WAV URL
webhookA URL where the API will send a POST request once the audio generation is complete.URL
track_idAn ID returned in the API response, used to identify webhook requestsIntegral value

Example

Body

Body
{   
"key": "",
"prompt":"Narrative voices capable of pronouncing terminologies & acronyms in training and ai learning materials.",
"init_audio":"https://pub-f3505056e06f40d6990886c8e14102b2.r2.dev/audio/tom_hanks_1.wav",
"webhook": null,
"track_id": null
}

Request

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
"key": "",
"prompt":"[00:10.00]Moonlight spills through broken blinds [00:13.20]Your shadow dances on the dashboard shrine [00:16.85]Neon ghosts in gasoline rain",
"init_audio":"https://storage.googleapis.com/falserverless/model_tests/diffrythm/rock_en.wav",
"webhook": null,
"track_id": null
});

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};

fetch("https://modelslab.com/api/v6/voice/song_generator", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));

Response

{
"status": "success",
"generationTime": 1.904285192489624,
"id": 334166,
"output": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/a3f8a04c-26c1-485c-b3b5-5c6244a0d395.wav"
],
"proxy_links": [
"https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/generations/a3f8a04c-26c1-485c-b3b5-5c6244a0d395.wav"
],
"meta": {
"lrc": "[00:10.00]Moonlight spills through broken blinds [00:13.20]Your shadow dances on the dashboard shrine [00:16.85]Neon ghosts in gasoline rain",
"ref_audio_path": "tmp/rock_en.wav",
"text_prompt": null,
"prompt_type": "audio",
"seed": 42,
"randomize_seed": false,
"steps": 32,
"cfg_strength": 4,
"file_type": "wav",
"odeint_method": "euler",
"music_duration": "95s",
"device": "cuda",
"webhook": null,
"id": null,
"filename": "a3f8a04c-26c1-485c-b3b5-5c6244a0d395",
"temp": "no",
"track_id": null,
"base64": "no"
}
}