参数名 | 类型 | 描述 | 备注 |
---|---|---|---|
config.mode | string | 配置模式 | 可选值:"regular", "precede", "continuation"。 说明: |
- "precede":用于在歌曲前方扩展,结合 song_section_start 参数控制音频扩展的位置。 | |||
- "continuation":用于在歌曲后方扩展,结合 song_section_start 参数控制音频扩展的位置。 | |||
config.context_length | number | 上下文长度 | 默认为 130。 |
config.source.song_id | string | 扩展的歌曲 ID | 你想要扩展的歌曲 ID。 |
song_section_start | number | 歌曲片段开始位置 | 范围 0-1, 默认 0。 说明: |
- 用于指定在完整歌曲中生成片段的起始位置。 | |||
- 在 config.mode 为 "precede" 时,可以用于添加前奏,或扩展前半部分。 | |||
- 在 config.mode 为 "continuation" 时,可以用于扩展后半部分或结尾部分。 |
{
"gen_params": {
"prompt": "a song about the moon",
"lyrics": "",
"lyrics_type": "generate",
"bypass_prompt_optimization": false,
"seed": -1,
"song_section_start": 0,
"prompt_strength": 0.5,
"clarity_strength": 0.25,
"lyrics_strength": 0.5,
"generation_quality": 0.75,
"negative_prompt": "",
"model_type": "udio130-v1.5",
"config": {
"mode": "precede",
"context_length": 130,
"source": {
"source_type": "song",
"song_id": "xxxx-xxxx-xxxx"
}
}
}
}
curl --location --request POST 'https://api.302.ai/udio/generate-proxy' \
--header 'Authorization: Bearer ' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"gen_params": {
"prompt": "a song about the moon",
"lyrics": "",
"lyrics_type": "generate",
"bypass_prompt_optimization": false,
"seed": -1,
"song_section_start": 0,
"prompt_strength": 0.5,
"clarity_strength": 0.25,
"lyrics_strength": 0.5,
"generation_quality": 0.75,
"negative_prompt": "",
"model_type": "udio130-v1.5",
"config": {
"mode": "precede",
"context_length": 130,
"source": {
"source_type": "song",
"song_id": "xxxx-xxxx-xxxx"
}
}
}
}'
{
"code": "success",
"message": "",
"data": "69c61512-278e-4ff4-b6ea-f3b278329b04"
}