moon

V1

2023/05/03阅读:44主题:自定义主题1

stable diffusion 安装教程整理

安装stable diffusion webui教程

  • Step 1: 安装 hombrew (Homebrew是 mac的包管理器,仅需执行相应的命令,就能下载安装需要的软件包,可以省掉自己去下载、解压、拖拽(安装)等繁琐的步骤)
/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"
  • Step 2 :修改 homebrew 源为国内(默认国外的源,为的是提高下载速度)
 # 查看 brew.git 当前源
cd "$(brew --repo)" && git remote -v
origin    https://github.com/Homebrew/brew.git (fetch)
origin    https://github.com/Homebrew/brew.git (push)
# 查看 homebrew-core.git 当前源
cd "$(brew --repo homebrew/core)" && git remote -v
origin    https://github.com/Homebrew/homebrew-core.git (fetch)
origin    https://github.com/Homebrew/homebrew-core.git (push)

# 修改 brew.git 为阿里源
$ git -C "$(brew --repo)" remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git

 # 修改 homebrew-core.git 为阿里源
 $ git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git

# zsh 替换 brew bintray 镜像
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc

# bash 替换 brew bintray 镜像
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile

# 刷新源
$ brew update
  • Step 3 :安装下底层组件 python(运行底层需要)
brew install cmake protobuf rust python@3.10 git wget
  • Step 4 : 安装pytorch (运行底层需要)

是一种用于构建深度学习模型的功能完备框架,用 python 写的,中层支撑

pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu
  • Step 5:升级下python(运行底层需要)
/Applications/Xcode.app/Contents/Developer/usr/bin/python3 -m pip install --upgrade pip
  • Step 6 : 安装stable diffusion webui
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

  • Step 7 : 安装必要组件(运行底层需要)
切换 pip3 的源为清华源
pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
安装组件

先下载文件地址如下

https://files.pythonhosted.org/packages/6d/0f/3fef6d450d8476b7d944c0811afc761b28d71bd9753b130ded449b9df379/d2l-1.0.0b0-py3-none-any.whl

pip3 install "/Users/lxz/Desktop/d2l-1.0.0b0-py3-none-any.whl" 
pip3 install --upgrade pip
pip3 install scikit-image
pip3 install gfpgan
  • Step 8: 运行
进入到自己的  /stable-diffusion-webui  目录

我的是 /usr/local/Homebrew/stable-diffusion-webui
就输入 cd /usr/local/Homebrew/stable-diffusion-webui

之后输入
./webui.sh

  • Step 9 : 通过浏览器打开,终端不要退出

看到这个后 在浏览器输入该地址 就 ok 了

分类:

后端

标签:

后端

作者介绍

moon
V1