最少路径:
# 前提 - 系统已配置git和Python环境,可以使用py、pip命令,
# 使用管理员打开powershell或windows terminal窗口,找一个全英文的路径
# 注意:index-tts项目本身提供的readme.md下载步骤,坑比较多
#### 第一步 克隆项目
# 坑1:无法下载lfs大文件(LFS 文件主要是示例音频 不影响使用 可以从其他渠道获取)
# 设置跳过lfs的下载
git lfs install --skip-smudge
# 或者SET(有时会无效)
## SET GIT_LFS_SKIP_SMUDGE=1
# clone项目
git clone https://github.com/index-tts/index-tts.git
#### 第二步 下载依赖
# 安装包管理工具uv
pip install -U uv
# 进入目录
cd index-tts
# 坑2:Windows环境需要跳过DeepSpeed的安装(仅提供有限的加速功能,但安装极其复杂)
# 安装依赖(需要等几分钟,不要使用--all-extras) - 阿里云镜像
uv sync --extra webui --default-index "https://mirrors.aliyun.com/pypi/simple"
# 或者 - 清华镜像
## uv sync --extra webui --default-index "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
#### 第三步 主模型
# 下载主模型
# 安装hugginface,因为最后启动时还会自动使用hf下载模型的依赖,必须要下
uv tool install "huggingface-hub[cli,hf_xet]"
# 如果没有科学,必须设置HF的镜像(需要管理员权限打开powershell)
# 临时设置,只在这次的对话中有效
$env:HF_ENDPOINT="https://hf-mirror.com"
# 永久设置,设置完后需要关闭命令窗口重启
setx HF_ENDPOINT "https://hf-mirror.com" # 成功: 指定的值已得到保存。
# 跳过环境配置,使用uv run来运行hf,下载模型(7g左右),如果第一次超时了,再重新执行一次
uv tool run hf download IndexTeam/IndexTTS-2 --local-dir=checkpoints
# 或者使用modelscope(在这一步会比hf快一点,但hf的安装和镜像如果没有科学,必须设置)
## uv tool install "modelscope"
## modelscope download --model IndexTeam/IndexTTS-2 --local_dir checkpoints
#### 第四步 启动(下载依赖模型)
# 默认使用hf进行下载,所以要先设置镜像
uv run webui.py