-
Notifications
You must be signed in to change notification settings - Fork 27.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add working install script for Apple Silicon #4990
Conversation
@AUTOMATIC1111 , could you please take a look? This addresses install failure for Mac users. |
A couple of things:
Also some things will need to potentially be changed based on whether some currently pending PRs are approved:
We could also potentially use PyTorch 1.13 instead of 1.12.1 so that the newer samplers work, but 1.13 is slower and breaks checkpoint merging and training. A better option is probably to clone the conda environment to install the newer PyTorch and have a second run script for using it. And also, maybe merge the All that said, the script doesn't need to be in this repository. If you want to change the currently linked script there is no reason you can't submit a PR to do so. |
Doesn't need to, but it would be nice to have everything in the one place IMO. |
@brkirch thanks for your feedback! I think it is a good practice to put the install script in the same repos so that it can be properly maintained. It has no value as a separate script in another repos. I am curious why do we want This PR intended to fix installation issue surgically. We can address other issues you mention in separate PRs and see if others agree. |
Because as long as the
I believe it's currently this way so that newbie users who don't understand how the code/tech works can run the latest updates with minimal steps required. I have no strong opinion on whether separating it into |
Got you. I think it's better to separate them. It's not a good practice to pull and run the latest code every time. Something could be broken in master and a newbie won't know how to check out a previous version. We can create an update script if we want better user experience. |
Having a heck of a time trying to install this on a Mac (M1 Ultra). I've completely removed and reinstalled it about 6 times now. I edited the setup_mac.sh to include "torchsde" and still no bueno. Each time it deletes the checkpoints and I have to copy them back (would seem the script could check first before wiping the models directory. I know these should run great on the M1 / Apple silicon because Dream Textures does it inside of Blender and the install is like 2 steps. Any help please? Also will this work with SD 2.0 checkpoints that was just released? This is one of the errors I see during the install:
Got past the torchsde issue, it hangs for a bit at the end (looks like success) and then this:
|
What OS and python version are you using? I just tested on iOS 13 and
python 3.10.
On Thu, Nov 24, 2022 at 12:02 PM Carl Moebis ***@***.***> wrote:
Having a heck of a time trying to install this on a Mac (M1 Ultra). I've
completely removed and reinstalled it about 6 times now. I edited the
setup_mac.sh to include "torchsde" and still no bueno. Each time it deletes
the checkpoints and I have to copy them back (would seem the script could
check first before wiping the models directory. I know these should run
great on the M1 / Apple silicon because Dream Textures does it inside of
Blender and the install is like 2 steps. Any help please? Also will this
work with SD 2.0 checkpoints that was just released?
This is one of the errors I see during the install:
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed cleaning build dir for basicsr
Got past the torchsde issue, it hangs for a bit at the end (looks like
success) and then this:
Traceback (most recent call last):
File "/Users/moebis/Documents/stable-diffusion-webui/webui.py", line 13, in <module>
File "/Users/moebis/Documents/stable-diffusion-webui/modules/sd_samplers.py", line 11, in <module>
File "/Users/moebis/Documents/stable-diffusion-webui/modules/processing.py", line 15, in <module>
import modules.sd_hijack
File "/Users/moebis/Documents/stable-diffusion-webui/modules/sd_hijack.py", line 10, in <module>
File "/Users/moebis/Documents/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 13, in <module>
File "/Users/moebis/Documents/stable-diffusion-webui/modules/shared.py", line 14, in <module>
import modules.sd_models
File "/Users/moebis/Documents/stable-diffusion-webui/modules/sd_models.py", line 12, in <module>
from modules import shared, modelloader, devices, script_callbacks, sd_vae
ImportError: cannot import name 'sd_vae' from 'modules' (unknown location)
—
Reply to this email directly, view it on GitHub
<#4990 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZKQZJM4FMSZQSEE2NVJ3DWJ6NSNANCNFSM6AAAAAASJG64ZM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Sent from Gmail Mobile
|
I agree with this sentiment. Let's first get approval from @AUTOMATIC1111 on getting the Apple silicon setup scripts merged into this repo as-is, and then separately let's work on making them better. |
It seems this script will no more work with latest git changes (adding SD 2.0 support). |
@RarogCmex thanks for the heads up. Install script fixed. I notice Euler a sampler is not working now with SD v1. Perhaps its the 2.0 codes. Euler and DIMM works. And SD 2.0 doesn't work on Mac. We should address in another PR. |
At this moment I use euler a with waifu diffusion 1.3, all works like
charm. Maybe you should update python requirements manually within desired
conda prefix (conda activate web-ui; pip3 install - requirements.txt)
Also make sure that pythorch vision (or what it named) updated to latest,
it gives me warning if not.
вс, 27 нояб. 2022 г., 01:27 Andrew Wong ***@***.***>:
… @RarogCmex <https://github.com/RarogCmex> thanks for the heads up.
Install script fixed.
I notice Euler a sampler is not working now with SD v1. Perhaps its the
2.0 codes. Euler and DIMM works.
And SD 2.0 doesn't work on Mac. We should address in another PR.
—
Reply to this email directly, view it on GitHub
<#4990 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE6HJINNDGGMC2WQDG24GADWKJXEPANCNFSM6AAAAAASJG64ZM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Checked, Euler a is working with SD1.5 with latest SD2.0 changes. |
Thanks! Let me look into it.
Are you able to use SD 2.0?
…On Sat, Nov 26, 2022 at 3:59 PM Reva Denis ***@***.***> wrote:
Checked, Euler a is working with SD1.5 with latest SD2.0 changes.
—
Reply to this email directly, view it on GitHub
<#4990 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZKQZMFB34NA5F3UKXG2WTWKJ2ZRANCNFSM6AAAAAASJG64ZM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
No, I don't.
Maybe SD2 need support for --no-half to run on apple gpu
вс, 27 нояб. 2022 г., 02:10 Andrew Wong ***@***.***>:
… Thanks! Let me look into it.
Are you able to use SD 2.0?
On Sat, Nov 26, 2022 at 3:59 PM Reva Denis ***@***.***> wrote:
> Checked, Euler a is working with SD1.5 with latest SD2.0 changes.
>
> —
> Reply to this email directly, view it on GitHub
> <
#4990 (comment)
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AAZKQZMFB34NA5F3UKXG2WTWKJ2ZRANCNFSM6AAAAAASJG64ZM
>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#4990 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE6HJIJP35TUQCR2RBMI723WKJ4EDANCNFSM6AAAAAASJG64ZM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Thanks for testing. Euler a should be working now. |
What about you host this script somewhere else you have access to and we just add a link to that in the wiki? |
I can do that but then the install script will not be reviewed and can be updated at will. It is opening up the users to malicious attack. Really not a good idea. |
I don't want to be the trusted person for the code that I can't run. |
I had thought that perhaps the existing scripts already in the repo could get fixed up to work correctly for installing on macOS, but as it turns out even that isn't necessary. After installing brew (if it is not already installed) then running Expand#!/bin/bash
#########################################################
# Uncomment and change the variables below to your need:#
#########################################################
# Install directory without trailing slash
#install_dir="/home/$(whoami)"
# Name of the subdirectory
#clone_dir="stable-diffusion-webui"
# Commandline arguments for webui.py, for example: export COMMANDLINE_ARGS="--medvram --opt-split-attention"
export COMMANDLINE_ARGS="--skip-torch-cuda-test --no-half --use-cpu interrogate"
# python3 executable
#python_cmd="python3"
# git executable
#export GIT="git"
# python3 venv without trailing slash (defaults to ${install_dir}/${clone_dir}/venv)
#venv_dir="venv"
# script to launch to start the app
#export LAUNCH_SCRIPT="launch.py"
# install command for torch
export TORCH_COMMAND="pip install torch==1.12.1 torchvision==0.13.1 psutil"
# Requirements file to use for stable-diffusion-webui
#export REQS_FILE="requirements_versions.txt"
# Fixed git repos
#export K_DIFFUSION_PACKAGE=""
#export GFPGAN_PACKAGE=""
export K_DIFFUSION_REPO="https://github.com/brkirch/k-diffusion.git"
# Fixed git commits
#export STABLE_DIFFUSION_COMMIT_HASH=""
#export TAMING_TRANSFORMERS_COMMIT_HASH=""
#export CODEFORMER_COMMIT_HASH=""
#export BLIP_COMMIT_HASH=""
export K_DIFFUSION_COMMIT_HASH="51c9778f269cedb55a4d88c79c0246d35bdadb71"
# Uncomment to enable accelerated launch
#export ACCELERATE="True"
# Enable CPU fallback for missing MPS ops
export PYTORCH_ENABLE_MPS_FALLBACK=1
###########################################
Place your Stable Diffusion models into stable-diffusion-webui/models/Stable-diffusion. After that, Please let me know if there are any problems encountered with this method, but if not then this the wiki should probably be changed to use this instead. Edit: Added a different fork of k-diffusion (that I created from Birch-san's fork) at https://github.com/brkirch/k-diffusion to fix the black screen with some of the newer samplers. Delete the k-diffusion folder in stable-diffusion-webui/repositories if you already installed using this method before this edit, then replace the contents of webui-user.sh in Xcode again. Edit 2: Updated webui-user.sh again to add a fix for the DPM fast sampler. |
I just to test this, and this works like a charm, not a single error in the launching, and eular a works. 1.5 works too and 768-ema too. (only 512-ema.ckpt not working at all) |
@AUTOMATIC1111 While I understand that stance, there are enough macOS users here that would be happy to run/check/etc, and by keeping it together in this main repo, we have the easy opportunity to provide fixes when they need to happen. Currently having it scattered in external places has made it a lot harder than it needs to be IMO. /2c |
A separate install script is not needed for macOS, with #5286 using webui.sh should be sufficient. @AUTOMATIC1111 |
Will update install instruction in wiki if approved.
Fixes issues:
#4829
#4662
Wiki for mac installation need to be updated. It will resolve
#4743