Repository: stable-diffusion-webui
Issue: [Bug]: omegaconf.errors.ConfigAttributeError: Missing key model
Labels: bug-report,platform:mac

### Is there an existing issue for this?

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

### What happened?

On iMac 2020 M1, 16GB RAM, running MacOS Ventura 13.4.1 (c) (22F770820d)

After downloading the model and the yaml file (and renaming the yaml to match the model), and placing both in to the models/stable-diffusion directory, i run ./webui.sh, however I cannot load the model:

    raise ConfigKeyError(f"Missing key {key!s}")
omegaconf.errors.ConfigAttributeError: Missing key model
    full_key: model
    object_type=dict


Stable diffusion model failed to load
Applying attention optimization: InvokeAI... done.
ERROR:    Exception in ASGI application


I tried with two different models: v1.4 and v1.5pruned 
The webUI loads, but trying to load a stable diffusion checkpoint gives an error

### Steps to reproduce the problem

Follow the steps in the tutorial to install the libraries and clone the repo, then download a model from HuggingFace, along with the yaml file.

After downloading the model and the yaml file (and renaming the yaml to match the model), and placing both in to the models/stable-diffusion directory, i run ./webui.sh, however I cannot load the model because of the aforementioned error.

### What should have happened?

The model should have loaded and the the webUI should be usable

### Version or Commit where the problem happens

1.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?

CPU

### Cross attention optimization

Automatic

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

Google Chrome

### Command Line Arguments

```Shell
./webui.sh
```


### List of extensions

No

### Console logs

