Repository: stable-diffusion-webui
Issue: [Bug]: Can't get SDXL1.0_base to run in Automatic111 on Apple Silicon, how to fix?
Labels: bug-report,platform:mac,sdxl

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

Updated Automatic1111 to latest version.

Apple Silicon 32GB RAM.

Disabled all extensions to be safe.

sd_xl_offset model works fine, but when I try to load 

sd_xl_base_1.0 does not load. I get this error

```

Loading weights [31e35c80fc] from /Users/Documents/GitHub/stable-diffusion-webui/models/Stable-diffusion/sd_xl_base_1.0.safetensors

WARNING:modules.mac_specific:MPS garbage collection failed

Traceback (most recent call last):
  File "/Users/Documents/GitHub/stable-diffusion-webui/modules/mac_specific.py", line 37, in torch_mps_gc
    from torch.mps import empty_cache


ModuleNotFoundError: No module named 'torch.mps'

Creating model from config: /Users/Documents/GitHub/stable-diffusion-webui/repositories/generative-models/configs/inference/sd_xl_base.yaml

Failed to create model quickly; will retry using slow method.
changing setting sd_model_checkpoint to sd_xl_base_1.0.safetensors [31e35c80fc]: AssertionError

Traceback (most recent call last):

  File "/Users/Documents/GitHub/stable-diffusion-webui/modules/shared.py", line 633, in set
    self.data_labels[key].onchange()

  File "/Users/Documents/GitHub/stable-diffusion-webui/modules/call_queue.py", line 14, in f
    res = func(*args, **kwargs)

  File "/Users/Documents/GitHub/stable-diffusion-webui/webui.py", line 238, in <lambda>
    shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: modules.sd_models.reload_model_weights()), call=False)

  File "/Users/Documents/GitHub/stable-diffusion-webui/modules/sd_models.py", line 578, in reload_model_weights
    load_model(checkpoint_info, already_loaded_state_dict=state_dict)

  File "/Users/Documents/GitHub/stable-diffusion-webui/modules/sd_models.py", line 504, in load_model
    sd_model = instantiate_from_config(sd_config.model)

  File "/Users/Documents/GitHub/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/util.py", line 89, in instantiate_from_config
    return get_obj_from_str(config["target"])(**config.get("params", dict()))

  File "/Users/Documents/GitHub/stable-diffusion-webui/repositories/generative-models/sgm/models/diffusion.py", line 65, in __init__
    self._init_first_stage(first_stage_config)

  File "/Users/Documents/GitHub/stable-diffusion-webui/repositories/generative-models/sgm/models/diffusion.py", line 106, in _init_first_stage
    model = instantiate_from_config(config).eval()

  File "/Users/Documents/GitHub/stable-diffusion-webui/repositories/generative-models/sgm/util.py", line 175, in instantiate_from_config
    return get_obj_from_str(config["target"])(**config.get("params", dict()))

  File "/Users/Documents/GitHub/stable-diffusion-webui/repositories/generative-models/sgm/models/autoencoder.py", line 295, in __init__
    self.encoder = Encoder(**ddconfig)


  File "/Users/Documents/GitHub/stable-diffusion-webui/repositories/generative-models/sgm/modules/diffusionmodules/model.py", line 553, in __init__
    self.mid.attn_1 = make_attn(block_in, attn_type=attn_type)


  File "/Users/Documents/GitHub/stable-diffusion-webui/repositories/generative-models/sgm/modules/diffusionmodules/model.py", line 286, in make_attn
    assert XFORMERS_IS_AVAILABLE, (


AssertionError: We do not support vanilla attention in 1.12.1 anymore, as it is too expensive. Please install xformers via e.g. 'pip install xformers==0.0.16'

```



How to resolve this?

All the other models run fine and previous models run fine, too, so it's something to do with SD_XL_1.0 base specifically.

### Steps to reproduce the problem

described above

### What should have happened?

should have loaded model

### Version or Commit where the problem happens

version: v1.5.1 

### What Python version are you running on ?

Python 3.10.x

### What platforms do you use to access the UI ?

MacOS

### What device are you running WebUI on?

Other GPUs

### Cross attention optimization

Automatic

### What browsers do you use to access the UI ?

Mozilla Firefox

### Command Line Arguments

```Shell
#!/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=""

# 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+cu113 --extra-index-url https://download.pytorch.org/whl/cu113"

# Requirements file to use for stable-diffusion-webui
#export REQS_FILE="requirements_versions.txt"

# Fixed git repos
#export K_DIFFUSION_PACKAGE=""
#export GFPGAN_PACKAGE=""

# Fixed git commits
#export STABLE_DIFFUSION_COMMIT_HASH=""
#export CODEFORMER_COMMIT_HASH=""
#export BLIP_COMMIT_HASH=""

# Uncomment to enable accelerated launch
#export ACCELERATE="True"

# Uncomment to disable TCMalloc
#export NO_TCMALLOC="True"

###########################################
```


### List of extensions

all disabled

### Console logs

```Shell
-
```


### Additional information

_No response_