Lux Tts
v1.0.0提供本地高速、高质量文本转语音服务,支持语音克隆与自动路径管理,无需云端确保隐私安全。
Security Scan
OpenClaw
Benign
medium confidencePurpose & Capability
技能名与描述(本地高质量 TTS、语音克隆、隐私)与包含的代码文件一致:包内提供了一个‘ready’模拟实现(lux_tts_ready/fixed)与工具封装(lux_tts_tool、__init__)。不过代码和文档都强烈偏向 Windows(大量硬编码的 D:\lux-tts 路径、PowerShell/ .bat 指令),且虽然文档提到“自动检测安装位置”,实现却主要使用硬编码路径和 sys.path 插入;此外真实模型分支取决于第三方包(zipvoice.luxvoice / pip 包 zipvoice-luxvoice),这是合理但值得注意。
Instruction Scope
SKILL.md 指示运行 deploy.ps1 / download-model.ps1、创建 venv、pip 安装依赖并从 Hugging Face 下载模型 —— 这些都是模型化 TTS 合理的步骤。但这些部署/下载脚本未包含在清单中(代码包里没有 deploy.ps1/download-model.ps1 内容),因此运行这些外部脚本会从网络获取文件/代码;文档还包含‘回退到云端 TTS’的示例(cloud_tts_generate),但未定义该函数,存在文档/实现不一致。总体上运行步骤超出了仅在内存中运行的范围(会在磁盘写入、创建目录),在运行外部下载脚本前应审查脚本。
Install Mechanism
技能本身没有 install spec(instruction-only 安装流程),但代码文件包含在包内;SKILL.md 建议使用 pip 安装依赖并从 Hugging Face 下载模型(Hugging Face 是常见模型源,URL 指向官方仓库),没有看到可疑短链接或个人服务器地址。总体安装机制与模型化 TTS 的常规流程相符,但下载脚本(未包含)应在信任环境中检查。
Credentials
清单不要求任何环境变量或凭证(requires.env 无),代码也未尝试读取敏感凭证或网络密钥。文档建议设置可选的 LUX_TTS_PATH 环境变量用于定位,这与用途一致。没有发现要求与用途不相关的凭据。
Persistence & Privilege
技能不会请求始终启用(always:false),也未声明修改其他技能或全局代理设置。但代码在默认情况下会在系统盘(D:\lux-tts)创建目录并写入文件(模型、voices、cache、临时输出)。SKILL.md 建议以管理员身份运行某些安装脚本;因此在权限与文件写入方面请谨慎:这些行为与安装大型本地模型的需求一致,但会改写本地磁盘(尤其是硬编码的 D: 路径)。
Assessment
What to consider before installing:
- This package is internally coherent with a local TTS: included Python modules implement a local (simulated) TTS and do not request credentials or hard-coded network endpoints.
- However SKILL.md tells you to run deployment/download scripts (deploy.ps1, download-model.ps1) that are not included in the bundle; those scripts will download model files or other artifacts from the network — inspect them before running.
- The 'real' model path depends on an external package (zipvoice.luxvoice / pip package named in docs). Verify that package on PyPI (or its source) before installing and check its behavior and trustworthiness.
- The code creates and writes files under D:\lux-tts (Windows-centric hard-coded paths) and may require elevated privileges if you run the recommended installer as admin. If you don't have a D: drive or are on Linux/macOS, adjust paths or run in a sandbox.
- Recommended safe steps: 1) Review any deploy/download scripts and the pip packages they install; 2) Run installation and first tests in an isolated VM/container or restricted user account; 3) Prefer manual model downloads from the official Hugging Face page linked in docs and verify checksums; 4) Do not run unknown PowerShell/BAT scripts as administrator until reviewed; 5) If you need to keep host clean, modify config/install paths to a directory you control.
- If you want more assurance, provide the actual deploy.ps1/download-model.ps1 contents and any install scripts so they can be inspected; that could raise or lower my confidence.Like a lobster shell, security has layers — review code before you run it.
latest
LuxTTS 技能 - 本地高质量文本转语音
概述
LuxTTS 是一个高质量的本地文本转语音模型,支持语音克隆,速度达到实时150倍。本技能将 LuxTTS 集成到 OpenClaw 中,提供本地化的 TTS 服务。
特性
- 🚀 极速生成:150倍实时速度
- 🎯 高质量语音:48kHz 高清音频
- 🔒 完全本地:无需云端 API,保护隐私
- 🎨 语音克隆:支持自定义语音
- 💾 智能路径管理:自动检测安装位置
安装位置
- 主安装:
D:\lux-tts\(模型、大文件) - 接口层:
workspace/lux-tts/(智能路径管理) - 自动检测:支持多个可能的位置
部署步骤
1. 运行部署脚本
# 在 D:\lux-tts\scripts\ 目录下
.\deploy.ps1
2. 下载模型
.\download-model.ps1
3. 测试安装
# 在 OpenClaw 中测试
from lux_tts import test_installation
test_installation()
使用方法
基本使用
from lux_tts_tool import tts_generate, tts_status
# 检查状态
status = tts_status()
print(status)
# 生成语音
result = tts_generate("你好,我是 LuxTTS")
if result["success"]:
# result["audio_base64"] 包含 base64 编码的音频
print(f"生成成功,时长: {result['duration']}秒")
在 OpenClaw 工具中调用
# 在 OpenClaw 技能中
from lux_tts_tool import get_tts_tool
tts = get_tts_tool()
result = tts.generate("需要转换为语音的文本")
命令行测试
# 检查状态
python lux_tts_tool.py status
# 列出语音
python lux_tts_tool.py list
# 生成语音
python lux_tts_tool.py generate "你好世界" --output output.wav
配置
配置文件位置
D:\lux-tts\config.yaml
配置选项
install_path: "D:\\lux-tts" # 安装位置
device: "cuda" # 设备:cuda/cpu
model_repo: "YatharthS/LuxTTS" # 模型仓库
reference_voice: "voices/test.wav" # 默认语音
audio_format: "wav" # 音频格式
sample_rate: 48000 # 采样率
cache_enabled: true # 启用缓存
cache_dir: "cache" # 缓存目录
语音管理
添加自定义语音
- 准备清晰的语音文件(WAV/MP3,≥3秒)
- 复制到
D:\lux-tts\voices\目录 - 或在代码中调用:
tts.add_voice("path/to/your/voice.wav", "my_voice.wav")
使用自定义语音
result = tts_generate("文本", voice="D:\\lux-tts\\voices\\my_voice.wav")
故障排除
常见问题
1. "未找到 LuxTTS 安装"
- 检查
D:\lux-tts\目录是否存在 - 运行部署脚本:
deploy.ps1 - 设置环境变量:
LUX_TTS_PATH=D:\lux-tts
2. "无法导入 zipvoice"
- 激活虚拟环境:
D:\lux-tts\venv\Scripts\activate - 重新安装:
pip install zipvoice-luxvoice
3. CUDA 不可用
- 检查 NVIDIA 驱动:
nvidia-smi - 回退到 CPU:修改
config.yaml中的device: "cpu"
4. 音频质量不佳
- 确保参考音频 ≥3秒,清晰无噪音
- 调整参数:
rms=0.01,t_shift=0.9,num_steps=4
日志查看
import logging
logging.getLogger('lux_tts').setLevel(logging.DEBUG)
性能优化
GPU 加速
- 确保 CUDA 可用:
nvidia-smi - 配置文件中设置
device: "cuda"
缓存启用
- 启用缓存减少重复生成
- 缓存目录:
D:\lux-tts\cache\
批量处理
# 批量生成可复用编码的提示
encoded = tts.client._model.encode_prompt(voice_file)
for text in texts:
audio = tts.client._model.generate_speech(text, encoded)
与现有 TTS 集成
并行运行模式
def hybrid_tts(text, use_local=True):
"""混合 TTS:本地优先,云端备用"""
try:
if use_local:
return tts_generate(text)
except Exception:
pass
# 回退到云端 TTS
return cloud_tts_generate(text)
配置 OpenClaw
在 TOOLS.md 中添加:
## TTS 选项
1. **本地 LuxTTS**:快速、免费、隐私好
2. **云端 TTS**:备用方案
更新和维护
更新模型
# 重新下载模型
.\download-model.ps1
备份配置
# 备份重要文件
Copy-Item "D:\lux-tts\config.yaml" "备份路径\"
Copy-Item "D:\lux-tts\voices\" "备份路径\voices\" -Recurse
清理缓存
Remove-Item "D:\lux-tts\cache\*" -Recurse -Force
许可证
- LuxTTS 模型:Apache-2.0
- 本技能:MIT
参考
最后更新: 2026-03-16
Comments
Loading comments...
