AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
140.65k stars 26.61k forks source link

[Bug]: AttributeError: 'NoneType' object has no attribute 'cond_stage_model' / cannot fix #14189

Closed UlyssesHeart closed 10 months ago

UlyssesHeart commented 10 months ago

Is there an existing issue for this?

What happened?

I merely went into Extensions and updated all, and now no model will load at all. All I get is "Error" – see screenshot. I have searched and can find no solutions for this. On v1.6.0-2. Have had no significant issues whatsoever with Auto1111 until this.

Steps to reproduce the problem

  1. Update Extensions
  2. Reload Web UI
  3. ...

What should have happened?

All of my models (LoRA, LYCORIS, Textual Inversions and Checkpoints) should load.

Sysinfo

Sysinfo-2023-12-03-21-10.txt

What browsers do you use to access the UI ?

Google Chrome

Console logs

Last login: Sun Dec  3 15:50:56 on ttys000
xxxxxxx@Xxxxxxxs-MBP ~ % cd ~/stable-diffusion-webui;./webui.sh --no-half

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
Running on xxxxxxxxxxxx user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
Python 3.10.13 (main, Aug 24 2023, 12:59:26) [Clang 15.0.0 (clang-1500.0.40.1)]
Version: v1.6.0-2-g4afaaf8a
Commit hash: 4afaaf8a020c1df457bcf7250cb1c7f609699fa7
Found existing installation: mmcv 2.1.0
Uninstalling mmcv-2.1.0:
  Successfully uninstalled mmcv-2.1.0
Found existing installation: mmdet 3.2.0
Uninstalling mmdet-3.2.0:
  Successfully uninstalled mmdet-3.2.0
