1

I've recently tried to use the Stable Diffusion web UI from AUTOMATIC1111 on my Mac Intel. There is no documentation for Mac Intel, and when I tried to use the methods presented for other platforms, I ended-up with a Python exception related to LZMA:

ModuleNotFoundError: No module named '_lzma' 

I was able to fix the problem thanks to this stack overflow post. This allowed me to write an installation guide / documentation for Mac Intel that I share in my answer.

My configuration:

  • MacBook Pro 2019
  • CPU 2,6 GHz 6-Core Intel Core i7
  • GPU Intel UHD Graphics 630 1536 MB
  • Memory 32 GB 2667 MHz DDR4
  • System macOS Ventura 13.2.1
3
  • 1
    Stack Overflow is not the right place to ask how to install software other than things that are exclusively development tools. Even then, unless the problem is something that wouldn't happen when installing any other kind of software, it's often off-topic. Commented Apr 8, 2023 at 22:41
  • 2
    Thanks for sharing your opinion. The initial problem I had was a Python exception raised when using Stable Diffusion (which is relevant in Stack overflow). I was able to fix it thanks to a Stack overflow post. Sharing my solution, which is this installation guide, seemed to me to be the right thing to do: give back to the Stack overflow community. But if this solution is not welcome, I'll of course delete it. Commented Apr 9, 2023 at 12:25
  • 2
    I've tried to improve the content of this page following your remark @CharlesDuffy. Hopefully the edited version will be more informative and more adequate to the Stack overflow guidelines. Thanks again for your contribution. Commented Apr 9, 2023 at 12:51

2 Answers 2

6

Prerequisites:

  • Have brew installed
  • Have git installed
  • Have pyenv installed
  • Know how to use a Terminal

Installation guide:

  1. Open a Terminal and move to the directory where you want to install Stable Diffusion web UI.

  2. Using the Terminal, clone the stable-diffusion-webui repo. This will create a stable-diffusion-webui directory. Once the cloning is done, move into this directory:

$ git clone [email protected]:AUTOMATIC1111/stable-diffusion-webui.git $ cd stable-diffusion-webui 
  1. Using the Terminal, install xz with brew. Note that this needs to be done before installing Python 3.10:
$ brew install xz 
  1. Using the Terminal, install Python 3.10 using pyenv. Then set the local Python version to 3.10 in the stable-diffusion-webui directory. This will only affect the Python version used within this directory, the default Python version will be unchanged:
$ pyenv install 3.10 $ pyenv local 3.10 
  1. Download a Stable Diffusion model checkpoint. I downloaded the 1.5 version (v1-5-pruned.ckpt file) from the Hugging Face website. Then move the checkpoint into the models/Stable-diffusion directory.

  2. Using the Terminal, run the webui.sh script:

$ ./webui.sh 

If everything went fine, you should have in the Terminal a message that looks like this:

Running on local URL: http://127.0.0.1:7860 
  1. Open the URL in an Internet browser. In the txt2img tab, enter a prompt and click the generate button. This will start the image generation process.

The image I attached to this post was generated on my MacBook Pro Intel.

Image computed using Stable Diffusion web UI

Sign up to request clarification or add additional context in comments.

2 Comments

when I do " brew install xy", it gave me the error: Warning: No available formula with the name "xy". What is "xy"?
Sorry, there's a typo. The package is named xz. I'll modify the post right away.
0

Another way is to install Anaconda first, which takes care of the prerequisites.

1 Comment

Thanks for this suggestion. You're right, Anaconda is a good alternative. I've used it for years, but I now prefer to use pyenv + poetry when it comes to Python projects. This is a matter of preference I guess. Thanks again ^^

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.