ComfyUI TTS Skill
Generate speech audio using ComfyUI's Qwen-TTS service. This skill allows you to convert text to speech through ComfyUI's API.
Configuration
Environment Variables
Set these environment variables to configure the ComfyUI connection:
CODEBLOCK0
Usage
Basic Text-to-Speech
Generate audio from text using default settings:
CODEBLOCK1
Advanced Options
Customize voice characteristics:
CODEBLOCK2
Available Options
| Option | Description | Default |
|---|
| INLINECODE0 | Voice character (Girl/Boy/etc.) | "Girl" |
| INLINECODE1 |
Speaking style (Emotional/Neutral/etc.) | "Emotional" |
|
--model | Model size (0.5B/1.7B/3B) | "1.7B" |
|
--output | Output file path | Auto-generated |
|
--temperature | Generation temperature (0-1) | 0.9 |
|
--top-p | Top-p sampling | 0.9 |
|
--top-k | Top-k sampling | 50 |
Workflow
The skill performs these steps:
- 1. Construct Workflow: Builds a ComfyUI workflow JSON with your text and settings
- Submit Job: Sends the workflow to ComfyUI's
/prompt endpoint - Poll Status: Monitors job completion via
/history endpoint - Retrieve Audio: Returns the path to the generated audio file
Troubleshooting
Connection Refused
- - Verify ComfyUI is running: INLINECODE9
- Check host and port settings
Job Timeout
- - Large models (3B) take longer to generate
- Try smaller models (0.5B, 1.7B) for faster results
Output Not Found
- - Check ComfyUI's output directory configuration
- Verify file permissions
API Reference
The skill uses ComfyUI's native API endpoints:
- -
POST /prompt - Submit workflow - INLINECODE11 - Check job status
- Output files are saved to ComfyUI's configured output directory
ComfyUI TTS 技能
使用 ComfyUI 的 Qwen-TTS 服务生成语音音频。此技能允许您通过 ComfyUI 的 API 将文本转换为语音。
配置
环境变量
设置以下环境变量以配置 ComfyUI 连接:
bash
export COMFYUI_HOST=localhost # ComfyUI 服务器主机
export COMFYUI_PORT=8188 # ComfyUI 服务器端口
export COMFYUIOUTPUTDIR= # 可选:自定义输出目录
使用方法
基础文本转语音
使用默认设置从文本生成音频:
bash
scripts/tts.sh 你好,世界
高级选项
自定义语音特性:
bash
指定角色和风格
scripts/tts.sh 你好 --character Girl --style Emotional
更改模型大小
scripts/tts.sh 你好 --model 3B
指定输出文件
scripts/tts.sh 你好 --output /path/to/output.wav
组合选项
scripts/tts.sh 你好,这是测试 \
--character Girl \
--style Emotional \
--model 1.7B \
--output ~/audio/test.wav
可用选项
| 选项 | 描述 | 默认值 |
|---|
| --character | 语音角色(女孩/男孩等) | Girl |
| --style |
说话风格(情感化/中性等) | Emotional |
| --model | 模型大小(0.5B/1.7B/3B) | 1.7B |
| --output | 输出文件路径 | 自动生成 |
| --temperature | 生成温度(0-1) | 0.9 |
| --top-p | Top-p 采样 | 0.9 |
| --top-k | Top-k 采样 | 50 |
工作流程
该技能执行以下步骤:
- 1. 构建工作流:使用您的文本和设置构建 ComfyUI 工作流 JSON
- 提交任务:将工作流发送到 ComfyUI 的 /prompt 端点
- 轮询状态:通过 /history 端点监控任务完成情况
- 获取音频:返回生成的音频文件路径
故障排除
连接被拒绝
- - 验证 ComfyUI 是否正在运行:curl http://$COMFYUIHOST:$COMFYUIPORT/system_stats
- 检查主机和端口设置
任务超时
- - 大型模型(3B)生成时间较长
- 尝试使用较小模型(0.5B、1.7B)以获得更快结果
输出未找到
- - 检查 ComfyUI 的输出目录配置
- 验证文件权限
API 参考
该技能使用 ComfyUI 的原生 API 端点:
- - POST /prompt - 提交工作流
- GET /history - 检查任务状态
- 输出文件保存到 ComfyUI 配置的输出目录中