```Shell
Calculating sha256 for /Users/mark./Dev/stable-diffusion-webui/models/Stable-diffusion/sd-v1-4.ckpt: Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 100.1s (launcher: 70.4s, import torch: 8.3s, import gradio: 6.6s, setup paths: 7.5s, other imports: 6.5s, load scripts: 0.4s, create ui: 0.3s).
fe4efff1e174c627256e44ec2991ba279b3816e364b49f9be2abc0b3ff3f8556
Loading weights [fe4efff1e1] from /Users/mark./Dev/stable-diffusion-webui/models/Stable-diffusion/sd-v1-4.ckpt
loading stable diffusion model: ConfigAttributeError
Traceback (most recent call last):
  File "/Users/mark./.pyenv/versions/3.10.9/lib/python3.10/threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "/Users/mark./.pyenv/versions/3.10.9/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/Users/mark./.pyenv/versions/3.10.9/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/mark./Dev/stable-diffusion-webui/webui.py", line 318, in load_model
    shared.sd_model  # noqa: B018
  File "/Users/mark./Dev/stable-diffusion-webui/modules/shared.py", line 754, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "/Users/mark./Dev/stable-diffusion-webui/modules/sd_models.py", line 439, in get_sd_model
    load_model()
  File "/Users/mark./Dev/stable-diffusion-webui/modules/sd_models.py", line 489, in load_model
    repair_config(sd_config)
  File "/Users/mark./Dev/stable-diffusion-webui/modules/sd_models.py", line 399, in repair_config
    if not hasattr(sd_config.model.params, "use_ema"):
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 355, in __getattr__
    self._format_and_raise(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/base.py", line 231, in _format_and_raise
    format_and_raise(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/_utils.py", line 900, in format_and_raise
    _raise(ex, cause)
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/_utils.py", line 798, in _raise
    raise ex.with_traceback(sys.exc_info()[2])  # set env var OC_CAUSE=1 for full trace
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 351, in __getattr__
    return self._get_impl(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 442, in _get_impl
    node = self._get_child(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/basecontainer.py", line 73, in _get_child
    child = self._get_node(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 480, in _get_node
    raise ConfigKeyError(f"Missing key {key!s}")
omegaconf.errors.ConfigAttributeError: Missing key model
    full_key: model
    object_type=dict


Stable diffusion model failed to load
Applying attention optimization: InvokeAI... done.
Loading weights [fe4efff1e1] from /Users/mark./Dev/stable-diffusion-webui/models/Stable-diffusion/sd-v1-4.ckpt
loading stable diffusion model: ConfigAttributeError
Traceback (most recent call last):
  File "/Users/mark./.pyenv/versions/3.10.9/lib/python3.10/threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "/Users/mark./.pyenv/versions/3.10.9/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/Users/mark./Dev/stable-diffusion-webui/modules/ui.py", line 1515, in <lambda>
    update_image_cfg_scale_visibility = lambda: gr.update(visible=shared.sd_model and shared.sd_model.cond_stage_key == "edit")
  File "/Users/mark./Dev/stable-diffusion-webui/modules/shared.py", line 754, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "/Users/mark./Dev/stable-diffusion-webui/modules/sd_models.py", line 439, in get_sd_model
    load_model()
  File "/Users/mark./Dev/stable-diffusion-webui/modules/sd_models.py", line 489, in load_model
    repair_config(sd_config)
  File "/Users/mark./Dev/stable-diffusion-webui/modules/sd_models.py", line 399, in repair_config
    if not hasattr(sd_config.model.params, "use_ema"):
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 355, in __getattr__
    self._format_and_raise(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/base.py", line 231, in _format_and_raise
    format_and_raise(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/_utils.py", line 900, in format_and_raise
    _raise(ex, cause)
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/_utils.py", line 798, in _raise
    raise ex.with_traceback(sys.exc_info()[2])  # set env var OC_CAUSE=1 for full trace
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 351, in __getattr__
    return self._get_impl(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 442, in _get_impl
    node = self._get_child(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/basecontainer.py", line 73, in _get_child
    child = self._get_node(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 480, in _get_node
    raise ConfigKeyError(f"Missing key {key!s}")
omegaconf.errors.ConfigAttributeError: Missing key model
    full_key: model
    object_type=dict


Stable diffusion model failed to load
Loading weights [fe4efff1e1] from /Users/mark./Dev/stable-diffusion-webui/models/Stable-diffusion/sd-v1-4.ckpt
changing setting sd_model_checkpoint to sd-v1-4.ckpt [fe4efff1e1]: ConfigAttributeError
Traceback (most recent call last):
  File "/Users/mark./Dev/stable-diffusion-webui/modules/shared.py", line 633, in set
    self.data_labels[key].onchange()
  File "/Users/mark./Dev/stable-diffusion-webui/modules/call_queue.py", line 14, in f
    res = func(*args, **kwargs)
  File "/Users/mark./Dev/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/mark./Dev/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/mark./Dev/stable-diffusion-webui/modules/sd_models.py", line 489, in load_model
    repair_config(sd_config)
  File "/Users/mark./Dev/stable-diffusion-webui/modules/sd_models.py", line 399, in repair_config
    if not hasattr(sd_config.model.params, "use_ema"):
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 355, in __getattr__
    self._format_and_raise(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/base.py", line 231, in _format_and_raise
    format_and_raise(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/_utils.py", line 900, in format_and_raise
    _raise(ex, cause)
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/_utils.py", line 798, in _raise
    raise ex.with_traceback(sys.exc_info()[2])  # set env var OC_CAUSE=1 for full trace
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 351, in __getattr__
    return self._get_impl(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 442, in _get_impl
    node = self._get_child(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/basecontainer.py", line 73, in _get_child
    child = self._get_node(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 480, in _get_node
    raise ConfigKeyError(f"Missing key {key!s}")
omegaconf.errors.ConfigAttributeError: Missing key model
    full_key: model
    object_type=dict

Loading weights [fe4efff1e1] from /Users/mark./Dev/stable-diffusion-webui/models/Stable-diffusion/sd-v1-4.ckpt
changing setting sd_model_checkpoint to sd-v1-4.ckpt [fe4efff1e1]: ConfigAttributeError
Traceback (most recent call last):
  File "/Users/mark./Dev/stable-diffusion-webui/modules/shared.py", line 633, in set
    self.data_labels[key].onchange()
  File "/Users/mark./Dev/stable-diffusion-webui/modules/call_queue.py", line 14, in f
    res = func(*args, **kwargs)
  File "/Users/mark./Dev/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/mark./Dev/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/mark./Dev/stable-diffusion-webui/modules/sd_models.py", line 489, in load_model
    repair_config(sd_config)
  File "/Users/mark./Dev/stable-diffusion-webui/modules/sd_models.py", line 399, in repair_config
    if not hasattr(sd_config.model.params, "use_ema"):
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 355, in __getattr__
    self._format_and_raise(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/base.py", line 231, in _format_and_raise
    format_and_raise(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/_utils.py", line 900, in format_and_raise
    _raise(ex, cause)
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/_utils.py", line 798, in _raise
    raise ex.with_traceback(sys.exc_info()[2])  # set env var OC_CAUSE=1 for full trace
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 351, in __getattr__
    return self._get_impl(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 442, in _get_impl
    node = self._get_child(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/basecontainer.py", line 73, in _get_child
    child = self._get_node(
  File "/Users/mark./Dev/stable-diffusion-webui/venv/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 480, in _get_node
    raise ConfigKeyError(f"Missing key {key!s}")
omegaconf.errors.ConfigAttributeError: Missing key model
    full_key: model
    object_type=dict
```


### Additional information

_No response_