stable diffusion 神经网络插件 controlnet 的安装,很详细
一、前言
学到 stable diffusion 的 controlnet 插件,安装也略微曲折,这里做个记录。
下载前保证 github 能正常访问。
二、下载
1、方式一
直接在 extensions 中搜索
controlnet

然后找到如下插件,点击 install ,网络不好的情况下可能会下载很久。

下载完重启即可。
2、方式二
到 github 下载,地址为:

然后到"根目录\extensions",我的是
D:\software\StableDiffusionWeb\stable-diffusion-webui\extensions
使用 git 下载,下载地址为:
powershell
https://github.com/Mikubill/sd-webui-controlnet.git


然后进入"根目录\extensions\sd-webui-controlnet",我的是
D:\software\StableDiffusionWeb\stable-diffusion-webui\extensions\sd-webui-controlnet
打开 install.py 文件

ctrl + f 输入
whl
进行搜索

拿到所有带 whl 后缀的链接,链接如下:
powershell
https://github.com/Gourieff/Assets/raw/main/Insightface/insightface-0.7.3-cp310-cp310-win_amd64.whl
powershell
https://github.com/huchenlei/HandRefinerPortable/releases/download/v1.0.1/handrefinerportable-2024.2.12.0-py2.py3-none-any.whl
powershell
https://github.com/huchenlei/Depth-Anything/releases/download/v1.0.0/depth_anything-2024.1.22.0-py2.py3-none-any.whl
powershell
https://github.com/MackinationsAi/UDAV2-ControlNet/releases/download/v1.0.0/depth_anything_v2-2024.7.1.0-py2.py3-none-any.whl
powershell
https://github.com/sdbds/DSINE/releases/download/1.0.2/dsine-2024.3.23-py3-none-any.whl
然后将 install_onnxruntime() 和 try_remove_legacy_submodule() 方法之间的所有代码注释
保存退出,接着将上面的每个链接都放到浏览器

会下载对应 whl 文件,下载好后将它们放到某个文件夹,我的是
D:\software\StableDiffusionWeb\stable-diffusion-webui\extensions\other\controlnet-file

接着使用
powershell
cmd
进入黑窗口

对每个文件使用如下命令:
powershell
pip install "完整文件名"
比如下载 depth_anything_v2-2024.7.1.0-py2.py3-none-any.whl ,命令如下:
powershell
pip install depth_anything_v2-2024.7.1.0-py2.py3-none-any.whl

等待下载完成

其他文件也是做类似下载,网络不好的情况下下载时间会比较长,全部下载完成后重启

可以看到 controlnet 已经安装成功了。

