Mac安装Stable Diffusion

第一步:安装anaconda

https://www.anaconda.com/download

第二步:下载代码

# 创建虚拟环境sdtest1
conda create -n sdtest1 python=3.10
# 激活虚拟环境sdtest1
conda activate sdtest1
# 下载代码
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
# 也可以使用代理下载
git clone https://ghproxy.com/https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

第三步:pip设置镜像源

国内常用的镜像源如下所示

清华: https://pypi.tuna.tsinghua.edu.cn/simple
阿里云: http://mirrors.aliyun.com/pypi/simple/
中国科技大学: https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣: http://pypi.douban.com/simple/

# pip设置阿里源
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple

第四步:安装依赖

# 进入 stable-diffusion-webui 目录
pip install -r requirements_versions.txt
pip install -r requirements.txt

我在安装依赖时一直卡在下面地方很久都不动

Preparing metadata (setup.py) ... -

通过使用--verbose来显示安装过程中出现的错误信息

pip install -r requirements_versions.txt --verbose
pip install -r requirements.txt --verbose

然后看到如下错误

Collecting basicsr==1.4.2 (from -r requirements_versions.txt (line 4))
  Using cached https://mirrors.aliyun.com/pypi/packages/86/41/00a6b000f222f0fa4c6d9e1d6dcc9811a374cabb8abb9d408b77de39648c/basicsr-1.4.2.tar.gz (172 kB)
  Running command python setup.py egg_info
  /Users/lizhencheng/lzc/app/anaconda/anaconda3/envs/test/lib/python3.10/site-packages/setuptools/__init__.py:84: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
  !!

          ********************************************************************************
          Requirements should be satisfied by a PEP 517 installer.
          If you are using pip, you can try `pip install --use-pep517`.
          ********************************************************************************

  !!
    dist.fetch_build_eggs(dist.setup_requires)

根据错误提示,重新安装即可

第五步:启动准备

启动时会去GitHub下载东西,可以设置下代理。

stable-diffusion-webui/modules/launch_utils.py中的https://github.com替换成https://ghproxy.com/https://github.com

手动下载模型v1-5-pruned-emaonly.safetensors,大概有4G左右,下载地址如下:
https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors

将下载好的模型放到目录:stable-diffusion-webui/models/Stable-diffusion

第六步:启动项目

# 可以通过--port指定端口
python launch.py --skip-torch-cuda-test --precision full --no-half --api

相关教程

Stable Diffusion2.1+WebUI的安装与使用

Mac环境 Stable Diffusion Web Ui 安装教程

AI图片生成Stable Diffusion环境搭建与运行

调用Stable Diffusion API 接口

GitHub Proxy

开源的建筑模型

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值