M3 MacBook Pro で報告されたケースですが、画像生成AIのモデル、つまり SD1.5やSDXL、もしくは bluePencilXL と言ったモデルの切り替えに失敗することがあります。 エラーメッセージの例
changing setting sd_model_checkpoint to bluePencilXL_v600.safetensors [83f960c769]: AttributeError
Stability Matrixにはこのようなログが表示されます。
Python 3.10.11 (main, May 7 2023, 17:32:05) [Clang 16.0.3 ]
Version: v1.9.4
Commit hash: feee37d75f1b168768014e4634dcb156ee649c05
ControlNet init warning: Unable to install insightface automatically. Please try run `pip install insightface` manually.
Launching Web UI with arguments: --medvram-sdxl --api --skip-torch-cuda-test --skip-python-version-check --no-half --gradio-allowed-path /Users/username/apps/StabilityMatrix/Images
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
ControlNet preprocessor location: /Users/username/apps/StabilityMatrix/Packages/Stable-Diffusion-WebUI/extensions/sd-webui-controlnet/annotator/downloads
2024-06-11 08:11:57,602 - ControlNet - INFO - ControlNet v1.1.449
Loading weights [1449e5b0b9] from /Users/username/apps/StabilityMatrix/Packages/Stable-Diffusion-WebUI/models/Stable-diffusion/animagineXLV31_v30.safetensors
2024-06-11 08:11:57,929 - ControlNet - INFO - ControlNet UI callback registered.
Running on local URL: http://127.0.0.1:7860
To create a public link, set `share=True` in `launch()`.
Creating model from config: /Users/username/apps/StabilityMatrix/Packages/Stable-Diffusion-WebUI/repositories/generative-models/configs/inference/sd_xl_base.yaml
/Users/username/apps/StabilityMatrix/Packages/Stable-Diffusion-WebUI/venv/lib/python3.10/site-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
warnings.warn(
Startup time: 8.8s (prepare environment: 0.4s, import torch: 3.3s, import gradio: 0.8s, setup paths: 1.1s, initialize shared: 0.2s, other imports: 0.9s, load scripts: 0.8s, create ui: 0.5s, gradio launch: 0.4s, add APIs: 0.5s).
changing setting sd_model_checkpoint to bluePencilXL_v600.safetensors [83f960c769]: AttributeError
Traceback (most recent call last):
File "/Users/username/apps/StabilityMatrix/Packages/Stable-Diffusion-WebUI/modules/options.py", line 165, in set
option.onchange()
File "/Users/username/apps/StabilityMatrix/Packages/Stable-Diffusion-WebUI/modules/call_queue.py", line 13, in f
res = func(*args, **kwargs)
File "/Users/username/apps/StabilityMatrix/Packages/Stable-Diffusion-WebUI/modules/initialize_util.py", line 181, in <lambda>
shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: sd_models.reload_model_weights()), call=False)
File "/Users/username/apps/StabilityMatrix/Packages/Stable-Diffusion-WebUI/modules/sd_models.py", line 860, in reload_model_weights
sd_model = reuse_model_from_already_loaded(sd_model, checkpoint_info, timer)
File "/Users/username/apps/StabilityMatrix/Packages/Stable-Diffusion-WebUI/modules/sd_models.py", line 793, in reuse_model_from_already_loaded
send_model_to_cpu(sd_model)
File "/Users/username/apps/StabilityMatrix/Packages/Stable-Diffusion-WebUI/modules/sd_models.py", line 662, in send_model_to_cpu
if m.lowvram:
AttributeError: 'NoneType' object has no attribute 'lowvram'
Loading VAE weights specified in settings: /Users/username/apps/StabilityMatrix/Packages/Stable-Diffusion-WebUI/models/VAE/sdxl_vae.safetensors
Applying attention optimization: sub-quadratic... done.
Model loaded in 28.7s (load weights from disk: 0.8s, create model: 1.3s, apply weights to model: 10.7s, apply float(): 8.3s, load VAE: 2.0s, load weights from state dict: 0.1s, hijack: 0.6s, load textual inversion embeddings: 0.7s, calculate empty prompt: 3.9s).
AttributeError: ‘NoneType’ object has no attribute ‘lowvram’: このエラーはsd_modelがNoneであることを示しています。つまり、モデルが正しくロードされていない可能性があります。この問題は、モデルのロードプロセスで何かが失敗しているか、チェックポイントファイルが正しくないか、または欠落しているために発生することがあります。
2024/7/12にご報告いただいたケース (新品のWindows11) > Stable Diffusion Web UI v1.9.4をパッケージに追加して、Launchを押すと、いろいろ文字が出て、最後に
File “C:\Data\Packages\stable-diffusion-webui\repositories\k-diffusion\k_diffusion\config.py”, line 6, in <module> from jsonmerge import merge ModuleNotFoundError: No module named ‘jsonmerge’