From 03bed5813995566d979be937f7f98f3ce3d42905 Mon Sep 17 00:00:00 2001 From: Dylan Cathelijn Date: Sat, 24 Sep 2022 14:47:11 +0200 Subject: [PATCH] Refactor to automatic installation instructions --- Installation-on-Apple-Silicon.md | 52 +++++++++----------------------- 1 file changed, 15 insertions(+), 37 deletions(-) diff --git a/Installation-on-Apple-Silicon.md b/Installation-on-Apple-Silicon.md index f7cf80d..be7ca8c 100644 --- a/Installation-on-Apple-Silicon.md +++ b/Installation-on-Apple-Silicon.md @@ -1,46 +1,24 @@ -**IMPORTANT** While the web UI runs fine, there are still certain issues when running this fork on Apple Silicon. +## Important note + + While the web UI runs fine, there are still certain issues when running this fork on Apple Silicon. The only 2 samplers that work (at the time of writing this) are `Euler` and `DPM2` - all others result in a black screen. Upscaling works, but only using the real-ESRGAN models. -First get the weights checkpoint download started - it's big: +## Automatic installation -Sign up at https://huggingface.co -Go to the Stable diffusion diffusion model page -Accept the terms and click Access Repository: -Download sd-v1-4.ckpt (4.27 GB) and note where you have saved it (probably the Downloads folder) +This script assumes you've installed the same dependencies as the other scripts (python, git, ...) - these can all be installed using [Homebrew](https://brew.sh/). + +The script can be downloaded from [here](https://github.com/dylancl/stable-diffusion-webui-mps/blob/master/setup_mac.sh), or follow the instructions below. + +1. Open Terminal.app +2. Run the following command: -1. `brew install cmake protobuf rust` -2. `curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o Miniconda3-latest-MacOSX-arm64.sh` -3. `/bin/bash Miniconda3-latest-MacOSX-arm64.sh` -4. `git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui` -5. `cd stable-diffusion-webui` -6. Run the following commands one by one: ``` -git clone https://github.com/CompVis/stable-diffusion.git repositories/stable-diffusion - -git clone https://github.com/CompVis/taming-transformers.git repositories/taming-transformers - -git clone https://github.com/sczhou/CodeFormer.git repositories/CodeFormer - -git clone https://github.com/salesforce/BLIP.git repositories/BLIP +bash <(curl -s https://github.com/dylancl/stable-diffusion-webui-mps/blob/master/setup_mac.sh) ``` +3. Follow the instructions in the terminal window. -7. `conda create --name web_ui python=3.10` -8. `conda activate web_ui` -9. `pip install -r requirements.txt` -10. `conda install pytorch torchvision torchaudio -c pytorch-nightly` -11. At this point, move the downloaded `sd-v1-4.ckpt` file into `stable-diffusion-webui/models/`. You will know it's the right folder since there's a text file named `Put Stable Diffusion checkpoints here.txt` in it. -12. `conda env config vars set PYTORCH_ENABLE_MPS_FALLBACK=1` -13. `python webui.py --precision full --no-half --opt-split-attention-v1` +#### Usage -It is possible that after running `webui.py` you get error messages saying certain packages are missing. Install the missing package, go back to step 13 and repeat. - -#### Common Errors - -##### Error - -`ImportError: dlopen(.venv/lib/python3.10/site-packages/google/protobuf/pyext/_message.cpython-310-darwin.so, 0x0002): symbol not found in flat namespace (__ZN6google8protobuf15FieldDescriptor12TypeOnceInitEPKS1_)` - -##### Solution - -Downgrade Protobuf using `pip install protobuf==3.19.4` \ No newline at end of file +After installation, you'll now find `run_webui_mac.sh` in the `stable-diffusion-webui` directory. Run this script to start the web UI using `./run_webui_mac.sh`. +This script automatically activates the conda environment, pulls the latest changes from the repository, and starts the web UI. On exit, the conda environment is deactivated. \ No newline at end of file