版本
sd-webui(https://github.com/AUTOMATIC1111/stable-diffusion-webui version: v1.10.1)
SadTalker(https://github.com/OpenTalker/SadTalker/ commit: cd4c0465ae0b54a6f85af57f5c65fec9fe23e7f8)
https://github.com/OpenTalker/SadTalker.git
- git@github.com:OpenTalker/SadTalker.git
- set COMMANDLINE_ARGS=”–disable-safe-unpickle”
set SADTALKER_CHECKPOINTS=D:\openai.wiki\stable-diffusion-webui\extensions\SadTalker\checkpoints
下载 & 修改 & 使用
使用git clone https://github.com/OpenTalker/SadTalker下载,sd-webui在线安装会出问题。
下载好以后,复制到D:\ai\stable-diffusion-webui\extensions中,注意文件夹的名称必须是SadTalker。
修改
修改文件名
requirements3d.txt
req.txt
requirements.txt
这三个文件,名称后加个1,别让自动安装依赖。
修改代码
return librosa.stft(y=y, n_fft=hp.n_fft, hop_length=get_hop_size(), win_length=hp.win_size)
在src/utils/audio.py搜索上面这行代码,改成下面的
return librosa.stft(y=y, n_fft=hp.n_fft, hop_length=get_hop_size(), win_length=hp.win_size, dtype=float)
在src\face3d\util\preprocess.py中
添加`from numpy import array`
搜索这行代码
trans_params = np.array([w0, h0, s, t[0], t[1]])
改成它
trans_params = array([float(w0), float(h0), float(s), float(t[0]), float(t[1])])
在src\face3d\util\my_awing_arch.py中
搜索这行代码
preds = preds.astype(np.float, copy=False)
改成它
preds = preds.astype(float, copy=False)
修改.py文件时注意空格对齐。
这样安装
venv\Scripts\pip.exe install librosa==0.9.2
报什么错安装什么,别一下安装很多。
下载模型文件:
放到D:\ai\stable-diffusion-webui\extensions\SadTalker\checkpoints中。
在webui-user.bat文件中的call webui.bat的前面添加set SADTALKER_CHECKPOINTS=D:\ai\stable-diffusion-webui\extensions\SadTalker\checkpoints
(更建议将这些模型文件放到stable-diffusion-webui或SadTalker目录之外,如D:\ai\sd-extendsion-files\SadTalker,这样使用set SADTALKER_CHECKPOINTS=D:\ai\sd-extendsion-files\SadTalker\checkpoints即可,见
官方文档)
https://github.com/OpenTalker/SadTalker/releases
在v0.0.2版本里
mapping_00109-model.pth.tar 149 MB ./checkpoints/mapping_00109-model.pth.tar
mapping_00229-model.pth.tar 148 MB ./checkpoints/mapping_00229-model.pth.tar
SadTalker_V0.0.2_256.safetensors 691 MB ./checkpoints/SadTalker_V0.0.2_256.safetensors
SadTalker_V0.0.2_512.safetensors 691 MB ./checkpoints/SadTalker_V0.0.2_512.safetensors
auido2exp_00300-model.pth
auido2pose_00140-model.pth
epoch_20.pth
wav2lip.pth
facevid2vid_00189-model.pth.tar
还会下载其它文件,建议手工下载,复制到对应目录中:
Downloading: “https://github.com/xinntao/facexlib/releases/download/v0.1.0/alignment_WFLW_4HG.pth" to D:\ai\stable-diffusion-webui\extensions\SadTalker\gfpgan\weights\alignment_WFLW_4HG.pth

最后编辑:张三 更新时间:2024-12-11 10:30