Found existing installation: mmengine 0.10.1
Uninstalling mmengine-0.10.1:
  Successfully uninstalled mmengine-0.10.1
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
Uninstalling mmcv mmdet... (if installed)
Installing mmcv mmdet...
Launching Web UI with arguments: --no-half --skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled
[-] ADetailer initialized. version: 23.11.1, num models: 9
Installing openmim
Installing mmdet
*** Error loading script: dddetailer.py
    Traceback (most recent call last):
      File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/scripts.py", line 382, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/script_loading.py", line 10, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/extensions/dddetailer/scripts/dddetailer.py", line 975, in <module>
        from mmdet.apis import inference_detector, init_detector
      File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/mmdet/apis/__init__.py", line 2, in <module>
        from .det_inferencer import DetInferencer
      File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/mmdet/apis/det_inferencer.py", line 22, in <module>
        from mmdet.evaluation import INSTANCE_OFFSET
      File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/mmdet/evaluation/__init__.py", line 3, in <module>
        from .metrics import *  # noqa: F401,F403
      File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/mmdet/evaluation/metrics/__init__.py", line 5, in <module>
        from .coco_metric import CocoMetric
      File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/mmdet/evaluation/metrics/coco_metric.py", line 18, in <module>
        from mmdet.structures.mask import encode_mask_results
      File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/mmdet/structures/mask/__init__.py", line 3, in <module>
        from .structures import (BaseInstanceMasks, BitmapMasks, PolygonMasks,
      File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/mmdet/structures/mask/structures.py", line 12, in <module>
        from mmcv.ops.roi_align import roi_align
      File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/mmcv/ops/__init__.py", line 3, in <module>
        from .active_rotated_filter import active_rotated_filter
      File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/mmcv/ops/active_rotated_filter.py", line 10, in <module>
        ext_module = ext_loader.load_ext(
      File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/mmcv/utils/ext_loader.py", line 13, in load_ext
        ext = importlib.import_module('mmcv.' + name)
      File "/opt/homebrew/Cellar/python@3.10/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
    ModuleNotFoundError: No module named 'mmcv._ext'

---
2023-12-03 16:11:45,359 - ControlNet - INFO - ControlNet v1.1.419
ControlNet preprocessor location: /Users/xxxxxxxxxxxx/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads
2023-12-03 16:11:45,418 - ControlNet - INFO - ControlNet v1.1.419
Loading weights [75d035fa81] from /Users/xxxxxxxxxxxx/stable-diffusion-webui/models/Stable-diffusion/Frankenstein_v2.safetensors
2023-12-03 16:11:46,361 - AnimateDiff - INFO - Injecting LCM to UI.
Creating model from config: /Users/xxxxxxxxxxxx/stable-diffusion-webui/configs/v1-inference.yaml
2023-12-03 16:11:47,222 - AnimateDiff - INFO - Hacking i2i-batch.
loading stable diffusion model: TypeError
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.10/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "/opt/homebrew/Cellar/python@3.10/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/opt/homebrew/Cellar/python@3.10/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/initialize.py", line 147, in load_model
    shared.sd_model  # noqa: B018
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/shared_items.py", line 110, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_models.py", line 499, in get_sd_model
    load_model()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_models.py", line 626, in load_model
    load_model_weights(sd_model, checkpoint_info, state_dict, timer)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_models.py", line 353, in load_model_weights
    model.load_state_dict(state_dict, strict=False)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 223, in <lambda>
    module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda *args, **kwargs: load_state_dict(module_load_state_dict, *args, **kwargs))
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 221, in load_state_dict
    original(module, state_dict, strict=strict)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2027, in load_state_dict
    load(self, state_dict)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  [Previous line repeated 3 more times]
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2009, in load
    module._load_from_state_dict(
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 226, in <lambda>
    conv2d_load_from_state_dict = self.replace(torch.nn.Conv2d, '_load_from_state_dict', lambda *args, **kwargs: load_from_state_dict(conv2d_load_from_state_dict, *args, **kwargs))
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 191, in load_from_state_dict
    module._parameters[name] = torch.nn.parameter.Parameter(torch.zeros_like(param, device=device, dtype=dtype), requires_grad=param.requires_grad)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_meta_registrations.py", line 1780, in zeros_like
    return aten.empty_like.default(
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_ops.py", line 287, in __call__
    return self._op(*args, **kwargs or {})
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_refs/__init__.py", line 4254, in empty_like
    return torch.empty_strided(
TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.

Stable diffusion model failed to load
Applying attention optimization: sub-quadratic... done.
Loading weights [75d035fa81] from /Users/xxxxxxxxxxxx/stable-diffusion-webui/models/Stable-diffusion/Frankenstein_v2.safetensors
Creating model from config: /Users/xxxxxxxxxxxx/stable-diffusion-webui/configs/v1-inference.yaml
loading stable diffusion model: TypeError
Traceback (most recent call last):
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/launch.py", line 48, in <module>
    main()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/launch.py", line 44, in main
    start()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/launch_utils.py", line 436, in start
    webui.webui()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/webui.py", line 64, in webui
    shared.demo = ui.create_ui()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/ui.py", line 1257, in create_ui
    interfaces += script_callbacks.ui_tabs_callback()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/script_callbacks.py", line 166, in ui_tabs_callback
    res += c.callback() or []
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/extensions/sd-model-preview-xd/scripts/modelpreview.py", line 1013, in on_ui_tabs
    list_all_embeddings(),
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/extensions/sd-model-preview-xd/scripts/modelpreview.py", line 206, in list_all_embeddings
    sd_hijack.model_hijack.embedding_db.load_textual_inversion_embeddings()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 255, in load_textual_inversion_embeddings
    self.expected_shape = self.get_expected_shape()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 154, in get_expected_shape
    vec = shared.sd_model.cond_stage_model.encode_embedding_init_text(",", 1)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/shared_items.py", line 110, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_models.py", line 499, in get_sd_model
    load_model()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_models.py", line 626, in load_model
    load_model_weights(sd_model, checkpoint_info, state_dict, timer)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_models.py", line 353, in load_model_weights
    model.load_state_dict(state_dict, strict=False)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 223, in <lambda>
    module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda *args, **kwargs: load_state_dict(module_load_state_dict, *args, **kwargs))
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 221, in load_state_dict
    original(module, state_dict, strict=strict)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2027, in load_state_dict
    load(self, state_dict)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  [Previous line repeated 3 more times]
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2009, in load
    module._load_from_state_dict(
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 226, in <lambda>
    conv2d_load_from_state_dict = self.replace(torch.nn.Conv2d, '_load_from_state_dict', lambda *args, **kwargs: load_from_state_dict(conv2d_load_from_state_dict, *args, **kwargs))
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 191, in load_from_state_dict
    module._parameters[name] = torch.nn.parameter.Parameter(torch.zeros_like(param, device=device, dtype=dtype), requires_grad=param.requires_grad)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_meta_registrations.py", line 1780, in zeros_like
    return aten.empty_like.default(
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_ops.py", line 287, in __call__
    return self._op(*args, **kwargs or {})
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_refs/__init__.py", line 4254, in empty_like
    return torch.empty_strided(
TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.

Stable diffusion model failed to load
*** Error executing callback ui_tabs_callback for /Users/xxxxxxxxxxxx/stable-diffusion-webui/extensions/sd-model-preview-xd/scripts/modelpreview.py
    Traceback (most recent call last):
      File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/script_callbacks.py", line 166, in ui_tabs_callback
        res += c.callback() or []
      File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/extensions/sd-model-preview-xd/scripts/modelpreview.py", line 1013, in on_ui_tabs
        list_all_embeddings(),
      File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/extensions/sd-model-preview-xd/scripts/modelpreview.py", line 206, in list_all_embeddings
        sd_hijack.model_hijack.embedding_db.load_textual_inversion_embeddings()
      File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 255, in load_textual_inversion_embeddings
        self.expected_shape = self.get_expected_shape()
      File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 154, in get_expected_shape
        vec = shared.sd_model.cond_stage_model.encode_embedding_init_text(",", 1)
    AttributeError: 'NoneType' object has no attribute 'cond_stage_model'

---
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 25.3s (prepare environment: 8.5s, import torch: 1.3s, import gradio: 0.3s, setup paths: 0.4s, initialize shared: 0.1s, other imports: 0.5s, list SD models: 0.2s, load scripts: 7.4s, scripts before_ui_callback: 0.8s, create ui: 3.4s, gradio launch: 2.3s).
Loading weights [75d035fa81] from /Users/xxxxxxxxxxxx/stable-diffusion-webui/models/Stable-diffusion/Frankenstein_v2.safetensors
Creating model from config: /Users/xxxxxxxxxxxx/stable-diffusion-webui/configs/v1-inference.yaml
loading stable diffusion model: TypeError
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.10/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "/opt/homebrew/Cellar/python@3.10/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/ui_extra_networks.py", line 392, in pages_html
    return refresh()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/ui_extra_networks.py", line 398, in refresh
    pg.refresh()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/ui_extra_networks_textual_inversion.py", line 13, in refresh
    sd_hijack.model_hijack.embedding_db.load_textual_inversion_embeddings(force_reload=True)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 255, in load_textual_inversion_embeddings
    self.expected_shape = self.get_expected_shape()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 154, in get_expected_shape
    vec = shared.sd_model.cond_stage_model.encode_embedding_init_text(",", 1)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/shared_items.py", line 110, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_models.py", line 499, in get_sd_model
    load_model()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_models.py", line 626, in load_model
    load_model_weights(sd_model, checkpoint_info, state_dict, timer)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_models.py", line 353, in load_model_weights
    model.load_state_dict(state_dict, strict=False)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 223, in <lambda>
    module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda *args, **kwargs: load_state_dict(module_load_state_dict, *args, **kwargs))
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 221, in load_state_dict
    original(module, state_dict, strict=strict)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2027, in load_state_dict
    load(self, state_dict)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  [Previous line repeated 3 more times]
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2009, in load
    module._load_from_state_dict(
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 226, in <lambda>
    conv2d_load_from_state_dict = self.replace(torch.nn.Conv2d, '_load_from_state_dict', lambda *args, **kwargs: load_from_state_dict(conv2d_load_from_state_dict, *args, **kwargs))
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 191, in load_from_state_dict
    module._parameters[name] = torch.nn.parameter.Parameter(torch.zeros_like(param, device=device, dtype=dtype), requires_grad=param.requires_grad)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_meta_registrations.py", line 1780, in zeros_like
    return aten.empty_like.default(
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_ops.py", line 287, in __call__
    return self._op(*args, **kwargs or {})
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_refs/__init__.py", line 4254, in empty_like
    return torch.empty_strided(
TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.

Stable diffusion model failed to load
Loading weights [75d035fa81] from /Users/xxxxxxxxxxxx/stable-diffusion-webui/models/Stable-diffusion/Frankenstein_v2.safetensors
Traceback (most recent call last):
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1431, in process_api
    result = await self.call_function(
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1103, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/ui_extra_networks.py", line 392, in pages_html
    return refresh()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/ui_extra_networks.py", line 398, in refresh
    pg.refresh()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/ui_extra_networks_textual_inversion.py", line 13, in refresh
    sd_hijack.model_hijack.embedding_db.load_textual_inversion_embeddings(force_reload=True)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 255, in load_textual_inversion_embeddings
    self.expected_shape = self.get_expected_shape()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 154, in get_expected_shape
    vec = shared.sd_model.cond_stage_model.encode_embedding_init_text(",", 1)
AttributeError: 'NoneType' object has no attribute 'cond_stage_model'
Creating model from config: /Users/xxxxxxxxxxxx/stable-diffusion-webui/configs/v1-inference.yaml
loading stable diffusion model: TypeError
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.10/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "/opt/homebrew/Cellar/python@3.10/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/ui_extra_networks.py", line 392, in pages_html
    return refresh()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/ui_extra_networks.py", line 398, in refresh
    pg.refresh()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/ui_extra_networks_textual_inversion.py", line 13, in refresh
    sd_hijack.model_hijack.embedding_db.load_textual_inversion_embeddings(force_reload=True)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 255, in load_textual_inversion_embeddings
    self.expected_shape = self.get_expected_shape()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 154, in get_expected_shape
    vec = shared.sd_model.cond_stage_model.encode_embedding_init_text(",", 1)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/shared_items.py", line 110, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_models.py", line 499, in get_sd_model
    load_model()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_models.py", line 626, in load_model
    load_model_weights(sd_model, checkpoint_info, state_dict, timer)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_models.py", line 353, in load_model_weights
    model.load_state_dict(state_dict, strict=False)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 223, in <lambda>
    module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda *args, **kwargs: load_state_dict(module_load_state_dict, *args, **kwargs))
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 221, in load_state_dict
    original(module, state_dict, strict=strict)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2027, in load_state_dict
    load(self, state_dict)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  [Previous line repeated 3 more times]
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2009, in load
    module._load_from_state_dict(
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 226, in <lambda>
    conv2d_load_from_state_dict = self.replace(torch.nn.Conv2d, '_load_from_state_dict', lambda *args, **kwargs: load_from_state_dict(conv2d_load_from_state_dict, *args, **kwargs))
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 191, in load_from_state_dict
    module._parameters[name] = torch.nn.parameter.Parameter(torch.zeros_like(param, device=device, dtype=dtype), requires_grad=param.requires_grad)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_meta_registrations.py", line 1780, in zeros_like
    return aten.empty_like.default(
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_ops.py", line 287, in __call__
    return self._op(*args, **kwargs or {})
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_refs/__init__.py", line 4254, in empty_like
    return torch.empty_strided(
TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.

Stable diffusion model failed to load
Loading weights [75d035fa81] from /Users/xxxxxxxxxxxx/stable-diffusion-webui/models/Stable-diffusion/Frankenstein_v2.safetensors
Traceback (most recent call last):
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1431, in process_api
    result = await self.call_function(
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1103, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/ui_extra_networks.py", line 392, in pages_html
    return refresh()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/ui_extra_networks.py", line 398, in refresh
    pg.refresh()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/ui_extra_networks_textual_inversion.py", line 13, in refresh
    sd_hijack.model_hijack.embedding_db.load_textual_inversion_embeddings(force_reload=True)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 255, in load_textual_inversion_embeddings
    self.expected_shape = self.get_expected_shape()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 154, in get_expected_shape
    vec = shared.sd_model.cond_stage_model.encode_embedding_init_text(",", 1)
AttributeError: 'NoneType' object has no attribute 'cond_stage_model'
Creating model from config: /Users/xxxxxxxxxxxx/stable-diffusion-webui/configs/v1-inference.yaml
loading stable diffusion model: TypeError
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/python@3.10/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "/opt/homebrew/Cellar/python@3.10/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/gradio/utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/ui.py", line 1298, in <lambda>
    update_image_cfg_scale_visibility = lambda: gr.update(visible=shared.sd_model and shared.sd_model.cond_stage_key == "edit")
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/shared_items.py", line 110, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_models.py", line 499, in get_sd_model
    load_model()
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_models.py", line 626, in load_model
    load_model_weights(sd_model, checkpoint_info, state_dict, timer)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_models.py", line 353, in load_model_weights
    model.load_state_dict(state_dict, strict=False)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 223, in <lambda>
    module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda *args, **kwargs: load_state_dict(module_load_state_dict, *args, **kwargs))
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 221, in load_state_dict
    original(module, state_dict, strict=strict)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2027, in load_state_dict
    load(self, state_dict)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  [Previous line repeated 3 more times]
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2009, in load
    module._load_from_state_dict(
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 226, in <lambda>
    conv2d_load_from_state_dict = self.replace(torch.nn.Conv2d, '_load_from_state_dict', lambda *args, **kwargs: load_from_state_dict(conv2d_load_from_state_dict, *args, **kwargs))
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/modules/sd_disable_initialization.py", line 191, in load_from_state_dict
    module._parameters[name] = torch.nn.parameter.Parameter(torch.zeros_like(param, device=device, dtype=dtype), requires_grad=param.requires_grad)
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_meta_registrations.py", line 1780, in zeros_like
    return aten.empty_like.default(
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_ops.py", line 287, in __call__
    return self._op(*args, **kwargs or {})
  File "/Users/xxxxxxxxxxxx/stable-diffusion-webui/venv/lib/python3.10/site-packages/torch/_refs/__init__.py", line 4254, in empty_like
    return torch.empty_strided(
TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.

Stable diffusion model failed to load

Additional information

UlyssesHeart commented 10 months ago

Error

UlyssesHeart commented 10 months ago

This is solved. It was the extension DWPose. Do not use it!

UlyssesHeart commented 10 months ago

Unfortunately, I was wrong. This has not been solved. Thought it was DWPose, but something else must be doing it bcause it's happened again, and still is an issue after all extensions deleted.

BlinkerHigh commented 9 months ago

What was the problem?

AloeVera17 commented 8 months ago

It appears the issue was that the model broke, I reinstalled the .safetensors file and it worked.