ACE-Step Text To Music
Use an ACE-Step-compatible API backend for prompt-to-song and lyrics-to-song requests. This skill does not install or bundle ACE-Step, model weights, or the API server.
Prerequisite
Before using this skill, make sure you already have access to an ACE-Step-compatible API backend. This can be a local server, usually at http://127.0.0.1:8001, or a remote compatible endpoint. If the backend is missing or stopped, this skill cannot generate music.
Quick start
CODEBLOCK0
Defaults are tuned for fast local iteration:
- -
batch_size=1 to avoid duplicate variants unless explicitly requested - INLINECODE2
- INLINECODE3
- INLINECODE4 unless the user asks for heavier LM-assisted generation
- finished audio is copied into a stable output folder instead of leaving only temp API paths
When to use
- - An ACE-Step-compatible API backend is already available, commonly a local server at
http://127.0.0.1:8001 but possibly a remote endpoint - The user wants text-to-music, lyrics-to-song, or quick style variations
- The user wants a single command that submits, polls, and returns saved files
- The user wants music generated locally and then played on Clawatch
- The user already has access to a local or remote ACE-Step-compatible backend
Run
CODEBLOCK1
Useful flags:
- - INLINECODE6
- INLINECODE7 or INLINECODE8
- INLINECODE9
- INLINECODE10
- INLINECODE11
- INLINECODE12
- INLINECODE13 for local backends
- INLINECODE14 for remote backends
Clawatch playback
If the user also wants the result played on Clawatch:
- 1. Run the generator and wait for the saved output file paths.
- Pick the final
.mp3 path from the script output or manifest.json. - Call
clawatch_play_audio with:
-
imei: the explicit watch IMEI
-
filePath: the saved local audio path
-
title: optional short label
Do not pass ACE-Step temp URLs directly if the helper already copied a stable local file. Prefer the saved file path.
Config
The script accepts CLI flags first, then env vars, then OpenClaw skill config.
Supported env vars:
- - INLINECODE21
- INLINECODE22
- INLINECODE23
Use ACESTEP_API_BASE_URL or the OpenClaw config entry to switch between local and remote ACE-Step-compatible backends.
Optional OpenClaw config in ~/.openclaw/openclaw.json:
CODEBLOCK2
Notes
- - Check backend health first if needed:
curl http://127.0.0.1:8001/health or the same path on your remote endpoint - If the API returns temp
/v1/audio?path=... URLs, the helper copies those files into the chosen output directory and writes a INLINECODE28 - Prefer
batch-size 1 for efficient prompt iteration; raise it only when the user explicitly wants variants
ACE-Step 文本转音乐
使用兼容ACE-Step的API后端处理提示词转歌曲和歌词转歌曲请求。此技能不会安装或捆绑ACE-Step、模型权重或API服务器。
前置条件
使用此技能前,请确保您已拥有兼容ACE-Step的API后端访问权限。这可以是本地服务器(通常位于http://127.0.0.1:8001),也可以是远程兼容端点。如果后端缺失或停止运行,此技能将无法生成音乐。
快速开始
bash
python3 {baseDir}/scripts/generate.py --prompt 关于涌浪的俏皮海滩流行歌曲
python3 {baseDir}/scripts/generate.py --prompt 明亮吉他的欢快独立流行乐 --lyrics-file /path/to/lyrics.txt --duration 60
默认设置针对快速本地迭代进行了优化:
- - batchsize=1,除非明确要求,否则避免生成重复变体
- audioformat=mp3
- sample_mode=text2music
- thinking=false,除非用户要求更重的LM辅助生成
- 完成的音频会复制到稳定的输出文件夹,而非仅保留临时API路径
使用场景
- - 已有可用的ACE-Step兼容API后端,通常是位于http://127.0.0.1:8001的本地服务器,也可能是远程端点
- 用户需要文本转音乐、歌词转歌曲或快速风格变体
- 用户希望使用单个命令提交、轮询并返回已保存文件
- 用户希望在本地生成音乐后在Clawatch上播放
- 用户已拥有本地或远程ACE-Step兼容后端的访问权限
运行
bash
基础提示词
python3 {baseDir}/scripts/generate.py --prompt 关于日出波浪的俏皮合成流行歌曲
带歌词
python3 {baseDir}/scripts/generate.py \
--prompt 可爱的欢快夏日海滩歌曲 \
--lyrics-file /path/to/lyrics.txt \
--duration 60
两个变体
python3 {baseDir}/scripts/generate.py \
--prompt 梦幻城市流行海洋律动 \
--duration 45 \
--batch-size 2
仅在需要时启用更重的LM规划
python3 {baseDir}/scripts/generate.py \
--prompt 关于暴风雨转为平静的电影级颂歌 \
--duration 60 \
--thinking
实用参数:
- - --duration 10..600
- --lyrics 或 --lyrics-file
- --batch-size 1..8
- --thinking
- --model acestep-v15-turbo
- --out-dir /path/to/output
- --base-url http://127.0.0.1:8001 用于本地后端
- --base-url https://your-remote-endpoint 用于远程后端
Clawatch播放
如果用户还希望在Clawatch上播放结果:
- 1. 运行生成器并等待保存的输出文件路径。
- 从脚本输出或manifest.json中选择最终的.mp3路径。
- 调用clawatchplayaudio,参数包括:
- imei:明确的手表IMEI
- filePath:保存的本地音频路径
- title:可选的简短标签
如果辅助程序已复制了稳定的本地文件,请勿直接传递ACE-Step临时URL。优先使用已保存的文件路径。
配置
脚本优先接受CLI参数,然后是环境变量,最后是OpenClaw技能配置。
支持的环境变量:
- - ACESTEPAPIBASEURL
- ACESTEPAPIKEY
- ACESTEPOUTPUT_DIR
使用ACESTEPAPIBASE_URL或OpenClaw配置条目在本地和远程ACE-Step兼容后端之间切换。
~/.openclaw/openclaw.json中的可选OpenClaw配置:
json5
{
skills: {
entries: {
gen-music: {
baseUrl: http://127.0.0.1:8001,
apiKey: ,
outputDir: ~/Projects/tmp/ace-step
}
}
}
}
注意事项
- - 如有需要,先检查后端健康状态:curl http://127.0.0.1:8001/health 或远程端点的相同路径
- 如果API返回临时/v1/audio?path=... URL,辅助程序会将这些文件复制到选定的输出目录并写入manifest.json
- 优先使用batch-size 1以实现高效的提示词迭代;仅在用户明确要求变体时增加该值