在Windows下搭建Stable Diffusion环境需要以下几个步骤:
- 安装Git和Anaconda
首先,确保你的计算机上已经安装了Git和Anaconda。如果没有安装,可以分别访问官方网站进行下载和安装:
- Git: https://git-scm.com/downloads
- Anaconda: https://www.anaconda.com/products/individual#Downloads
- 克隆Stable Diffusion仓库
打开命令提示符(cmd)或PowerShell,运行以下命令克隆Stable Diffusion的GitHub仓库:
git clone https://github.com/CompVis/stable-diffusion.git
- 创建新的Anaconda环境
进入stable-diffusion文件夹,然后创建一个新的Anaconda环境。运行以下命令:
cd stable-diffusion
conda env create -f environment.yaml
这将根据environment.yaml文件创建一个名为”ldm”的新环境,然后安装环境依赖等。
可是,运行中,可能网络原因,出错终止了…
此时,重新运行安装,则提示ldm已经存在,无法继续。
如果删掉ldm,则又要重新开始漫长的下载安装…
于是乎,根据environment.yaml的内容:
name: ldm
channels:
– pytorch
– defaults
dependencies:
– python=3.8.5
– pip=20.3
– cudatoolkit=11.3
– pytorch=1.11.0
– torchvision=0.12.0
– numpy=1.19.2
– pip:
– albumentations==0.4.3
– diffusers
– opencv-python==4.1.2.30
– pudb==2019.2
– invisible-watermark
– imageio==2.9.0
– imageio-ffmpeg==0.4.2
– pytorch-lightning==1.4.2
– omegaconf==2.1.1
– test-tube>=0.7.5
– streamlit>=0.73.1
– einops==0.3.0
– torch-fidelity==0.3.0
– transformers==4.19.2
– torchmetrics==0.6.0
– kornia==0.6
– -e git+https://github.com/CompVis/taming-transformers.git@master#egg=taming-transformers
– -e git+https://github.com/openai/CLIP.git@main#egg=clip
– -e .
改为常规的requirements.txt,由pip继续完成这个伟大的任务。
txt内容如下:
albumentations==0.4.3
diffusers
opencv-python==4.1.2.30
pudb==2019.2
invisible-watermark
imageio==2.9.0
imageio-ffmpeg==0.4.2
pytorch-lightning==1.4.2
omegaconf==2.1.1
test-tube>=0.7.5
streamlit>=0.73.1
einops==0.3.0
torch-fidelity==0.3.0
transformers==4.19.2
torchmetrics==0.6.0
kornia==0.6
-e git+https://github.com/CompVis/taming-transformers.git@master#egg=taming-transformers
-e git+https://github.com/openai/CLIP.git@main#egg=clip
-e .
然后先激活新环境
运行以下命令:
conda activate ldn
再然后,运行:
pip install -r requirements.txt
即可。
文章来源于互联网:在Windows下搭建Stable Diffusion环境中途出错咋弄?
相关推荐: 英文视频添加中英双语字幕(基于Whisper语音识别和Google翻译)
第一步:安装配置环境,这一步重要介绍安装的环境依赖,可以看完第二章再来看一遍 (1)Whisper环境配置 可以参考以下博客的内容讲显卡驱动,CUDA和cudnn的安装比较详细,我建议能用GPU加速就尽量使用,Whisper速度有点慢如何在你的电脑上完成whi…
5bei.cn大模型教程网










