Stable diffusion 本地部署加载模型报 openai/clip-vit-large-patch14 错误
1. 报错形貌本地部署好 Stable diffusion 以后,点击加载模型时报 openai/clip-vit-large-patch14 错误,具体报错信息如下:
raise EnvironmentError(
OSError: Can't load tokenizer for 'openai/clip-vit-large-patch14'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'openai/clip-vit-large-patch14' is the correct path to a directory containing all relevant files for a CLIPTokenizer tokenizer. Failed to create model quickly; will retry using slow method.
loading stable diffusion model: OSError
2. 报错原因
连不上huggingface,无法下载模型。
3. 办理方法
1)手动下载 clip-vit-large-patch14 相干文件,可以直接在网盘下载,也可以去官网下载。网盘下载地点为:https://pan.quark.cn/s/220913e4ac3a
2)在本地磁盘中创建 openai 目录;
3)将下载的文件解压缩放入 openai 目录中;
4)打开本地安装目录中的 tokenization_utils_base.py 文件,文件路径为:\stable-diffusion-webui\venv\Lib\site-packages\transformers
5)在文件中搜刮 pretrained_model_name_or_path =,修改等号背面的路径为第 3 步中 clip-vit-large-patch14 的路径。比方:
https://img-blog.csdnimg.cn/img_convert/60315d5102ea718da83771e080be6955.png
6)打开 \stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\modules\encoders 路径下的 modules.py 文件,修改路径,具体如下(有两处):
第 1 处:
https://img-blog.csdnimg.cn/img_convert/b02ed0599388690b12f9a667052b606d.png
第 2 处:
https://img-blog.csdnimg.cn/img_convert/059b930bdab2fa6b9498414018b59088.png
7. 重启 SD ,重启后再次加载模型,已经可以加载出来了:
https://i-blog.csdnimg.cn/direct/0f4a559bb25c40ef893d771b2b2a96f1.png
#Stable diffusion
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]