StableDiffusion使用ControlNet时报错解决办法。
报错为ffmpy.FFExecutableNotFoundError: Executable ‘ffmpeg‘ not found
主要原因就是ffmpy.py的调用时需要输入调用ffmpeg.exe的路径,主要分三步解决:
1、前往ffmpeg官网https://ffmpeg.org/download.html,下载ffmerg。


下载后解压文件,我是解压到C:\Python310\whl 中。

2、找到stable-diffusion-webui\venv\Lib\site-packages\ffmpy.py文件,修改
def __init__(
self, executable="ffmpeg", global_options=None, inputs=None, outputs=None
):
里的executable参数,为刚才解压的路径C:/Python310/whl/ffmpeg-6.0-full_build/bin/ffmpeg
def __init__(
self, executable="C:/Python310/whl/ffmpeg-6.0-full_build/bin/ffmpeg", global_options=None, inputs=None, outputs=None
):
保存。
3、重新启动stable-diffusion(重新加载才会生效),再次使用ControlNet生成图片,成功生成。