用Conda设置 Stable Diffusion WebUI 1.9.4

[复制链接]
发表于 2026-2-10 18:51:00 | 显示全部楼层 |阅读模式
用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假造环境
  1. conda create -n envs python==3.10.14 -y
  2. conda activate envs
复制代码
3. Conda设置清华源
  1. conda config --show channels
  2. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  3. conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  4. conda config --set show_channel_urls yes
复制代码
4. pip设置清华源
  1. pip config list
  2. pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
复制代码
5. 安装依赖包

去掉文件中的torch包
  1. pip install -r requirements.txt
复制代码
然后
去掉文件中的torch包
  1. pip install -r requirements_versions.txt
复制代码
末了再重新安裝Pytorch,Pytorch版本,可以查察官网最新版本,最好是看sd必要的版本,不消担心版本风险。
  1. 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
复制代码
安裝常用包(可选项)
  1. pip install scikit-learn einops ipywidgets pandas tqdm jupyterlab matplotlib seaborn
复制代码
单独安装xformers
  1. pip install xformers==0.0.23.post1
复制代码
有2个包坏了,重新安装
  1. pip uninstall charset_normalizer & pip install charset_normalizer
复制代码
  1. pip uninstall pillow & pip install pillow==9.5.0
复制代码
  1. pip install git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1
复制代码
6. 启动
  1. cd stable-diffusion-webui
  2. python webui.py --allow-code --medvram --xformers --enable-insecure-extension-access --api
复制代码
END

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
回复

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表