{"id":19531932,"url":"https://github.com/wy-luke/stablediffusion-installer-for-mac","last_synced_at":"2025-09-06T06:40:42.148Z","repository":{"id":184757015,"uuid":"672249133","full_name":"wy-luke/StableDiffusion-Installer-For-Mac","owner":"wy-luke","description":"Install Stable Diffusion on your Mac with one single command. 一条命令为你的 Mac 装上 Stable Diffusion","archived":false,"fork":false,"pushed_at":"2023-11-20T11:12:54.000Z","size":270,"stargazers_count":41,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-21T10:16:18.978Z","etag":null,"topics":["bash","homebrew","mac","macos","mamba","micromamba","shell","stable-diffusion","stable-diffusion-webui","stablediffusion"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wy-luke.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-29T12:30:39.000Z","updated_at":"2024-03-30T18:51:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"3ea81caa-d36f-4810-8bfd-bceaf457a825","html_url":"https://github.com/wy-luke/StableDiffusion-Installer-For-Mac","commit_stats":null,"previous_names":["wy-luke/stablediffusion-installer-for-mac"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wy-luke%2FStableDiffusion-Installer-For-Mac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wy-luke%2FStableDiffusion-Installer-For-Mac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wy-luke%2FStableDiffusion-Installer-For-Mac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wy-luke%2FStableDiffusion-Installer-For-Mac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wy-luke","download_url":"https://codeload.github.com/wy-luke/StableDiffusion-Installer-For-Mac/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224036382,"owners_count":17245034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","homebrew","mac","macos","mamba","micromamba","shell","stable-diffusion","stable-diffusion-webui","stablediffusion"],"created_at":"2024-11-11T01:45:05.377Z","updated_at":"2024-11-11T01:45:06.177Z","avatar_url":"https://github.com/wy-luke.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"left\"\u003e\n    \u003ca href=\"README_CN.md\"\u003e中文\u003c/a\u003e \u0026nbsp ｜ \u0026nbsp English\n\u003c/p\u003e\n\n# Stable Diffusion Installer For Mac\n\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits\u0026logoColor=white)](https://conventionalcommits.org) ![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/t/wy-luke/StableDiffusion-Installer-For-Mac) ![GitHub release (with filter)](https://img.shields.io/github/v/release/wy-luke/StableDiffusion-Installer-For-Mac) [![Test](https://github.com/wy-luke/StableDiffusion-Installer-For-Mac/actions/workflows/test.yml/badge.svg)](https://github.com/wy-luke/StableDiffusion-Installer-For-Mac/actions/workflows/test.yml)\n\nInstall Stable Diffusion web UI on your Mac **with one sigle command**:\n\n```bash\n/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/wy-luke/StableDiffusion-Installer-For-Mac/main/sd-installer.sh)\"\n```\n\nUse mamba to create virtual environment, so it won't conflict with and won't pollute the Python environment in your system. Keep your Mac system untouched. And the uninstallation script is on the way.\n\nTheoretically, it should work on both Apple Silicon and Intel CPU with any version of macOS.\n\nIf you encounter any issues or want some new features, feel free to contact me via [here](https://github.com/wy-luke/StableDiffusion-Installer-For-Mac/issues/new).\n\n## Detailed usage\n\n1. In the **Applications** folder, locate **Terminal** \u003cimg src=\"./images/terminal.png\" alt=\"terminal\" width=\"25\"/\u003e and open it.\n\n   \u003e Note: It's in the `/Applications/Utilities` folder. If you still can't find it, search it by name!\n\n2. Copy the following command to the **terminal**, press the **Enter key** to execute the command, and the installation will start automatically. Just wait for the installation to complete.\n\n   ```bash\n   /bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/wy-luke/StableDiffusion-Installer-For-Mac/main/sd-installer.sh)\"\n   ```\n\n3. At the beginning, you will be prompted to enter password, just type your login password.\n\n   \u003e Note: Your password will be invisible when you type, just type it, and press Enter after completion.\n\n4. If you see similar content below, it indicates a successful installation.\n\n   ![success](images/success.png)\n\n5. Open your web browser and enter `http://127.0.0.1:7860` (the underlined part in the image above) to access the Stable Diffusion web UI.\n\n   \u003e Note 1: Normally, it will automatically open the web browser.\n\n   \u003e **Note 2: Don't close the terminal app while using Stable Diffusion web UI, just keep it running background. If you accidentally close the terminal, see Re-run section below.**\n\n6. If the installation fails, you will be prompted to select whether to retry. Type `y` or just simply **press the Enter key** to try again. Type `n` to exit.\n\n## Re-run\n\nKeep the terminal running while using SD. When you don't use it anymore, just close the brower page and the terminal.\n\nIf you want to re-run SD after the first usage, use the command below to **re-run** Stable Diffusion web UI.\n\n```bash\n/bin/bash $HOME/stable-diffusion-webui/webui.sh\n```\n\nIf you move the `stable-diffusion-webui` folder to another path, you need to change the command above accordingly. Besides, you need always append `/webui.sh` in the end.\n\n```bash\n/bin/bash /your/path/of/stable-diffusion-webui/webui.sh\n```\n\n## Troubleshooting\n\n### \\*\\*\\*\\* not implemented for 'Half'\n\nMost likely, this is due to poor compatibility with AMD graphics cards.\n\nThe solution is simple. Run the command below, then execute the **re-run** command above again to start SD.\n\n```bash\necho 'export COMMANDLINE_ARGS=\"--upcast-sampling --no-half-vae --use-cpu interrogate --precision full --no-half --skip-torch-cuda-test\"' \u003e $HOME/stable-diffusion-webui/webui-user.sh\n```\n\n### MPS backend out of memory\n\nThis issue is caused by insufficient memory. You can reduce the memory requirement by adding `PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.7` before the **re-run** command to make SD run correctly.\n\n\u003e Note: This will result in longer processing time to generate a image. You could adjust the value of `PYTORCH_MPS_HIGH_WATERMARK_RATIO` according to your mac performance.\n\nReplace the **re-run** command with:\n\n```bash\nPYTORCH_MPS_HIGH_WATERMARK_RATIO=0.7 /bin/bash $HOME/stable-diffusion-webui/webui.sh\n```\n\nIf you still encounter this issue, you can try further reducing the value, such as:\n\n```bash\nPYTORCH_MPS_HIGH_WATERMARK_RATIO=0.5 /bin/bash $HOME/stable-diffusion-webui/webui.sh\n```\n\n## Download models\n\nPlace the models downloaded to `stable-diffusion-webui/models/Stable-diffusion` folder. Then refresh the Stable Diffusion web UI page in the browser and you will see it in the list.\n\n1. You could download all kinds of models in [Civitai](https://civitai.com/), a great site!\n\n2. Some popular official Stable Diffusion 1.x models:\n\n   - [Stable DIffusion 1.4](https://huggingface.co/CompVis/stable-diffusion-v-1-4-original) ([sd-v1-4.ckpt](https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt))\n   - [Stable Diffusion 1.5](https://huggingface.co/runwayml/stable-diffusion-v1-5) ([v1-5-pruned-emaonly.ckpt](https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt))\n   - [Stable Diffusion 1.5 Inpainting](https://huggingface.co/runwayml/stable-diffusion-inpainting) ([sd-v1-5-inpainting.ckpt](https://huggingface.co/runwayml/stable-diffusion-inpainting/resolve/main/sd-v1-5-inpainting.ckpt))\n\n3. Stable Diffusion 2.0 and 2.1 models:\n\n   - [Stable Diffusion 2.0](https://huggingface.co/stabilityai/stable-diffusion-2) ([768-v-ema.ckpt](https://huggingface.co/stabilityai/stable-diffusion-2/resolve/main/768-v-ema.ckpt))\n   - [Stable Diffusion 2.1](https://huggingface.co/stabilityai/stable-diffusion-2-1) ([v2-1_768-ema-pruned.ckpt](https://huggingface.co/stabilityai/stable-diffusion-2-1/resolve/main/v2-1_768-ema-pruned.ckpt))\n\n   These models require both a model and a configuration file, and image width \u0026 height will need to be set to 768 or higher when generating images.\n\n   For the configuration file, hold down the option key on the keyboard and click [here](https://github.com/Stability-AI/stablediffusion/raw/main/configs/stable-diffusion/v2-inference-v.yaml) to download `v2-inference-v.yaml` (it may download as `v2-inference-v.yaml.yml`). In Finder select that file then go to the menu and select `File` \\\u003e `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\n\n   E.g. if you downloaded the `768-v-ema.ckpt` model, rename it to `768-v-ema.yaml` and put it in `stable-diffusion-webui/models/Stable-diffusion` along with the model.\n\n   - [Stable Diffusion 2.0 depth model](https://huggingface.co/stabilityai/stable-diffusion-2-depth) ([512-depth-ema.ckpt](https://huggingface.co/stabilityai/stable-diffusion-2-depth/resolve/main/512-depth-ema.ckpt)).\n\n   Download the `v2-midas-inference.yaml` configuration file by holding down option on the keyboard and clicking [here](https://github.com/Stability-AI/stablediffusion/raw/main/configs/stable-diffusion/v2-midas-inference.yaml), then rename it with the `.yaml` extension in the same way as mentioned above and put it in `stable-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.\n\n## Features\n\n1. Use [Homebrew](https://brew.sh/) to install required dependencies. If you already have it installed, it will be used automatically. If not, it will be installed for you, but without modifying your system environment – your system will remain unchanged.\n\n   If you wish to activate it by default, you can add `eval $(/opt/homebrew/bin/brew shellenv)` to your `.zprofile` (zsh) or `.bash_profile` (bash) file.\n\n   You could also:\n\n   ```bash\n   # zsh\n   echo 'eval $(/opt/homebrew/bin/brew shellenv)' \u003e\u003e /Users/$USER/.zprofile\n   eval $(/opt/homebrew/bin/brew shellenv)\n\n   # bash\n   echo 'eval $(/opt/homebrew/bin/brew shellenv)' \u003e\u003e /Users/$USER/.bash_profile\n   eval $(/opt/homebrew/bin/brew shellenv)\n   ```\n\n2. Use [micromamba](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html), which is a tiny version of the [mamba](https://mamba.readthedocs.io/en/latest/index.html#), as Python related package and environment manager instead of Conda.\n\n   Compared to Conda, it has no base environment (empty) nor default version of Python, meaning that it won't interfere or contaminate your system's Python environment at all. Additionally, it's significantly faster.\n\n   Similarly, it isn't added to the system environment either, and won't be activated automatically by default.\n\n   But if you want, you could:\n\n   ```bash\n   # zsh\n   /opt/homebrew/bin/micromamba shell init -s zsh -p ~/micromamba\n   source ~/.zshrc\n\n   # bash\n   /opt/homebrew/bin/micromamba shell init -s bash -p ~/micromamba\n   source ~/.bashrc\n   ```\n\n## Credit\n\n[AUTOMATIC1111](https://github.com/AUTOMATIC1111) and [stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui)\n\n[Homebrew](https://github.com/Homebrew/brew)\n\n[Mamba](https://github.com/mamba-org/mamba)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwy-luke%2Fstablediffusion-installer-for-mac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwy-luke%2Fstablediffusion-installer-for-mac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwy-luke%2Fstablediffusion-installer-for-mac/lists"}