Stable Diffusion 本地部署避坑指南

Stable Diffusion 本地部署避坑指南

运行webui-user.bat时报错:

Installing collected packages: torch, torchvision
raise BadZipFile("Bad CRC-32 for file %r" % self.name)
zipfile.BadZipFile: Bad CRC-32 for file 'torch/lib/torch_cuda.dll'
问题解决:
python.exe -m pip install torch==2.1.2 torchvision==0.16.2 --extra-index-url https://download.pytorch.org/whl/cu121 --no-cache
后面加--no-cache

运行webui-user.bat时报错:

RuntimeError: Couldn't clone Stable Diffusion XL.
问题解决:
看一下这个网址能不能连上:https://github.com/Stability-AI/generative-models
如果连不上只能玩魔法了。

其它有用信息:

注意:如果提示此命令nvidia-smi,非内部命令时,按以下操作
把此路径:C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR

SD训练模型下载:
https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/tree/main

CUDA下载:
https://developer.nvidia.com/cuda-toolkit-archive
12.1

=======================
安装cuda前,要安装VisualStudioSetup.exe

运行 nvcc -V 可知,当前cuda版本

cuda下载最新版本:
https://developer.nvidia.com/cuda-toolkit-archive
https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=11&target_type=exe_local

显卡驱动下载:
https://www.nvidia.cn/geforce/drivers/

pip install K:\StableDiffusion\DownloadSRC\torch-2.1.2+cu121-cp310-cp310-win_amd64.whl

当你确定要删除旧环境时,可以使用以下命令列出所有环境:
conda env list

找到要删除的环境名称后,使用以下命令删除旧环境:
conda env remove --name old_env_name

缓存目录,可以删除:
C:\Users\Administrator\AppData\Local\Temp

whl缓存文件:
C:\Users\Administrator\AppData\Local\pip\cache\http

Comments

No comments yet. Why don’t you start the discussion?

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注