MacOS系统安装Stable Diffusion WebUI教程
关于AI绘画其实还是Windows系统比较主流,但是今天本站的论坛内有人在MacOS部署Stable Diffusion WebUI之后,出现绘画花屏的问题,可本站也没有办法排查问题具体出现在哪里,所以干脆出一期关于MacOS系统安装Stable Diffusion WebUI的教程吧。
正好站长在2020年苹果M1芯片刚出来的时候买了一台MacBook Air,默认是8GB内存,站长咬牙一跺脚,又加购了8G内存,当前系统版本为12.2.1。
如果您是非M系列芯片,安装过程应该也是一致的,本站没有非M系列芯片的设备,所以未到测试。
失败示例
我知道你急,但是你先别急,建议跳过此步骤。
正常来说,我们应该先通过安装包管理器Homebrew
,Homebrew可以帮你轻松下载所有MacOS系统中所缺失的依赖包。
下载地址:macOS(或 Linux)缺失的软件包的管理器 — Homebrew
打开网页之后,鼠标点击站长已经图像中标记的红色区域即可自动复制安装所用到的命令行内容。
自动复制的内容如下:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
此时我们运行启动台
→其它
→终端
打开终端的黑色窗口之后,我们粘贴刚刚所复制的内容,然后按下回车。
你大概率将会得到如下报错信息:
curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 21 ms: Couldn't connect to server
安装教程
站长这里已经配置过了魔法环境,还是无法下载,所以就不建议大家尝试了。
我们直接使用CDN加速方式下载Homebrew,执行以下代码,从 jsdelivr.net 获取Homebrew
安装脚本。
/bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/Homebrew/install/install.sh)"
此时我们将会得到如下提示内容,此时需要我们输入你的MacOS系统用户密码,输入之后按下回车即可。
⚠️注意:输入密码时不会被显示出来,就像没有输入任何内容一样,这是系统安全的保护机制,不用理会,正常输入,然后放心大胆的按下回车即可。
==> Checking for `sudo` access (which may request your password)... Password:
此时你将会看到如下提示内容,提醒你将要安装Xcode
命令行工具,我们直接按下回车
键。
==> This script will install: /opt/homebrew/bin/brew /opt/homebrew/share/doc/homebrew /opt/homebrew/share/man/man1/brew.1 /opt/homebrew/share/zsh/site-functions/_brew /opt/homebrew/etc/bash_completion.d/brew /opt/homebrew ==> The following new directories will be created: /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks ==> The Xcode Command Line Tools will be installed. Press RETURN/ENTER to continue or any other key to abort:
按下回车后,我们将会等待片刻,具体的安装日志内容如下:
Press RETURN/ENTER to continue or any other key to abort: ==> /usr/bin/sudo /usr/bin/install -d -o root -g wheel -m 0755 /opt/homebrew ==> /usr/bin/sudo /bin/mkdir -p /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks ==> /usr/bin/sudo /bin/chmod ug=rwx /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks ==> /usr/bin/sudo /bin/chmod go-w /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions ==> /usr/bin/sudo /usr/sbin/chown yufeng /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks ==> /usr/bin/sudo /usr/bin/chgrp admin /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks ==> /usr/bin/sudo /usr/sbin/chown -R yufeng:admin /opt/homebrew ==> /usr/bin/sudo /bin/mkdir -p /Users/yufeng/Library/Caches/Homebrew ==> /usr/bin/sudo /bin/chmod g+rwx /Users/yufeng/Library/Caches/Homebrew ==> /usr/bin/sudo /usr/sbin/chown -R yufeng /Users/yufeng/Library/Caches/Homebrew ==> Searching online for the Command Line Tools ==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress ==> Installing Command Line Tools for Xcode-14.3 ==> /usr/bin/sudo /usr/sbin/softwareupdate -i Command\ Line\ Tools\ for\ Xcode-14.3 Software Update Tool Finding available software Downloading Command Line Tools for Xcode Downloaded Command Line Tools for Xcode Installing Command Line Tools for Xcode Done with Command Line Tools for Xcode Done. ==> /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools ==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress ==> Downloading and installing Homebrew... --------------------------------------------------------- 此部分内容过长,省略不重要的部分。 --------------------------------------------------------- * [new tag] 4.0.9 -> 4.0.9 HEAD is now at fec24f5c0 Merge pull request #15352 from woodruffw-forks/ww/step-summary-var Warning: /opt/homebrew/bin is not in your PATH. Instructions on how to configure your shell for Homebrew can be found in the 'Next steps' section below. ==> Installation successful! ==> Homebrew has enabled anonymous aggregate formulae and cask analytics. Read the analytics documentation (and how to opt-out) here: https://docs.brew.sh/Analytics No analytics data has been sent yet (nor will any be during this install run). ==> Homebrew is run entirely by unpaid volunteers. Please consider donating: https://github.com/Homebrew/brew#donations ==> Next steps: - Run these two commands in your terminal to add Homebrew to your PATH: (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/yufeng/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)" - Run brew help to get started - Further documentation: https://docs.brew.sh yufeng@LYF_MacBook ~ %
- ⚠️注意1
- 这里有一处非常重要!那就是需要少加环境变量,我们看倒数第7行和第6行,这就是我们需要执行的内容,我们将这两条复制一下,单独执行。
- ⚠️注意2
- 以下两行内容,分开执行,而且不要复制本站的!一定要复制你自己的倒数第7行和第6行内容!因为每个人的MacOS系统用户名不一样,复制本站的没有用,不要偷懒。
- ⚠️注意3
- 一定要先执行倒数第7行,然后再执行倒数第6行,不要搞错顺序。
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/yufeng/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
此时我们执行如下命令,尝试启动brew
。
brew help
如果你安装成功了,那么将会得到如下内容提示:
yufeng@LYF_MacBook ~ % brew help Example usage: brew search TEXT|/REGEX/ brew info [FORMULA|CASK...] brew install FORMULA|CASK... brew update brew upgrade [FORMULA|CASK...] brew uninstall FORMULA|CASK... brew list [FORMULA|CASK...] Troubleshooting: brew config brew doctor brew install --verbose --debug FORMULA|CASK Contributing: brew create URL [--no-fetch] brew edit [FORMULA|CASK...] Further help: brew commands brew help [COMMAND] man brew https://docs.brew.sh
常用工具安装
在终端(Terminal)中执行如下命令,安装一些常用的软件包和工具。
brew install cmake protobuf rust python@3.10 git wget
终端会开始执行命令,并显示安装进度。这些命令将安装以下软件包和工具:
- cmake:用于编译和构建软件的工具;
- protobuf:Google Protocol Buffers,一种高效的序列化数据格式;
- rust:一种系统级编程语言,用于开发高性能和安全的软件;
- python@3.10:Python 3.10 版本;
- git:版本控制系统,用于协作开发和管理代码;
- wget:用于从 Web 上下载文件的工具。
安装日志
yufeng@LYF_MacBook ~ % brew install cmake protobuf rust python@3.10 git wget Warning: Treating cmake as a formula. For the cask, use homebrew/cask/cmake ==> Fetching cmake ==> Downloading https://ghcr.io/v2/homebrew/core/cmake/manifests/3.26.3 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/cmake/blobs/sha256:9a01063acf50 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching protobuf ==> Downloading https://ghcr.io/v2/homebrew/core/protobuf/manifests/21.12-2 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/protobuf/blobs/sha256:09fdc2fcc ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching dependencies for rust: ca-certificates, openssl@3 and pkg-config ==> Fetching ca-certificates ==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/manifests/2023- ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/blobs/sha256:11 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching openssl@3 ==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/manifests/3.1.0 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/blobs/sha256:1dd3c96c ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching pkg-config ==> Downloading https://ghcr.io/v2/homebrew/core/pkg-config/manifests/0.29.2_3 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/pkg-config/blobs/sha256:3ff612c ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching rust ==> Downloading https://ghcr.io/v2/homebrew/core/rust/manifests/1.69.0 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/rust/blobs/sha256:0ca792a1dc621 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching dependencies for python@3.10: gdbm, mpdecimal, openssl@1.1, readline, sqlite and xz ==> Fetching gdbm ==> Downloading https://ghcr.io/v2/homebrew/core/gdbm/manifests/1.23 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/gdbm/blobs/sha256:a7321472cc9ff ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching mpdecimal ==> Downloading https://ghcr.io/v2/homebrew/core/mpdecimal/manifests/2.5.1 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/mpdecimal/blobs/sha256:5b1c62c0 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching openssl@1.1 ==> Downloading https://ghcr.io/v2/homebrew/core/openssl/1.1/manifests/1.1.1t ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/openssl/1.1/blobs/sha256:e1e08d ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching readline ==> Downloading https://ghcr.io/v2/homebrew/core/readline/manifests/8.2.1 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/readline/blobs/sha256:fba42a9bd ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching sqlite ==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/manifests/3.41.2 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/blobs/sha256:2a77f2ddcf1 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching xz ==> Downloading https://ghcr.io/v2/homebrew/core/xz/manifests/5.4.2 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/xz/blobs/sha256:5919a39bb56458a ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching python@3.10 ==> Downloading https://ghcr.io/v2/homebrew/core/python/3.10/manifests/3.10.11 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/python/3.10/blobs/sha256:7821f3 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching dependencies for git: gettext and pcre2 ==> Fetching gettext ==> Downloading https://ghcr.io/v2/homebrew/core/gettext/manifests/0.21.1 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/gettext/blobs/sha256:28c5b06e66 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching pcre2 ==> Downloading https://ghcr.io/v2/homebrew/core/pcre2/manifests/10.42 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/pcre2/blobs/sha256:8423a338c590 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching git ==> Downloading https://ghcr.io/v2/homebrew/core/git/manifests/2.40.1 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/git/blobs/sha256:df2e65dfd20e76 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching dependencies for wget: libunistring and libidn2 ==> Fetching libunistring ==> Downloading https://ghcr.io/v2/homebrew/core/libunistring/manifests/1.1 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/libunistring/blobs/sha256:c78e7 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching libidn2 ==> Downloading https://ghcr.io/v2/homebrew/core/libidn2/manifests/2.3.4_1-1 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/libidn2/blobs/sha256:b044c66cc0 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching wget ==> Downloading https://ghcr.io/v2/homebrew/core/wget/manifests/1.21.3_1-1 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/wget/blobs/sha256:7415a3b847237 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Pouring cmake--3.26.3.arm64_ventura.bottle.tar.gz ==> Caveats To install the CMake documentation, run: brew install cmake-docs Emacs Lisp files have been installed to: /opt/homebrew/share/emacs/site-lisp/cmake ==> Summary 🍺 /opt/homebrew/Cellar/cmake/3.26.3: 3,188 files, 46.4MB ==> Running `brew cleanup cmake`... Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). ==> Pouring protobuf--21.12.arm64_ventura.bottle.2.tar.gz ==> Caveats Emacs Lisp files have been installed to: /opt/homebrew/share/emacs/site-lisp/protobuf ==> Summary 🍺 /opt/homebrew/Cellar/protobuf/21.12: 288 files, 19.2MB ==> Running `brew cleanup protobuf`... ==> Installing dependencies for rust: ca-certificates, openssl@3 and pkg-config ==> Installing rust dependency: ca-certificates ==> Pouring ca-certificates--2023-01-10.all.bottle.tar.gz ==> Regenerating CA certificate bundle from keychain, this may take a while... 🍺 /opt/homebrew/Cellar/ca-certificates/2023-01-10: 3 files, 216.9KB ==> Installing rust dependency: openssl@3 ==> Pouring openssl@3--3.1.0.arm64_ventura.bottle.tar.gz ==> Downloading https://formulae.brew.sh/api/formula.jws.json -#O=# # # 🍺 /opt/homebrew/Cellar/openssl@3/3.1.0: 6,494 files, 28.4MB ==> Installing rust dependency: pkg-config ==> Pouring pkg-config--0.29.2_3.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/pkg-config/0.29.2_3: 11 files, 676.2KB ==> Installing rust ==> Pouring rust--1.69.0.arm64_ventura.bottle.tar.gz ==> Caveats zsh completions have been installed to: /opt/homebrew/share/zsh/site-functions ==> Summary 🍺 /opt/homebrew/Cellar/rust/1.69.0: 36,769 files, 878MB ==> Running `brew cleanup rust`... ==> Installing dependencies for python@3.10: gdbm, mpdecimal, openssl@1.1, readline, sqlite and xz ==> Installing python@3.10 dependency: gdbm ==> Pouring gdbm--1.23.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/gdbm/1.23: 24 files, 1MB ==> Installing python@3.10 dependency: mpdecimal ==> Pouring mpdecimal--2.5.1.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/mpdecimal/2.5.1: 71 files, 2.2MB ==> Installing python@3.10 dependency: openssl@1.1 ==> Pouring openssl@1.1--1.1.1t.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/openssl@1.1/1.1.1t: 8,101 files, 18MB ==> Installing python@3.10 dependency: readline ==> Pouring readline--8.2.1.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/readline/8.2.1: 50 files, 1.7MB ==> Installing python@3.10 dependency: sqlite ==> Pouring sqlite--3.41.2.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/sqlite/3.41.2: 11 files, 4.5MB ==> Installing python@3.10 dependency: xz ==> Pouring xz--5.4.2.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/xz/5.4.2: 162 files, 2.5MB ==> Installing python@3.10 ==> Pouring python@3.10--3.10.11.arm64_ventura.bottle.tar.gz ==> /opt/homebrew/Cellar/python@3.10/3.10.11/bin/python3.10 -m ensurepip ==> /opt/homebrew/Cellar/python@3.10/3.10.11/bin/python3.10 -m pip install -v --no-deps --no-index --upgrade --isolated --target=/opt/homebrew/lib/python3.10/site-packages /opt/homebrew/Cellar/python@3.10 ==> Caveats Python has been installed as /opt/homebrew/bin/python3.10 Unversioned and major-versioned symlinks `python`, `python3`, `python-config`, `python3-config`, `pip`, `pip3`, etc. pointing to `python3.10`, `python3.10-config`, `pip3.10` etc., respectively, have been installed into /opt/homebrew/opt/python@3.10/libexec/bin You can install Python packages with pip3.10 install <package> They will install into the site-package directory /opt/homebrew/lib/python3.10/site-packages tkinter is no longer included with this formula, but it is available separately: brew install python-tk@3.10 If you do not need a specific version of Python, and always want Homebrew's `python3` in your PATH: brew install python3 See: https://docs.brew.sh/Homebrew-and-Python ==> Summary 🍺 /opt/homebrew/Cellar/python@3.10/3.10.11: 3,099 files, 57.2MB ==> Running `brew cleanup python@3.10`... ==> Installing dependencies for git: gettext and pcre2 ==> Installing git dependency: gettext ==> Pouring gettext--0.21.1.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/gettext/0.21.1: 1,983 files, 20.9MB ==> Installing git dependency: pcre2 ==> Pouring pcre2--10.42.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/pcre2/10.42: 230 files, 6.2MB ==> Installing git ==> Pouring git--2.40.1.arm64_ventura.bottle.tar.gz ==> Caveats The Tcl/Tk GUIs (e.g. gitk, git-gui) are now in the `git-gui` formula. Subversion interoperability (git-svn) is now in the `git-svn` formula. zsh completions and functions have been installed to: /opt/homebrew/share/zsh/site-functions ==> Summary 🍺 /opt/homebrew/Cellar/git/2.40.1: 1,635 files, 48.9MB ==> Running `brew cleanup git`... ==> Installing dependencies for wget: libunistring and libidn2 ==> Installing wget dependency: libunistring ==> Pouring libunistring--1.1.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/libunistring/1.1: 56 files, 5.0MB ==> Installing wget dependency: libidn2 ==> Pouring libidn2--2.3.4_1.arm64_ventura.bottle.1.tar.gz 🍺 /opt/homebrew/Cellar/libidn2/2.3.4_1: 79 files, 1MB ==> Installing wget ==> Pouring wget--1.21.3_1.arm64_ventura.bottle.1.tar.gz 🍺 /opt/homebrew/Cellar/wget/1.21.3_1: 89 files, 4.2MB ==> Running `brew cleanup wget`... ==> Caveats ==> cmake To install the CMake documentation, run: brew install cmake-docs Emacs Lisp files have been installed to: /opt/homebrew/share/emacs/site-lisp/cmake ==> protobuf Emacs Lisp files have been installed to: /opt/homebrew/share/emacs/site-lisp/protobuf ==> rust zsh completions have been installed to: /opt/homebrew/share/zsh/site-functions ==> python@3.10 Python has been installed as /opt/homebrew/bin/python3.10 Unversioned and major-versioned symlinks `python`, `python3`, `python-config`, `python3-config`, `pip`, `pip3`, etc. pointing to `python3.10`, `python3.10-config`, `pip3.10` etc., respectively, have been installed into /opt/homebrew/opt/python@3.10/libexec/bin You can install Python packages with pip3.10 install <package> They will install into the site-package directory /opt/homebrew/lib/python3.10/site-packages tkinter is no longer included with this formula, but it is available separately: brew install python-tk@3.10 If you do not need a specific version of Python, and always want Homebrew's `python3` in your PATH: brew install python3 See: https://docs.brew.sh/Homebrew-and-Python ==> git The Tcl/Tk GUIs (e.g. gitk, git-gui) are now in the `git-gui` formula. Subversion interoperability (git-svn) is now in the `git-svn` formula. zsh completions and functions have been installed to: /opt/homebrew/share/zsh/site-functions yufeng@LYF_MacBook ~ %
至此,我们已经完成了一半。
Stable Diffusion
执行如下命令,自动下载Stable Diffusion WebUI
的资源至本机。
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
以下是安装日志,等待完成即可。
yufeng@LYF_MacBook ~ % git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git Cloning into 'stable-diffusion-webui'... remote: Enumerating objects: 18966, done. remote: Counting objects: 100% (563/563), done. remote: Compressing objects: 100% (233/233), done. remote: Total 18966 (delta 352), reused 493 (delta 330), pack-reused 18403 Receiving objects: 100% (18966/18966), 28.90 MiB | 10.94 MiB/s, done. Resolving deltas: 100% (13220/13220), done. yufeng@LYF_MacBook ~ %
此时执行如下命令,将会自动打开Stable Diffusion WebUI
的上级目录。
以下内容是open
+空格
+.
,然后按下回车
键,建议直接复制执行,不要自动输入,很容易搞错,比如中文符号,忘记输入空格之类的。
open .
下载模型
我们此时需要先安装Stable Diffusion WebUI
的模型,关于模型下载部分,请【点击这里】前往下载地址,下载自己需要的模型即可。
⚠️注意:与Windows大同小异,本站的模型存放路径为/Users/用户名/stable-diffusion-webui/models
。
依赖安装
此时我们需要将终端中的路径指定为Stable Diffusion WebUI
的文件夹目录,执行如下代码即可。
cd stable-diffusion-webui
执行如下代码,将会在终端内尝试运行Stable Diffusion WebUI
,并且自动创建和激活Python虚拟环境,自动下载并安装任何剩余的缺失依赖项。
./webui.sh
执行完上述命令之后,安装的过程日志如下:
yufeng@LYF_MacBook stable-diffusion-webui % ./webui.sh ################################################################ Install script for stable-diffusion + Web UI Tested on Debian 11 (Bullseye) ################################################################ ################################################################ Running on yufeng user ################################################################ ################################################################ Repo already cloned, using it as install directory ################################################################ ################################################################ Create and activate python venv ################################################################ ################################################################ Launching launch.py... ################################################################ Python 3.10.11 (main, Apr 7 2023, 07:24:53) [Clang 14.0.0 (clang-1400.0.29.202)] Commit hash: 5ab7f213bec2f816f9c5644becb32eb72c8ffb89 Installing torch and torchvision Collecting torch Downloading torch-2.0.0-cp310-none-macosx_11_0_arm64.whl (55.8 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.8/55.8 MB 16.6 MB/s eta 0:00:00 Collecting torchvision Downloading torchvision-0.15.1-cp310-cp310-macosx_11_0_arm64.whl (1.4 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.4/1.4 MB 21.8 MB/s eta 0:00:00 Collecting jinja2 Downloading Jinja2-3.1.2-py3-none-any.whl (133 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.1/133.1 kB 9.9 MB/s eta 0:00:00 Collecting filelock Downloading filelock-3.12.0-py3-none-any.whl (10 kB) Collecting sympy Downloading sympy-1.11.1-py3-none-any.whl (6.5 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.5/6.5 MB 20.1 MB/s eta 0:00:00 Collecting typing-extensions Downloading typing_extensions-4.5.0-py3-none-any.whl (27 kB) Collecting networkx Downloading networkx-3.1-py3-none-any.whl (2.1 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 20.2 MB/s eta 0:00:00 Collecting pillow!=8.3.*,>=5.3.0 Downloading Pillow-9.5.0-cp310-cp310-macosx_11_0_arm64.whl (3.1 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.1/3.1 MB 21.6 MB/s eta 0:00:00 Collecting requests Downloading requests-2.29.0-py3-none-any.whl (62 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.5/62.5 kB 6.4 MB/s eta 0:00:00 Collecting numpy Downloading numpy-1.24.3-cp310-cp310-macosx_11_0_arm64.whl (13.9 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.9/13.9 MB 20.7 MB/s eta 0:00:00 Collecting MarkupSafe>=2.0 Downloading MarkupSafe-2.1.2-cp310-cp310-macosx_10_9_universal2.whl (17 kB) Collecting idna<4,>=2.5 Downloading idna-3.4-py3-none-any.whl (61 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB 6.0 MB/s eta 0:00:00 Collecting urllib3<1.27,>=1.21.1 Downloading urllib3-1.26.15-py2.py3-none-any.whl (140 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.9/140.9 kB 14.4 MB/s eta 0:00:00 Collecting certifi>=2017.4.17 Downloading certifi-2022.12.7-py3-none-any.whl (155 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 kB 17.6 MB/s eta 0:00:00 Collecting charset-normalizer<4,>=2 Downloading charset_normalizer-3.1.0-cp310-cp310-macosx_11_0_arm64.whl (123 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 123.0/123.0 kB 12.9 MB/s eta 0:00:00 Collecting mpmath>=0.19 Downloading mpmath-1.3.0-py3-none-any.whl (536 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 536.2/536.2 kB 18.3 MB/s eta 0:00:00 Installing collected packages: mpmath, urllib3, typing-extensions, sympy, pillow, numpy, networkx, MarkupSafe, idna, filelock, charset-normalizer, certifi, requests, jinja2, torch, torchvision Successfully installed MarkupSafe-2.1.2 certifi-2022.12.7 charset-normalizer-3.1.0 filelock-3.12.0 idna-3.4 jinja2-3.1.2 mpmath-1.3.0 networkx-3.1 numpy-1.24.3 pillow-9.5.0 requests-2.29.0 sympy-1.11.1 torch-2.0.0 torchvision-0.15.1 typing-extensions-4.5.0 urllib3-1.26.15 [notice] A new release of pip is available: 23.0.1 -> 23.1.2 [notice] To update, run: pip install --upgrade pip Installing gfpgan Installing clip Installing open_clip Cloning Stable Diffusion into /Users/yufeng/stable-diffusion-webui/repositories/stable-diffusion-stability-ai... Cloning Taming Transformers into /Users/yufeng/stable-diffusion-webui/repositories/taming-transformers... Cloning K-diffusion into /Users/yufeng/stable-diffusion-webui/repositories/k-diffusion... Cloning CodeFormer into /Users/yufeng/stable-diffusion-webui/repositories/CodeFormer... Cloning BLIP into /Users/yufeng/stable-diffusion-webui/repositories/BLIP... Installing requirements for CodeFormer Installing requirements Launching Web UI with arguments: --skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled No module 'xformers'. Proceeding without it. Calculating sha256 for /Users/yufeng/stable-diffusion-webui/models/Stable-diffusion/chilloutmix_Ni.safetensors: 7234b76e423f010b409268386062a4111c0da6adebdf3a9b1a825937bdf17683 Loading weights [7234b76e42] from /Users/yufeng/stable-diffusion-webui/models/Stable-diffusion/chilloutmix_Ni.safetensors Creating model from config: /Users/yufeng/stable-diffusion-webui/configs/v1-inference.yaml LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 859.52 M params. Downloading (…)olve/main/vocab.json: 100%|███| 961k/961k [00:00<00:00, 1.04MB/s] Downloading (…)olve/main/merges.txt: 100%|███| 525k/525k [00:00<00:00, 2.44MB/s] Downloading (…)cial_tokens_map.json: 100%|█████| 389/389 [00:00<00:00, 2.05MB/s] Downloading (…)okenizer_config.json: 100%|█████| 905/905 [00:00<00:00, 3.16MB/s] Downloading (…)lve/main/config.json: 100%|█| 4.52k/4.52k [00:00<00:00, 6.38MB/s] Applying cross attention optimization (InvokeAI). Textual inversion embeddings loaded(0): Model loaded in 25.0s (calculate hash: 4.3s, load weights from disk: 0.4s, create model: 5.6s, apply weights to model: 12.4s, apply half(): 1.4s, move model to device: 0.6s, load textual inversion embeddings: 0.2s). Running on local URL: http://127.0.0.1:7860 To create a public link, set `share=True` in `launch()`. Startup time: 29.5s (import torch: 0.9s, import gradio: 0.7s, import ldm: 0.3s, other imports: 1.7s, load scripts: 0.3s, load SD checkpoint: 25.0s, create ui: 0.4s).
至此,我们可以看到倒数第4行已经显示出了一串地址,地址为http://127.0.0.1:7860,我们不要关闭浏览器,复制这一串网址在浏览器中打开,将会看到如下界面:
我们可以看到使用界面啦,接下来测试一下出图效果和时间。
图像生成
我们只用最简单的关键字,居然耗时:36.14s
。
a woman Negative prompt: nsfw Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 154489734, Size: 512x512, Model hash: 7234b76e42, Model: chilloutmix_Ni
我们再尝试开启高清放大功能,共计耗时5m 56.38s
。
a woman Negative prompt: nsfw Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 154489734, Size: 512x512, Model hash: 7234b76e42, Model: chilloutmix_Ni, Denoising strength: 0.7, Hires upscale: 2, Hires upscaler: ESRGAN_4x
无法渲染
打开终端
,执行如下命令行,然后按下回车
键。
open ./stable-diffusion-webui
此时将会自动弹出stable-diffusion-webui
的项目文件夹,找到webui-user.sh
文件,鼠标右键
→打开方式
→文本编辑
打开。
找到#export COMMANDLINE_ARGS=""
这一行,
# Commandline arguments for webui.py, for example: export COMMANDLINE_ARGS="--medvram --opt-split-attention" #export COMMANDLINE_ARGS=""
我们修改#export COMMANDLINE_ARGS=""
的内容,删除#
号,后面添加--precision full --no-half
参数,修改后的内容如下,然后记得保存,重新运行。
export COMMANDLINE_ARGS="--medvram --opt-split-attention --skip-torch-cuda-test --no-half --use-cpuall"
修改完成后,记得保存文件。
总结
出图太慢了,如果只是随便玩玩还行,而且M芯片的MacBook Air款是没有内置风扇的,很容易发热。
哎,夜深人静看一遍,怎么这么多错别字!!
感谢站长的分享!
* [new tag] 4.0.6 -> 4.0.6
* [new tag] 4.0.7 -> 4.0.7
* [new tag] 4.0.8 -> 4.0.8
* [new tag] 4.0.9 -> 4.0.9
fatal: unable to access ‘https://github.com/Homebrew/brew/’: Recv failure: Operation timed out
Failed during: /usr/bin/git fetch –force –tags origin
iris@IrisxiaoxuandeMacBook-Pro ~ % /bin/bash -c “$(curl -fsSL https://cdn.jsdelivr.net/gh/Homebrew/install/install.sh)”
==> Checking for `sudo` access (which may request your password)…
Password:
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
Press RETURN/ENTER to continue or any other key to abort:
==> /usr/bin/sudo /usr/sbin/chown -R iris:admin /usr/local/Homebrew
==> Downloading and installing Homebrew…
HEAD is now at 83936df1c Merge pull request #15465 from reitermarkus/github-variables
fatal: unable to access ‘https://github.com/Homebrew/brew/’: Recv failure: Operation timed out
fatal: unable to access ‘https://github.com/Homebrew/brew/’: HTTP/2 stream 1 was not closed cleanly before end of the underlying stream
我在输入密码回车后出现这类文字,说无法访问网址,但是我自己复制网址打开网站是可以打开的~是哪里出了问题呢?我这边因为确定可以打开网址,所以重复操作了一次,还是显示无法打开网址。我有开魔法梯子呢~T.T这情况咋办啊~
@irisxx 是输入密码后,再回车后,出现的这类问题哈~感觉我刚刚表达的不够准确的样子。求帮帮
@irisxx fatal: unable to access ‘https://github.com/Homebrew/brew/’: HTTP/2 stream 1 was not closed cleanly before end of the underlying stream
Error: Fetching /usr/local/Homebrew failed!
Failed during: /usr/local/bin/brew update –force –quiet
最后又弹出两行文字。
@irisxx 尝试使用curl从指定的URL安装Homebrew,但是同样由于接收超时的错误而失败。
这是网络问题,不过,通过本站所提供的代理网站应该是可以直接安装的,实在不行的话,用手机热点试一下。
你好!请指教一下,Macos M1,下载懒人包到移动SSD里面,用终端打开文件目录进行依赖安装。到了 installing open_clip 后,没看到 Cloning Stable Diffusion,Cloning XXX 这些,直接到了 Installing requirements for CodeFormer 和 Installing requirements,最后卡在 Installing requirements 上面了。请问怎么解决?如果安装成功,SD能不能在移动SSD上面运行并利用它的空间呢?因为我mac基本没啥空间了,所以才想装到移动SSD上面。谢谢解答。
@Hong installing open_clip一般是最后安装的,requirements是最先安装的,这个顺序是对的,你所指的懒人包是什么?我没理解。
SD是可以安装在移动SSD上面的,只要情境路径设置正确就可以。
@PhiltreX 懒人包就是网上有人整理好的,直接用的话只需要让终端下载一点点东西就可以用的。我后来一步步解决了 installing requirements 的问题了。现在运行是可以运行,但是会出现下面一堆报错的。怎么解决这些报错的?
Python 3.10.11 (main, Apr 7 2023, 07:24:53) [Clang 14.0.0 (clang-1400.0.29.202)]
Version: v1.2.1-1-ge911f91e
Commit hash: e911f91ee13fcdbe3fa8ed0719cbf2f836113ab7
Installing requirements
Launching Web UI with arguments: –no-half –skip-torch-cuda-test
No module ‘xformers’. Proceeding without it.
Warning: caught exception ‘Torch not compiled with CUDA enabled’, memory monitor disabled
reading checkpoint metadata: /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Stable-diffusion/._chilloutmix_Ni.safetensors: AssertionError
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/sd_models.py”, line 62, in __init__
self.metadata = read_metadata_from_safetensors(filename)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/sd_models.py”, line 232, in read_metadata_from_safetensors
assert metadata_len > 2 and json_start in (b'{“‘, b”{‘”), f”{filename} is not a safetensors file”
AssertionError: /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Stable-diffusion/._chilloutmix_Ni.safetensors is not a safetensors file
[AddNet] Updating model hashes…
0it [00:00, ?it/s]
[AddNet] Updating model hashes…
0it [00:00, ?it/s]
Error loading script: ._adapter.py
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/scripts.py”, line 257, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/script_loading.py”, line 11, in load_module
module_spec.loader.exec_module(module)
File “”, line 879, in exec_module
File “”, line 1017, in get_code
File “”, line 947, in source_to_code
File “”, line 241, in _call_with_frames_removed
ValueError: source code string cannot contain null bytes
Error loading script: ._api.py
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/scripts.py”, line 257, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/script_loading.py”, line 11, in load_module
module_spec.loader.exec_module(module)
File “”, line 879, in exec_module
File “”, line 1017, in get_code
File “”, line 947, in source_to_code
File “”, line 241, in _call_with_frames_removed
ValueError: source code string cannot contain null bytes
Error loading script: ._batch_hijack.py
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/scripts.py”, line 257, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/script_loading.py”, line 11, in load_module
module_spec.loader.exec_module(module)
File “”, line 879, in exec_module
File “”, line 1017, in get_code
File “”, line 947, in source_to_code
File “”, line 241, in _call_with_frames_removed
ValueError: source code string cannot contain null bytes
Error loading script: ._cldm.py
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/scripts.py”, line 257, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/script_loading.py”, line 11, in load_module
module_spec.loader.exec_module(module)
File “”, line 879, in exec_module
File “”, line 1017, in get_code
File “”, line 947, in source_to_code
File “”, line 241, in _call_with_frames_removed
ValueError: source code string cannot contain null bytes
Error loading script: ._controlnet.py
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/scripts.py”, line 257, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/script_loading.py”, line 11, in load_module
module_spec.loader.exec_module(module)
File “”, line 879, in exec_module
File “”, line 1017, in get_code
File “”, line 947, in source_to_code
File “”, line 241, in _call_with_frames_removed
ValueError: source code string cannot contain null bytes
Error loading script: ._controlnet_version.py
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/scripts.py”, line 257, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/script_loading.py”, line 11, in load_module
module_spec.loader.exec_module(module)
File “”, line 879, in exec_module
File “”, line 1017, in get_code
File “”, line 947, in source_to_code
File “”, line 241, in _call_with_frames_removed
ValueError: source code string cannot contain null bytes
Error loading script: ._external_code.py
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/scripts.py”, line 257, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/script_loading.py”, line 11, in load_module
module_spec.loader.exec_module(module)
File “”, line 879, in exec_module
File “”, line 1017, in get_code
File “”, line 947, in source_to_code
File “”, line 241, in _call_with_frames_removed
ValueError: source code string cannot contain null bytes
Error loading script: ._global_state.py
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/scripts.py”, line 257, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/script_loading.py”, line 11, in load_module
module_spec.loader.exec_module(module)
File “”, line 879, in exec_module
File “”, line 1017, in get_code
File “”, line 947, in source_to_code
File “”, line 241, in _call_with_frames_removed
ValueError: source code string cannot contain null bytes
Error loading script: ._hook.py
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/scripts.py”, line 257, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/script_loading.py”, line 11, in load_module
module_spec.loader.exec_module(module)
File “”, line 879, in exec_module
File “”, line 1017, in get_code
File “”, line 947, in source_to_code
File “”, line 241, in _call_with_frames_removed
ValueError: source code string cannot contain null bytes
Error loading script: ._lvminthin.py
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/scripts.py”, line 257, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/script_loading.py”, line 11, in load_module
module_spec.loader.exec_module(module)
File “”, line 879, in exec_module
File “”, line 1017, in get_code
File “”, line 947, in source_to_code
File “”, line 241, in _call_with_frames_removed
ValueError: source code string cannot contain null bytes
Error loading script: ._movie2movie.py
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/scripts.py”, line 257, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/script_loading.py”, line 11, in load_module
module_spec.loader.exec_module(module)
File “”, line 879, in exec_module
File “”, line 1017, in get_code
File “”, line 947, in source_to_code
File “”, line 241, in _call_with_frames_removed
ValueError: source code string cannot contain null bytes
Error loading script: ._processor.py
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/scripts.py”, line 257, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/script_loading.py”, line 11, in load_module
module_spec.loader.exec_module(module)
File “”, line 879, in exec_module
File “”, line 1017, in get_code
File “”, line 947, in source_to_code
File “”, line 241, in _call_with_frames_removed
ValueError: source code string cannot contain null bytes
Error loading script: ._utils.py
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/scripts.py”, line 257, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/script_loading.py”, line 11, in load_module
module_spec.loader.exec_module(module)
File “”, line 879, in exec_module
File “”, line 1017, in get_code
File “”, line 947, in source_to_code
File “”, line 241, in _call_with_frames_removed
ValueError: source code string cannot contain null bytes
Error loading script: ._xyz_grid_support.py
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/scripts.py”, line 257, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/script_loading.py”, line 11, in load_module
module_spec.loader.exec_module(module)
File “”, line 879, in exec_module
File “”, line 1017, in get_code
File “”, line 947, in source_to_code
File “”, line 241, in _call_with_frames_removed
ValueError: source code string cannot contain null bytes
ControlNet v1.1.101
ControlNet v1.1.101
Image Browser: ImageReward is not installed, cannot be used.
reading lora /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._breastinclassBetter_v13.safetensors: AssertionError
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/extensions-builtin/Lora/lora.py”, line 84, in __init__
self.metadata = sd_models.read_metadata_from_safetensors(filename)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/sd_models.py”, line 232, in read_metadata_from_safetensors
assert metadata_len > 2 and json_start in (b'{“‘, b”{‘”), f”{filename} is not a safetensors file”
AssertionError: /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._breastinclassBetter_v13.safetensors is not a safetensors file
reading lora /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._bronyaZaychikSilverwingNEX_v09.safetensors: AssertionError
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/extensions-builtin/Lora/lora.py”, line 84, in __init__
self.metadata = sd_models.read_metadata_from_safetensors(filename)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/sd_models.py”, line 232, in read_metadata_from_safetensors
assert metadata_len > 2 and json_start in (b'{“‘, b”{‘”), f”{filename} is not a safetensors file”
AssertionError: /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._bronyaZaychikSilverwingNEX_v09.safetensors is not a safetensors file
reading lora /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._chilloutmixss_xss10.safetensors: AssertionError
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/extensions-builtin/Lora/lora.py”, line 84, in __init__
self.metadata = sd_models.read_metadata_from_safetensors(filename)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/sd_models.py”, line 232, in read_metadata_from_safetensors
assert metadata_len > 2 and json_start in (b'{“‘, b”{‘”), f”{filename} is not a safetensors file”
AssertionError: /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._chilloutmixss_xss10.safetensors is not a safetensors file
reading lora /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._inniesBetterVaginas_v11.safetensors: AssertionError
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/extensions-builtin/Lora/lora.py”, line 84, in __init__
self.metadata = sd_models.read_metadata_from_safetensors(filename)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/sd_models.py”, line 232, in read_metadata_from_safetensors
assert metadata_len > 2 and json_start in (b'{“‘, b”{‘”), f”{filename} is not a safetensors file”
AssertionError: /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._inniesBetterVaginas_v11.safetensors is not a safetensors file
reading lora /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._koreanDollLikeness_v15.safetensors: AssertionError
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/extensions-builtin/Lora/lora.py”, line 84, in __init__
self.metadata = sd_models.read_metadata_from_safetensors(filename)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/sd_models.py”, line 232, in read_metadata_from_safetensors
assert metadata_len > 2 and json_start in (b'{“‘, b”{‘”), f”{filename} is not a safetensors file”
AssertionError: /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._koreanDollLikeness_v15.safetensors is not a safetensors file
reading lora /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._Moxin_1010.safetensors: AssertionError
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/extensions-builtin/Lora/lora.py”, line 84, in __init__
self.metadata = sd_models.read_metadata_from_safetensors(filename)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/sd_models.py”, line 232, in read_metadata_from_safetensors
assert metadata_len > 2 and json_start in (b'{“‘, b”{‘”), f”{filename} is not a safetensors file”
AssertionError: /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._Moxin_1010.safetensors is not a safetensors file
reading lora /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._nazunaNanakusaCallOfThe_offset.safetensors: AssertionError
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/extensions-builtin/Lora/lora.py”, line 84, in __init__
self.metadata = sd_models.read_metadata_from_safetensors(filename)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/sd_models.py”, line 232, in read_metadata_from_safetensors
assert metadata_len > 2 and json_start in (b'{“‘, b”{‘”), f”{filename} is not a safetensors file”
AssertionError: /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._nazunaNanakusaCallOfThe_offset.safetensors is not a safetensors file
reading lora /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._povSquattingCowgirlLora_pscowgirl.safetensors: AssertionError
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/extensions-builtin/Lora/lora.py”, line 84, in __init__
self.metadata = sd_models.read_metadata_from_safetensors(filename)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/sd_models.py”, line 232, in read_metadata_from_safetensors
assert metadata_len > 2 and json_start in (b'{“‘, b”{‘”), f”{filename} is not a safetensors file”
AssertionError: /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._povSquattingCowgirlLora_pscowgirl.safetensors is not a safetensors file
reading lora /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._saikaKawakita_saikaV20.safetensors: AssertionError
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/extensions-builtin/Lora/lora.py”, line 84, in __init__
self.metadata = sd_models.read_metadata_from_safetensors(filename)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/sd_models.py”, line 232, in read_metadata_from_safetensors
assert metadata_len > 2 and json_start in (b'{“‘, b”{‘”), f”{filename} is not a safetensors file”
AssertionError: /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._saikaKawakita_saikaV20.safetensors is not a safetensors file
reading lora /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._samdoesartsSamYang_offsetRightFilesize.safetensors: AssertionError
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/extensions-builtin/Lora/lora.py”, line 84, in __init__
self.metadata = sd_models.read_metadata_from_safetensors(filename)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/sd_models.py”, line 232, in read_metadata_from_safetensors
assert metadata_len > 2 and json_start in (b'{“‘, b”{‘”), f”{filename} is not a safetensors file”
AssertionError: /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._samdoesartsSamYang_offsetRightFilesize.safetensors is not a safetensors file
reading lora /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._studioGhibliStyle_offset.safetensors: AssertionError
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/extensions-builtin/Lora/lora.py”, line 84, in __init__
self.metadata = sd_models.read_metadata_from_safetensors(filename)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/sd_models.py”, line 232, in read_metadata_from_safetensors
assert metadata_len > 2 and json_start in (b'{“‘, b”{‘”), f”{filename} is not a safetensors file”
AssertionError: /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._studioGhibliStyle_offset.safetensors is not a safetensors file
reading lora /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._taiwanDollLikeness_v10.safetensors: AssertionError
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/extensions-builtin/Lora/lora.py”, line 84, in __init__
self.metadata = sd_models.read_metadata_from_safetensors(filename)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/sd_models.py”, line 232, in read_metadata_from_safetensors
assert metadata_len > 2 and json_start in (b'{“‘, b”{‘”), f”{filename} is not a safetensors file”
AssertionError: /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._taiwanDollLikeness_v10.safetensors is not a safetensors file
reading lora /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._yaeMikoRealistic_yaemikoMixed.safetensors: AssertionError
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/extensions-builtin/Lora/lora.py”, line 84, in __init__
self.metadata = sd_models.read_metadata_from_safetensors(filename)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/sd_models.py”, line 232, in read_metadata_from_safetensors
assert metadata_len > 2 and json_start in (b'{“‘, b”{‘”), f”{filename} is not a safetensors file”
AssertionError: /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._yaeMikoRealistic_yaemikoMixed.safetensors is not a safetensors file
reading lora /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._yorBriarSpyFamily_lykonV1.safetensors: AssertionError
Traceback (most recent call last):
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/extensions-builtin/Lora/lora.py”, line 84, in __init__
self.metadata = sd_models.read_metadata_from_safetensors(filename)
File “/Volumes/SanDisk SSD/SD/stable-diffusion-webui/modules/sd_models.py”, line 232, in read_metadata_from_safetensors
assert metadata_len > 2 and json_start in (b'{“‘, b”{‘”), f”{filename} is not a safetensors file”
AssertionError: /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Lora/._yorBriarSpyFamily_lykonV1.safetensors is not a safetensors file
Loading weights [7234b76e42] from /Volumes/SanDisk SSD/SD/stable-diffusion-webui/models/Stable-diffusion/chilloutmix_Ni.safetensors
Creating model from config: /Volumes/SanDisk SSD/SD/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Running on local URL: http://127.0.0.1:7860
To create a public link, set `share=True` in `launch()`.
Startup time: 3.9s (import torch: 0.6s, import gradio: 0.6s, import ldm: 0.3s, other imports: 0.5s, load scripts: 0.6s, extra networks: 0.1s, create ui: 0.8s).
Applying cross attention optimization (InvokeAI).
Textual inversion embeddings loaded(0):
Model loaded in 3.9s (load weights from disk: 0.4s, create model: 0.8s, apply weights to model: 0.5s, move model to device: 2.1s).
@Hong 大概看了一下你的报错,这真的是根据Macos部署的吗?你下载的是不是Windows包啊?怎么感觉看起来怪怪的,建议自行部署,不要用一键,问题非常非常多。
大佬好,请教下 第一次运行成功了 但是在执行渲染的时候 不确认是不是模型还是保存路径有问题,导致无法执行 关闭后重新./webui.sh 启动时,一直报错:launch.py: error: unrecognized arguments: –use-cpuall 这个是什么原因呢?
@命里 这个错误信息表示在执行 launch.py 脚本时,有一个无法识别的参数 –use-cpuall。这个问题可能是由于参数名称的输入错误或脚本中缺少对应的参数处理。
你是不是修改launch.py的脚本内容了?
@PhiltreX 应该是–use-cpu all
Stable diffusion model failed to load
Loading weights [eadad14576] from /Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/models/Stable-diffusion/iu_V20.safetensors
Creating model from config: /Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/configs/v1-inference.yaml
changing setting sd_model_checkpoint to iu_V20.safetensors: OSError
Traceback (most recent call last):
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/modules/options.py”, line 165, in set
option.onchange()
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/modules/call_queue.py”, line 14, in f
res = func(*args, **kwargs)
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/modules/initialize_util.py”, line 181, in
shared.opts.onchange(“sd_model_checkpoint”, wrap_queued_call(lambda: sd_models.reload_model_weights()), call=False)
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/modules/sd_models.py”, line 977, in reload_model_weights
load_model(checkpoint_info, already_loaded_state_dict=state_dict)
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/modules/sd_models.py”, line 829, in load_model
sd_model = instantiate_from_config(sd_config.model, state_dict)
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/modules/sd_models.py”, line 775, in instantiate_from_config
return constructor(**params)
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/diffusion/ddpm.py”, line 563, in __init__
self.instantiate_cond_stage(cond_stage_config)
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/diffusion/ddpm.py”, line 630, in instantiate_cond_stage
model = instantiate_from_config(config)
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/util.py”, line 89, in instantiate_from_config
return get_obj_from_str(config[“target”])(**config.get(“params”, dict()))
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/modules/encoders/modules.py”, line 103, in __init__
self.tokenizer = CLIPTokenizer.from_pretrained(version)
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/venv/lib/python3.10/site-packages/transformers/tokenization_utils_base.py”, line 1809, in from_pretrained
raise EnvironmentError(
OSError: Can’t load tokenizer for ‘openai/clip-vit-large-patch14’. If you were trying to load it from ‘https://huggingface.co/models’, make sure you don’t have a local directory with the same name. Otherwise, make sure ‘openai/clip-vit-large-patch14’ is the correct path to a directory containing all relevant files for a CLIPTokenizer tokenizer.
creating model quickly: OSError
Traceback (most recent call last):
File “/usr/local/Cellar/python@3.10/3.10.14/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py”, line 973, in _bootstrap
self._bootstrap_inner()
File “/usr/local/Cellar/python@3.10/3.10.14/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py”, line 1016, in _bootstrap_inner
self.run()
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py”, line 807, in run
result = context.run(func, *args)
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/utils.py”, line 707, in wrapper
response = f(*args, **kwargs)
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/modules/ui_extra_networks_checkpoints_user_metadata.py”, line 22, in update_vae
if name == shared.sd_model.sd_checkpoint_info.name_for_extra:
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/modules/shared_items.py”, line 175, in sd_model
return modules.sd_models.model_data.get_sd_model()
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/modules/sd_models.py”, line 693, in get_sd_model
load_model()
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/modules/sd_models.py”, line 820, in load_model
sd_model = instantiate_from_config(sd_config.model, state_dict)
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/modules/sd_models.py”, line 775, in instantiate_from_config
return constructor(**params)
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/diffusion/ddpm.py”, line 563, in __init__
self.instantiate_cond_stage(cond_stage_config)
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/models/diffusion/ddpm.py”, line 630, in instantiate_cond_stage
model = instantiate_from_config(config)
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/util.py”, line 89, in instantiate_from_config
return get_obj_from_str(config[“target”])(**config.get(“params”, dict()))
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/modules/encoders/modules.py”, line 103, in __init__
self.tokenizer = CLIPTokenizer.from_pretrained(version)
File “/Users/bc_rdsec_suning_li/PycharmProjects/Ai_auto/stable-diffusion-webui/venv/lib/python3.10/site-packages/transformers/tokenization_utils_base.py”, line 1809, in from_pretrained
raise EnvironmentError(
OSError: Can’t load tokenizer for ‘openai/clip-vit-large-patch14’. If you were trying to load it from ‘https://huggingface.co/models’, make sure you don’t have a local directory with the same name. Otherwise, make sure ‘openai/clip-vit-large-patch14’ is the correct path to a directory containing all relevant files for a CLIPTokenizer tokenizer.
伟大的站长,麻烦告诉我我该怎么办