New instructions for running web UI on macOS (check here for macOS related issues) #5461
Replies: 305 comments 830 replies
-
Hiyo, thanks so much for this! I'm happy to be a tester for this. I'm trying to get this setup on an M1 Max laptop; I removed a previous version that I'd installed with the "old" instructions (which didn't actually work; I had to do some file editing per this thread, which finally yielded a functional UI session). I removed all of that entirely and re-fetched the repo fresh following the above instructions. When I try to launch the UI now, I get:
I'm not sure this is relevant, but: I use Python via pyenv, and currently have it set up to use 3.10.0 (not 3.10.6, as the 'main' instructions suggest, nor 3.10.8, which is what I have working on a separate Windows machine). Would that impact this? FWIW, prior to this, I also ran into two other issues trying to create TI embeddings, which I mention here. |
Beta Was this translation helpful? Give feedback.
-
I'd say including this is pretty important for Apple Silicon Macs. |
Beta Was this translation helpful? Give feedback.
-
Much better instructions!
or something like that. I'm mentioning it only because I've read dozens of comments about people complaining about the space consumption issue. |
Beta Was this translation helpful? Give feedback.
-
Tried doing the "existing installation" instructions and got the following error after running webui.sh:
Tried deleting the repositories and venv directories as instructred. Response from git pull was "already up to date" and it died in the same place with the same error (not that I expected success at that point). Completely trashed everything and tried a fresh install. That worked, though I'm still getting the |
Beta Was this translation helpful? Give feedback.
-
The BIG problem that I'm noticing is that, in a given session, performance degrades incredibly after the first batch. More details here: #5488 |
Beta Was this translation helpful? Give feedback.
-
I do notice that this appears to be launching into python 3.9.12, rather than the 3.10.x preferred by Invoke-AI. This is confirmed by observing memory use in Activity Monitor. This is especially odd given that i have confirmed via the brew info command that the Homebrew version of python installed is 3.10 as well. So questions:
|
Beta Was this translation helpful? Give feedback.
-
Does anyone have any insight into what would cause the errors in the terminal below after launching './webui.sh'? I'm running a 2021 MacBook Pro 16" (10c/24c w/ 64GB of RAM) on Ventura 13.0.1. Had one issue before this where I was unable to access "https://github.com/TencentARC/GFPGAN.git/", so I did it manually and then it worked the next time. Have tried clearing 'repositories' and 'venv' but still getting the same message.
Edited for format |
Beta Was this translation helpful? Give feedback.
-
Just followed this guide today and everything worked great. One note, I installed homebrew fresh, but I didn't have next steps for adding Homebrew to my PATH. Perhaps I had already done that previously with homebrew. |
Beta Was this translation helpful? Give feedback.
-
Tried training an embedding and it fails instantly. Get this error in the terminal: Traceback (most recent call last): |
Beta Was this translation helpful? Give feedback.
-
so I removed my old install, and started afresh.
so I went over to hugging face, and tried to find one... now I get
I got similar issues with the 2.1 model. |
Beta Was this translation helpful? Give feedback.
-
failed on step 5, after run ./webui.sh log as following: Using legacy 'setup.py install' for gfpgan, since package 'wheel' is not installed. stderr: Running command git clone --filter=blob:none --quiet https://github.com/TencentARC/GFPGAN.git /private/var/folders/d_/nz3s4q253752_l7h14mcc6cc0000gn/T/pip-req-build-8moh8ytq × Running setup.py install for lmdb did not run successfully. note: This error originates from a subprocess, and is likely not a problem with pip. × Encountered error while trying to install package. note: This is an issue with the package mentioned above, not pip. |
Beta Was this translation helpful? Give feedback.
-
I am a completely non-technical person (a product manager) and I want to try out the tool to generate various images. I am wondering if anyone can provide instructions in layman's language with all (ALL, really) steps involved. I'd be more than happy to test, then create a document with screenshots and add various guides to the product. |
Beta Was this translation helpful? Give feedback.
-
Maybe include the patch for k_diffusion to get more samplers working. |
Beta Was this translation helpful? Give feedback.
-
I'm using MacOS 12.6.1
Even after successful installation of gfpgan, it will be stuck on clip, then open_clip (if clip fortunately installs, probably 1 our of 5 times). |
Beta Was this translation helpful? Give feedback.
-
I get the following issue on my M1 as for some reason where venv installs x86 packages while python and arch is set to "ARM64". Any pointers on cleaning up or making the environment work on M1 for arm64? Somehow install the missing arm64 version of the crypto lib.
Launching Web UI with arguments: --no-half --use-cpu interrogate
Traceback (most recent call last):
File "/Users/miksvenson/repos/stable-diffusion-webui/launch.py", line 295, in <module>
start()
File "/Users/miksvenson/repos/stable-diffusion-webui/launch.py", line 286, in start
import webui
File "/Users/miksvenson/repos/stable-diffusion-webui/webui.py", line 11, in <module>
from modules.call_queue import wrap_queued_call, queue_lock, wrap_gradio_gpu_call
File "/Users/miksvenson/repos/stable-diffusion-webui/modules/call_queue.py", line 7, in <module>
from modules import shared
File "/Users/miksvenson/repos/stable-diffusion-webui/modules/shared.py", line 8, in <module>
import gradio as gr
File "/Users/miksvenson/repos/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/__init__.py", line 3, in <module>
import gradio.components as components
File "/Users/miksvenson/repos/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/components.py", line 31, in <module>
from gradio import media_data, processing_utils, utils
File "/Users/miksvenson/repos/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/processing_utils.py", line 20, in <module>
from gradio import encryptor, utils
File "/Users/miksvenson/repos/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/encryptor.py", line 2, in <module>
from Crypto.Cipher import AES
File "/Users/miksvenson/repos/stable-diffusion-webui/venv/lib/python3.10/site-packages/Crypto/Cipher/__init__.py", line 27, in <module>
from Crypto.Cipher._mode_ecb import _create_ecb_cipher
File "/Users/miksvenson/repos/stable-diffusion-webui/venv/lib/python3.10/site-packages/Crypto/Cipher/_mode_ecb.py", line 35, in <module>
raw_ecb_lib = load_pycryptodome_raw_lib("Crypto.Cipher._raw_ecb", """
File "/Users/miksvenson/repos/stable-diffusion-webui/venv/lib/python3.10/site-packages/Crypto/Util/_raw_api.py", line 309, in load_pycryptodome_raw_lib
raise OSError("Cannot load native module '%s': %s" % (name, ", ".join(attempts)))
OSError: Cannot load native module 'Crypto.Cipher._raw_ecb': Not found '_raw_ecb.cpython-310-darwin.so', Cannot load '_raw_ecb.abi3.so': cannot load library '/Users/miksvenson/repos/stable-diffusion-webui/venv/lib/python3.10/site-packages/Crypto/Util/../Cipher/_raw_ecb.abi3.so': dlopen(/Users/miksvenson/repos/stable-diffusion-webui/venv/lib/python3.10/site-packages/Crypto/Util/../Cipher/_raw_ecb.abi3.so, 0x0002): tried: '/Users/miksvenson/repos/stable-diffusion-webui/venv/lib/python3.10/site-packages/Crypto/Util/../Cipher/_raw_ecb.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/miksvenson/repos/stable-diffusion-webui/venv/lib/python3.10/site-packages/Crypto/Util/../Cipher/_raw_ecb.abi3.so' (no such file), '/Users/miksvenson/repos/stable-diffusion-webui/venv/lib/python3.10/site-packages/Crypto/Util/../Cipher/_raw_ecb.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/Users/miksvenson/repos/stable-diffusion-webui/venv/lib/python3.10/site-packages/Crypto/Cipher/_raw_ecb.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/miksvenson/repos/stable-diffusion-webui/venv/lib/python3.10/site-packages/Crypto/Cipher/_raw_ecb.abi3.so' (no such file), '/Users/miksvenson/repos/stable-diffusion-webui/venv/lib/python3.10/site-packages/Crypto/Cipher/_raw_ecb.abi3.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')). Additionally, ctypes.util.find_library() did not manage to locate a library called '/Users/miksvenson/repos/stable-diffusion-webui/venv/lib/python3.10/site-packages/Crypto/Util/../Cipher/_raw_ecb.abi3.so', Not found '_raw_ecb.so' |
Beta Was this translation helpful? Give feedback.
-
Hi everyone, I get this after the first new installation. Tried re installing several times, rebooted my MacBook Pro (2021) Apple M1 Max Can you please help me ? thanks in advance Install script for stable-diffusion + Web UI Running on leonard user Repo already cloned, using it as install directory Create and activate python venv Launching launch.py. . . Python 3.10.14 (main, Mar 20 2024, 03:57:45) [Clang 14.0.0 (clang-1400.0.29.202)] You are running torch 2.1.0. Use --skip-version-check commandline argument to disable this check. Calculating sha256 for /Users/leonard/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.ckpt: Running on local URL: http://127.0.0.1:7860 To create a public link, set Applying attention optimization: InvokeAI... done. Stable diffusion model failed to load |
Beta Was this translation helpful? Give feedback.
-
I'm stuck at step 1, where it says "Keep the terminal window open and follow the instructions under "Next steps" to add Homebrew to your PATH." There were no instructions under "Next steps". I've installed on Apple Silicon Mac. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone, webui consistently fails to start on a new insrtall, did everything in the tutorial, twice
|
Beta Was this translation helpful? Give feedback.
-
Hi, I am trying to install this repository in my MacBook Air M2. I cloned, downloaded the model from here (https://huggingface.co/stabilityai/stable-diffusion-3-medium) and copied the model in the stability-diffusion folder for checkpoints. While running ./web-ui.sh I am always getting this error. Python 3.12.3 (v3.12.3:f6650f9ad7, Apr 9 2024, 08:18:47) [Clang 13.0.0 (clang-1300.0.29.30)]
Version: v1.9.4
Commit hash: feee37d75f1b168768014e4634dcb156ee649c05
Installing torch and torchvision
ERROR: Could not find a version that satisfies the requirement torch==2.1.0 (from versions: 2.2.0, 2.2.1, 2.2.2, 2.3.0, 2.3.1)
ERROR: No matching distribution found for torch==2.1.0 I know this repository has been built on 3.10 but I tried to use 3.12. However, it shows errors while installing PyTorch and I am not sure where to change this PyTorch configuration. Kindly help me :) |
Beta Was this translation helpful? Give feedback.
-
这是来自QQ邮箱的假期自动回复邮件。
您好,您的邮件已收到。我会在考到消息后第一时间回复您。若内容紧要,请电话通知我,以免耽误!谢谢!
|
Beta Was this translation helpful? Give feedback.
-
I'm using MacOS 14.5
note: This error originates from a subprocess, and is likely not a problem with pip. |
Beta Was this translation helpful? Give feedback.
-
When I tried to use the command ./webui.sh, the following error message appeared: ERROR: Could not install packages due to an OSError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/ab/6a/0debe1ec3c63b1fd7487ec7dd8fb1adf19898bef5a8dc151265d79ffd915/torch-2.1.0-cp310-none-macosx_11_0_arm64.whl (Caused by ProxyError('Cannot connect to proxy.', RemoteDisconnected('Remote end closed connection without response'))) Command: "/Users/huaiwanju/workfile/stable-diffusion-webui/venv/bin/python3.10" -m pip install torch==2.1.0 torchvision==0.16.0 Here is a part of the error message. I tried using a mirror, upgrading pip, changing the DNS, but all of them failed. I think this is not caused by network issues. Has anyone encountered such an issue? |
Beta Was this translation helpful? Give feedback.
-
我的浏览器不能打开这个链接,不过我通过浏览器上的vpn插件可以打开,我并不确定这个VPN能否对命令行的安装生效
…------------------ 原始邮件 ------------------
发件人: ***@***.***>;
发送时间: 2024年7月4日(星期四) 下午4:55
收件人: ***@***.***>;
抄送: "No Color ***@***.***>; ***@***.***>;
主题: Re: [AUTOMATIC1111/stable-diffusion-webui] New instructions for running web UI on macOS (check here for macOS related issues) (Discussion #5461)
基于该错误,您无法访问https://files.pythonhosted.org/
当Python安装包时,它需要访问该站点以获取文件。
我听说有些地区的人不能直接访问,需要使用代理或VPN。你能用浏览器打开那个链接吗?
-
直接回复这封邮件,在GitHub上查看,或取消订阅.
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Can anyone help? I am on my Macbook air M2 with MacOS14.5, when running webui.sh, could open the browser interface, but cannot load the model, and terminal shows as below, and my model is "v1-5-pruned-emaonly.ckpt".
|
Beta Was this translation helpful? Give feedback.
-
这是来自QQ邮箱的假期自动回复邮件。
您好,您的邮件已收到。我会在考到消息后第一时间回复您。若内容紧要,请电话通知我,以免耽误!谢谢!
|
Beta Was this translation helpful? Give feedback.
-
GM Everyone :) Been away from my iMac M1 for some months due to illness. Back to it and updated Ventura to Sonoma today. Decided to use Pinokio for one-click install of A1111 and all seems to have gone OK. Thought that would be a good idea as I tried running my version that worked fine on Ventura and nope - no go! So, just wondering: Is there anything I now need to change in the webui-user file now I have Sonoma installed? This was my previous args: export COMMANDLINE_ARGS="--medvram-sdxl --precision full --skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate --ckpt '/Volumes/BEEJ/Sept_Moved_SD_Models/Stable-diffusion/dreamshaper_7.safetensors'" This is how it currently looks in the new install for webui-user.sh Commandline arguments for webui.py, for example: export COMMANDLINE_ARGS="--medvram --opt-split-attention"export COMMANDLINE_ARGS="--no-download-sd-model --skip-torch-cuda-test --upcast-sampling --use-cpu interrogate --no-half --api" I need to spend a few hours today re-downloading extensions to this latest download and sorting VAE's & models etc. version: v1.10.1 • python: 3.10.15 • torch: 2.3.1 • xformers: N/A • gradio: 3.41.2 • checkpoint: [31e35c80fc] Also, do I need to change anything in Settings>Stable Diffusion? Any help would be really appreciated so Thank You :) |
Beta Was this translation helpful? Give feedback.
-
这是来自QQ邮箱的假期自动回复邮件。
您好,您的邮件已收到。我会在考到消息后第一时间回复您。若内容紧要,请电话通知我,以免耽误!谢谢!
|
Beta Was this translation helpful? Give feedback.
-
MacBook Pro M3 - macOS 15 webui fails to run Installing torch and torchvision |
Beta Was this translation helpful? Give feedback.
-
Trying to run on M1 PRO MAX 64GB (Sonoma 14.5) with sd3.5_large.safetensors model (large, 16G).
Tried:
Related r/StableDiffusion thread. Thanks. |
Beta Was this translation helpful? Give feedback.
-
这是来自QQ邮箱的假期自动回复邮件。
您好,您的邮件已收到。我会在考到消息后第一时间回复您。若内容紧要,请电话通知我,以免耽误!谢谢!
|
Beta Was this translation helpful? Give feedback.
-
Mac users: Please provide feedback on if these instructions do or don't work for you, and if anything is unclear or you are otherwise still having problems with your install that are not currently mentioned here.
Important notes
Currently most functionality in the web UI works correctly on macOS, with the most notable exceptions being CLIP interrogator and training. Although training does seem to work, it is incredibly slow and consumes an excessive amount of memory. CLIP interrogator can be used but it doesn't work correctly with the GPU acceleration macOS uses so the default configuration will run it entirely via CPU (which is slow).
Most samplers are known to work with the only exception being the PLMS sampler when using the Stable Diffusion 2.0 model. Generated images with GPU acceleration on macOS should usually match or almost match generated images on CPU with the same settings and seed.
Automatic installation
New install:
brew install cmake protobuf rust [email protected] git wget
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
stable-diffusion-webui/models/Stable-diffusion
. If you don't have any, see Downloading Stable Diffusion Models below.cd stable-diffusion-webui
and then./webui.sh
to run the web UI. A Python virtual environment will be created and activated using venv and any remaining missing dependencies will be automatically downloaded and installed../webui.sh
again. Note that it doesn't auto update the web UI; to update, rungit pull
before running./webui.sh
.Existing Install:
If you have an existing install of web UI that was created with
setup_mac.sh
, delete therun_webui_mac.sh
file andrepositories
folder from yourstable-diffusion-webui
folder. Then rungit pull
to update web UI and then./webui.sh
to run it.Downloading Stable Diffusion Models
If you don't have any models to use, Stable Diffusion models can be downloaded from Hugging Face. To download, click on a model and then click on the
Files and versions
header. Look for files listed with the ".ckpt" or ".safetensors" extensions, and then click the down arrow to the right of the file size to download them.Some popular official Stable Diffusion models are:
Stable Diffusion 2.0 and 2.1 require both a model and a configuration file, and image width & height will need to be set to 768 or higher when generating images:
For the configuration file, hold down the option key on the keyboard and click here to download
v2-inference-v.yaml
(it may download asv2-inference-v.yaml.yml
). In Finder select that file then go to the menu and selectFile
>Get Info
. In the window that appears select the filename and change it to the filename of the model, except with the file extension.yaml
instead of.ckpt
, press return on the keyboard (confirm changing the file extension if prompted), and place it in the same folder as the model (e.g. if you downloaded the768-v-ema.ckpt
model, rename it to768-v-ema.yaml
and put it instable-diffusion-webui/models/Stable-diffusion
along with the model).Also available is a Stable Diffusion 2.0 depth model (512-depth-ema.ckpt). Download the
v2-midas-inference.yaml
configuration file by holding down option on the keyboard and clicking here, then rename it with the.yaml
extension in the same way as mentioned above and put it instable-diffusion-webui/models/Stable-diffusion
along with the model. Note that this model works at image dimensions of 512 width/height or higher instead of 768.Troubleshooting
Web UI Won't Start:
If you encounter errors when trying to start the Web UI with
./webui.sh
, try deleting therepositories
andvenv
folders from yourstable-diffusion-webui
folder and then update web UI withgit pull
before running./webui.sh
again.Poor Performance:
Currently GPU acceleration on macOS uses a lot of memory. If performance is poor (if it takes more than a minute to generate a 512x512 image with 20 steps with any sampler) first try starting with the
--opt-split-attention-v1
command line option (i.e../webui.sh --opt-split-attention-v1
) and see if that helps. If that doesn't make much difference, then open the Activity Monitor application located in /Applications/Utilities and check the memory pressure graph under the Memory tab. If memory pressure is being displayed in red when an image is generated, close the web UI process and then add the--medvram
command line option (i.e../webui.sh --opt-split-attention-v1 --medvram
). If performance is still poor and memory pressure still red with that option, then instead try--lowvram
(i.e../webui.sh --opt-split-attention-v1 --lowvram
). If it still takes more than a few minutes to generate a 512x512 image with 20 steps with with any sampler, then you may need to turn off GPU acceleration. Openwebui-user.sh
in Xcode and change#export COMMANDLINE_ARGS=""
toexport COMMANDLINE_ARGS="--skip-torch-cuda-test --no-half --use-cpu all"
.Beta Was this translation helpful? Give feedback.
All reactions