AI大模型教程
一起来学习

用Conda配置 Stable Diffusion WebUI 1.9.4

用Conda配置 Stable Diffusion WebUI 1.9.4

本文主要讲解: 如何用Conda搭建Stable Diffusion WebUI 1.9.4环境,用Conda的方式安装,不需要单独去安装Cuda了。

1. 安装miniconda

https://docs.anaconda.com/free/miniconda/index.html

2. 搭建虚拟环境

激活python虚拟环境

conda create -n envs python==3.10.14 -y
conda activate envs 

3. Conda设置清华源

conda config --show channels

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes

4. pip设置清华源

pip config list
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

5. 安装依赖包

去掉文件中的torch包

pip install -r requirements.txt

然后
去掉文件中的torch包

pip install -r requirements_versions.txt

最后再重新安裝Pytorch,Pytorch版本,可以查看官网最新版本,最好是看sd需要的版本,不用担心版本风险。

pip uninstall torch & conda install pytorch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 pytorch-cuda=12.1 -c pytorch -c nvidia

安裝常用包(可选项)

pip install scikit-learn einops ipywidgets pandas tqdm jupyterlab matplotlib seaborn

单独安装xformers

pip install xformers==0.0.23.post1

有2个包坏了,重新安装

pip uninstall charset_normalizer & pip install charset_normalizer
pip uninstall pillow & pip install pillow==9.5.0
pip install git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1

6. 启动

cd stable-diffusion-webui
python webui.py --allow-code --medvram --xformers --enable-insecure-extension-access --api

END


文章来源于互联网:用Conda配置 Stable Diffusion WebUI 1.9.4

相关推荐: 【已解决】报错“copying a param with shape torch.Size([1280, 1280]) from checkpoint”

在使用SDXL时,报错“copying a param with shape torch.Size([1280, 1280]) from checkpoint, the shape in current model is torch.Size([1280, 1…

赞(0)
未经允许不得转载:5bei.cn大模型教程网 » 用Conda配置 Stable Diffusion WebUI 1.9.4
分享到: 更多 (0)

AI大模型,我们的未来

小欢软考联系我们