赞
踩
Stable Diffusion安装部署
一.准备
建议最低8G显存 ,推荐NVIDIA 4060Ti 16G版本
1. 安装python3.10.6
打开python官网 Welcome to Python.org 下载
2. 安装git
打开git官网 Git 下载
3. 安装CUDA11.7
打开cuda下载地址 https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exe _local 下载
4. 安装vscode(可选)
打开vscode官网 Visual Studio Code - Code Editing. Redefined 下载
5. 克隆stable-diffusion-webui
Win+X选择Windows PowerShell
依次输入
- cd D:\Tools #克隆本地路径 ,我这里选择的是D盘Tools这个文件夹
- git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.g it
如下
克隆完成
二 .部署
1. 安装pytorch
打开下载地址 https://download.pytorch.org/whl/cu118
下载torch,torchvision
torch=2.0.1
torchvision=0.15.2
- pip install torch-2.0.1+cu117-cp310-cp310-win_amd64.whl
- pip install torchvision-0.15.2+cu117-cp310-cp310-win_amd64.whl
- #切到D盘Tools文件夹路径
- cd D:\\Tools
- ##克隆 Web UI
- git clone https://github.com/AUTOMATIC1111/stable-diffusionwebui.git
- ##切到D:\Tools\stable-diffusion-web ui路径
- cd D:\\Tools\stable-diffusion-webui
- ##为stable diffusion克隆仓库
- mkdir repositories
- git clone https://github.com/CompVis/stable-diffusion.git
- repositories/stable-diffusion-stability-ai
- git clone https://github.com/CompVis/taming-transformers.git
- repositories/taming-transformers
- git clone https://github.com/sczhou/CodeFormer.git
- repositories/CodeFormer
- git clone https://github.com/salesforce/BLIP.git
- repositories/BLIP
- git clone https://github.com/crowsonkb/k-diffusion.git
- repositories/k-diffusion
- ##为stable diffusion安装依赖
- pip install transformers==4.19.2 diffusers invisiblewatermark --prefer-binary
- pip install GitPython==3.1.30/
- Pillow==9.5.0/
- accelerate==0.18.0/
- basicsr==1.4.2/
- blendmodes==2022/
- clean-fid==0.1.35/
- einops==0.4.1/
- fastapi==0.94.0/
- gfpgan==1.3.8/
- gradio==3.32.0/
- httpcore==0.15/
- inflection==0.5.1/
- jsonmerge==1.8.0/
- kornia==0.6.7/
- lark==1.1.2/
- numpy==1.23.5/
- omegaconf==2.2.3/
- open-clip-torch==2.20.0/
- piexif==1.1.3/
- psutil==5.9.5/
- pytorch_lightning==1.9.4/
- realesrgan==0.3.0/
- resize-right==0.0.2/
- safetensors==0.3.1/
- scikit-image==0.20.0/
- timm==0.6.7/
- tomesd==0.1.2/
- torch/
- torchdiffeq==0.2.3/
- torchsde==0.2.5/
- transformers==4.25.1
- ##安装xformers
- pip install xformers==0.0.20
- ##安装GFPGAN
- git clone https://github.com/TencentARC/GFPGAN.git
- venv\Scripts\GFPGAN
- cd D:\\Tools\stable-diffusion-webui\venv\Scripts\GFPGAN
- D:\\Tools\stable-diffusion-webui\venv\Scripts\python.exe -m
- pip install basicsr facexlib
- D:\\Tools\stable-diffusion-webui\venv\Scripts\python.exe -m
- pip install -r requirements.txt
- D:\\Tools\stable-diffusion-webui\venv\Scripts\python.exe -m
- setup.py develop
- ##安装CodeFormer依赖
- pip install -r repositories/CodeFormer/requirements.txt --
- prefer-binary
- ##安装web ui依赖
- pip install -r requirements.txt --prefer-binary
- ##更新numpy
- pip install -U numpy --prefer-binary
- ##运行程序
- python launch.py
- 打开浏览器输入http://127.0.0.1:7860进入web程序
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。