用Conda配置 Stable Diffusion WebUI 1.9.4

用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
本文详细指导了如何通过Conda环境来搭建Stable Diffusion WebUI 1.9.4,以简化安装流程并避免单独安装Cuda的复杂性。以下是步骤总结:
1. **安装miniconda**:
访问[Miniconda官网](https://docs.anaconda.com/free/miniconda/index.html)下载并安装Miniconda,以便使用其环境管理和包安装功能。
2. **搭建虚拟环境**:
使用Conda创建一个新的Python虚拟环境,确保Python版本与Stable Diffusion兼容(建议使用Python 3.10.14)。
```bash
conda create -n envs python==3.10.14 -y
conda activate envs
```
3. **配置Conda源**:
为了提高包安装速度,将Conda的源配置为清华大学镜像站。
```bash
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的源也配置为清华大学镜像站,加速Python包的安装。
```bash
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
```
5. **安装依赖包**:
首先通过`requirements.txt`和`requirements_versions.txt`文件安装基本依赖,但需注意排除torch包并单独处理。之后,重新安装适配的Pytorch版本(推荐Pytorch 2.1.2+CUDA 12.1),以及补充安装其他常用库和特定需求,如xformers和CLIP(通过Git安装最新版本)。
6. **启动Stable Diffusion WebUI**:
进入`stable-diffusion-webui`目录,使用特定选项启动WebUI服务,确保应用以安全和高效的方式运行。
```bash
cd stable-diffusion-webui
python webui.py --allow-code --medvram --xformers --enable-insecure-extension-access --api
```
通过以上步骤,用户可以便捷地通过Conda环境搭建Stable Diffusion WebUI 1.9.4,享受自动差分扩展模型带来的图像创作乐趣。 webuiwebdiffusionpythonstable diffusionpytorchiconurlbashgit虚拟环境codelow-codehtmlapiclipivaclicreatedoc
  • 本文作者:李琛
  • 本文链接: https://wapzz.net/post-18742.html
  • 版权声明:本博客所有文章除特别声明外,均默认采用 CC BY-NC-SA 4.0 许可协议。
本站部分内容来源于网络转载,仅供学习交流使用。如涉及版权问题,请及时联系我们,我们将第一时间处理。
文章很赞!支持一下吧 还没有人为TA充电
为TA充电
还没有人为TA充电
0
  • 支付宝打赏
    支付宝扫一扫
  • 微信打赏
    微信扫一扫
感谢支持
文章很赞!支持一下吧
关于作者
2.3W+
5
0
1
WAP站长官方

两款头部产品流量下滑50%+,刚找到的AI流量密码失效了?

上一篇

1个电话1分钱,烦人的AI外呼成大模型最成功应用?

下一篇
  • 复制图片
按住ctrl可打开默认菜单