MAC安装stable diffusion

 电脑配置 

基本安装

1. 安装python

2. 安装git

3. 下载stable diffusion的代码,地址:

git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui

执行命令

./webui.sh --precision full --no-half-vae --disable-nan-check --api

 

Command: "/Users/xxxx/aigc/stable-diffusion-webui/venv/bin/python3" -m pip install torch==2.0.1 torchvision==0.15.2

Error code: 2

执行命令:

pip install torch==2.0.1 torchvision==0.15.2 -i https://pypi.tuna.tsinghua.edu.cn/simple

设置pip源:

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

建议还是切换到:

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ 

任意文本编辑器打开webui根目录下的launch.py找到下列代码

gfpgan_package = os.environ.get('GFPGAN_PACKAGE', "git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379")

clip_package = os.environ.get('CLIP_PACKAGE', "git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1")

openclip_package = os.environ.get('OPENCLIP_PACKAGE', "git+https://github.com/mlfoundations/open_clip.git@bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b")

把那几个GitHub的源改成国内码云搬运的

gfpgan_package = os.environ.get('GFPGAN_PACKAGE', "git+https://gitee.com/gavinss1/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379")

clip_package = os.environ.get('CLIP_PACKAGE', "git+https://gitee.com/jerrylinkun/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1")

openclip_package = os.environ.get('OPENCLIP_PACKAGE', "git+https://gitee.com/ufhy/open_clip.git@bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b") 

错误:

stderr: ERROR: Could not find a version that satisfies the requirement tb-nightly (from versions: none)

ERROR: No matching distribution found for tb-nightly

发现这个错误直接切换pip源 

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ 

错误:

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.

Failed to create model quickly; will retry using slow method.

'(MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /openai/clip-vit-large-patch14/resolve/main/vocab.json (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x15b3d0310>, 'Connection to huggingface.co timed out. (connect timeout=10)'))"), '(Request ID: c9ab7798-16e9-4ede-84bf-5c72056cc4ca)')' thrown while requesting HEAD https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/vocab.json

这个错误是访问不了: huggingface.co; 需要科学上网

错误:

AttributeError: 'NoneType' object has no attribute 'cond_stage_model'

Exception in thread Thread-2:

Traceback (most recent call last):

  File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 980, in _bootstrap_inner

    self.run()

  File "/usr/local/Cellar/python@3.9/3.9.13_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 917, in run

    self._target(*self._args, **self._kwargs)

  File "/Users/xxxx/aigc/stable-diffusion-webui/modules/initialize.py", line 153, in load_model

    devices.first_time_calculation()

  File "/Users/xxxx/aigc/stable-diffusion-webui/modules/devices.py", line 148, in first_time_calculation

    linear(x)

  File "/Users/xxxx/aigc/stable-diffusion-webui/venv/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl

    return forward_call(*args, **kwargs)

  File "/Users/xxxx/aigc/stable-diffusion-webui/extensions-builtin/Lora/networks.py", line 429, in network_Linear_forward

    return originals.Linear_forward(self, input)

  File "/Users/xxxx/aigc/stable-diffusion-webui/venv/lib/python3.9/site-packages/torch/nn/modules/linear.py", line 114, in forward

    return F.linear(input, self.weight, self.bias)

RuntimeError: "addmm_impl_cpu_" not implemented for 'Half'

修改命令:

 ./webui.sh --precision full --no-half --no-half-vae --disable-nan-check --api

最后看看效果,没有特殊配置,效果不太好,但是说明整体能work了

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Stable Diffusion是一款修改Mac系统分辨率的工具,它可以让你增加Mac显示器的分辨率,把显示效果提高到更高的水平。但是在安装过程中,需要一些指导才能轻松完成。接下来我将详细介绍安装Stable Diffusion的步骤。 1.下载软件 首先,你需要从官方网站下载Stable Diffusion的最新版本,或从可信的第三方网站下载。一般情况下,你可以选择下载一个压缩包,解压后会得到一个.dmg文件。 2.安装软件 打开.dmg文件,你会看到软件图标和一个文本文件。将软件图标拖动到你的应用程序文件夹中,这样就完成了软件的安装。 3.打开软件 打开终端(“终端”在应用程序中),输入以下命令: sudo spctl --master-disable 按回车键后,终端会要求输入密码,输入密码后按回车键。这是为了关闭系统的安全措施,以便运行Stable Diffusion。然后,双击Stable Diffusion图标打开软件。 4.设置分辨率 打开软件后,你会看到一个简单的界面,显示屏幕的当前分辨率。现在点击“Apply Modified Resolution”按钮,软件会在列表中显示一系列增加的分辨率。选择一个你想要的分辨率并单击“Apply”按钮,你就可以看到屏幕分辨率发生了变化。 5.恢复安全措施 完成使用Stable Diffusion后,应该恢复Mac的安全措施。打开终端,输入以下命令: sudo spctl --master-enable 按回车键后,终端会再次要求输入密码,输入密码后按回车键。这样安全措施就重新生效了。 总之,通过上面的步骤,你就可以安装和使用Stable Diffusion了。但请注意,为了保证安全和稳定性,不要频繁改变显示分辨率。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值