From 073fc0e59d71ff934a77d1454ed0b83a01132f60 Mon Sep 17 00:00:00 2001 From: viking1304 Date: Tue, 16 Jul 2024 19:46:15 +0200 Subject: [PATCH] Version 0.2.2 --- README.md | 63 +++++++++++++++++++------------------------------- a1111-setup.sh | 18 +++++++-------- 2 files changed, 33 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index 15ad203..841fc63 100644 --- a/README.md +++ b/README.md @@ -1,68 +1,53 @@ -# a1111-setup -**Simple and easy way to install Automatic1111 WebUI or Forge on Mac** +# Install Stable Diffusion WebUI on Mac +**Simple and easy Automatic1111 and Forge install script for macOS** -By default, this script will install A1111 in `stable-diffusion-webui` inside your home directory, but you can change the location if you want. +By default, this script will install **Stable Diffusion WebUI** (Automatic1111) in `stable-diffusion-webui` inside your home directory, but you can change the location if you want. -The script will apply some recommended fixes and install the required libraries. If there is already an installation in that folder, the script will purge the pip cache, remove venv, and force using the latest version of A1111. A new venv will be created, and you should be able to use A1111 on your Mac without any problems. +The script will apply some recommended fixes and install the required libraries. If an installation is already in that folder, the script will purge the pip cache, remove venv, and force the latest version of Stable Diffusion WebUI to be used. A new venv will be created, and you should be able to use Stable Diffusion WebUI on your Mac without any problems. -Simply run `bash a1111-setup.sh` or `chmod 755 a1111-setup.sh && ./a1111-setup.sh`. Wait a few minutes (depending on your computer and internet speed) until you see WebUI opened in your default browser. +Run `sh a1111-setup.sh` or make the script executable with `chmod 755 a1111-setup.sh` and then run `./a1111-setup.sh`. Wait a few minutes (depending on your computer and internet speed) until you see WebUI opened in your default browser. Command line parameters: ``` - [-t stable|develop] stable or develop version of PyTorch - [-f all|errors|none] apply all fixes, only fixes for errors or none - [-d folder_name] specify the destination folder for A1111 installation - [-o a1111|forge] install A1111 or Forge - [-b] update Homebrew [-h] display help + [-r] dry run, only show what would be done + [-b] update Homebrew + [-t] use development version of PyTorch + [-i] show debug info and exit + [-f all|none] apply all fixes or none + [-d folder_name] specify the destination folder for WebUI installation + [-o forge] install Forge + [-c red|green|yellow|blue|magenta|cyan|no-color] use specified color theme for messages ``` -The [latest stable release](https://github.com/pytorch/pytorch/releases) of PyTorch will be installed by default, which is now recommended for Macs. It is still possible to use the development version using the `-t develop` option, but it is not necessary anymore. +The recommended version of PyTorch will be automatically installed. At this moment, it is 2.3.1 for ARM and 2.1.2 for Intel. The development version of PyTorch can still be used with the `-t develop` option, but only on ARM Macs. -Only errors will be fixed by default, but you can also apply command line param tweak using `-f all`. Based on my tests, those parameters give a better and faster performance of A1111 WebUI than those provided by the A1111 team. +*PyTorch dropped support for Intel Macs. The last version of PyTorch that properly works on Intel Macs with MacOS 14.4+ is 2.1.2* -Use option `-d` to specify the destination folder for A1111 installation or the folder where A1111 is currently installed. +Fixes for very rare errors will not be applied by default. You can use `-f all` to apply them. -Use option `-o` to specify which webui to install. You can choose between A1111 and Forge. +Use option `-d` to specify the destination folder for WebUI installation or the folder where WebUI is currently installed. -Since some people might not want to update their installation of Homebrew, the update is disabled by default, but you can update brew using the `-b` option. +Even though [the Forge team advised users to change back to A1111](https://github.com/lllyasviel/stable-diffusion-webui-forge/discussions/801), it is still possible to install Forge using `-o forge` if you need it. -**Additional Notes** +Since some people might not want to update their Homebrew installation, the update is disabled by default, but you can update it using the `-b` option. -In some extremely rare cases, default command line parameters provided by the A1111 team might not work correctly, for example, with some Macs with eGPU. +By default, script use a blue color theme, but you can change it using `-c` option. For example, you can use `-c green` to use green color theme. -You can try and see which of the command line parameters below works the best for you. +The new `-i` option will show debug info and exit. This information might be helpful when you report a problem. -Args for Macs implemented by the A1111 team: -``` -export COMMANDLINE_ARGS="--skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate" -``` +**Additional Notes** -My recommendation for most Macs: -``` -export COMMANDLINE_ARGS="--skip-torch-cuda-test --opt-sub-quad-attention --upcast-sampling --no-half-vae --medvram-sdxl --use-cpu interrogate" -``` +In some extremely rare cases, WebUI might produce only noise with `--no-half-vae`. *I have never noticed that, but some people with external GPUs and two nonstandard AMD GPUs had that problem.* -My recommendation for Macs with 36GB or more RAM: -``` -export COMMANDLINE_ARGS="--skip-torch-cuda-test --opt-sub-quad-attention --upcast-sampling --no-half-vae --use-cpu interrogate" -``` +If you experience that problem, you can try one of those command line args: -In some extremely rare cases, WebUI might produce only noise with `--no-half-vae`. *I have never noticed that, but some people with external GPUs and two nonstandard AMD GPUs had that problem.* ``` export COMMANDLINE_ARGS="--skip-torch-cuda-test --upcast-sampling --no-half --use-cpu interrogate" export COMMANDLINE_ARGS="--skip-torch-cuda-test --opt-sub-quad-attention --upcast-sampling --no-half --medvram-sdxl" ``` -Those combinations also worked without error on my Macs: -``` -export COMMANDLINE_ARGS="--skip-torch-cuda-test --opt-split-attention-v1 --opt-sub-quad-attention --upcast-sampling --no-half-vae --medvram-sdxl" -export COMMANDLINE_ARGS="--skip-torch-cuda-test --upcast-sampling --no-half-vae --medvram-sdxl" -export COMMANDLINE_ARGS="--skip-torch-cuda-test --opt-split-attention-v1 --upcast-sampling --no-half-vae --medvram-sdxl" -export COMMANDLINE_ARGS="--skip-torch-cuda-test --opt-sub-quad-attention --upcast-sampling --no-half-vae --medvram" -``` - *All comments and suggestions are welcome* 3 min read diff --git a/a1111-setup.sh b/a1111-setup.sh index 307f50d..dc2cf02 100644 --- a/a1111-setup.sh +++ b/a1111-setup.sh @@ -11,9 +11,9 @@ # Bugs: --- # Notes: --- # Author: Aleksandar Milanovic (viking1304) -# Version: 0.2.0 +# Version: 0.2.2 # Created: 2023/12/12 19:30:51 -# Last modified: 2024/07/15 21:04:59 +# Last modified: 2024/07/16 19:45:09 # Copyright (c) 2024 Aleksandar Milanovic # https://github.com/viking1304/ @@ -36,7 +36,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -readonly VERSION='0.2.0' +readonly VERSION='0.2.2' readonly YEAR='2024' # declare variables @@ -709,27 +709,27 @@ apply_patches() { msg " for Macs with 16 GB or more of RAM" if [[ "${fork}" == "a1111" ]]; then msg "COMMANDLINE_ARGS=\"--skip-torch-cuda-test --opt-sub-quad-attention --upcast-sampling --no-half-vae --use-cpu interrogate\"" - patch_file "https://raw.githubusercontent.com/viking1304/a1111-setup/develop/patches/lineargs-arm.patch" "23f4ef196c3e6dc868de6b664c0feca5da08c91db4d9b2829587c62a37433747" + patch_file "https://raw.githubusercontent.com/viking1304/a1111-setup/main/patches/lineargs-arm.patch" "23f4ef196c3e6dc868de6b664c0feca5da08c91db4d9b2829587c62a37433747" fi if [[ "${fork}" == "forge" ]]; then msg "COMMANDLINE_ARGS=\"--skip-torch-cuda-test --attention-pytorch --all-in-fp16 --always-high-vram --use-cpu interrogate\"" - patch_file "https://raw.githubusercontent.com/viking1304/a1111-setup/develop/patches/lineargs-arm-f.patch" "75b2bf86ba0c7b73658ad9d22d62444affc7af61c904364bff0e88975e8af905" + patch_file "https://raw.githubusercontent.com/viking1304/a1111-setup/main/patches/lineargs-arm-f.patch" "75b2bf86ba0c7b73658ad9d22d62444affc7af61c904364bff0e88975e8af905" fi else msg " for Macs with less than 16 GB of RAM" if [[ "${fork}" == "a1111" ]]; then msg "COMMANDLINE_ARGS=\"--skip-torch-cuda-test --opt-sub-quad-attention --upcast-sampling --no-half-vae --lowvram --use-cpu interrogate\"" - patch_file "https://raw.githubusercontent.com/viking1304/a1111-setup/develop/patches/lineargs-lowvram.patch" "fa102780cc830eefd576cbec43f6b416c02f27e4347851f82d143065ea686bd4" + patch_file "https://raw.githubusercontent.com/viking1304/a1111-setup/main/patches/lineargs-lowvram.patch" "fa102780cc830eefd576cbec43f6b416c02f27e4347851f82d143065ea686bd4" fi if [[ "${fork}" == "forge" ]]; then msg "COMMANDLINE_ARGS=\"--skip-torch-cuda-test --attention-pytorch --all-in-fp16 --use-cpu interrogate\"" - patch_file "https://raw.githubusercontent.com/viking1304/a1111-setup/develop/patches/lineargs-lowvram-f.patch" "2b06015a393804db584a2a91ef56f1a0727f63fc93e44821471f7b4b8cca6550" + patch_file "https://raw.githubusercontent.com/viking1304/a1111-setup/main/patches/lineargs-lowvram-f.patch" "2b06015a393804db584a2a91ef56f1a0727f63fc93e44821471f7b4b8cca6550" fi fi else msg_cn "Applying patch: " "Set recommended command line args for Intel" msg "COMMANDLINE_ARGS=\"--skip-torch-cuda-test --opt-sub-quad-attention --upcast-sampling --no-half --lowvram --use-cpu interrogate\"" - patch_file "https://raw.githubusercontent.com/viking1304/a1111-setup/86814db94400c4574fbf473378c03ab30423ef0d/patches/lineargs-intel.patch" "62ba57613211b41ae4c505d896f88be590348f759b746bf469a8df4cdaf314aa" + patch_file "https://raw.githubusercontent.com/viking1304/a1111-setup/main/patches/lineargs-intel.patch" "62ba57613211b41ae4c505d896f88be590348f759b746bf469a8df4cdaf314aa" fi msg_br fi @@ -738,7 +738,7 @@ apply_patches() { if [[ "${vm}" == true ]]; then msg_cn "Applying patch: " "Set working command line args for VM" msg "COMMANDLINE_ARGS=\"--skip-torch-cuda-test --opt-sub-quad-attention --upcast-sampling --no-half --lowvram --use-cpu all\"" - patch_file "https://raw.githubusercontent.com/viking1304/a1111-setup/86814db94400c4574fbf473378c03ab30423ef0d/patches/lineargs-vm.patch" "c48fdeedfa8c370b789bcc21bdac73b34b3bd603559d0bead9d30d37f791d0d8" + patch_file "https://raw.githubusercontent.com/viking1304/a1111-setup/main/patches/lineargs-vm.patch" "c48fdeedfa8c370b789bcc21bdac73b34b3bd603559d0bead9d30d37f791d0d8" msg_br fi