Mikubill / sd-webui-controlnet

WebUI extension for ControlNet
GNU General Public License v3.0
16.83k stars 1.94k forks source link

[Bug]: Apple Silicon, seg_ofade20k, and seg_ofcoco preprocessing generate preview errors. #970

Closed Gitawake closed 1 year ago

Gitawake commented 1 year ago

Is there an existing issue for this?

What happened?

Preprocessing with Apple Silicon, seg_ofade20k, and seg_ofcoco generates preview errors that may even cause unexpected exits in Python.

截屏2023-04-22 14 13 35

Steps to reproduce the problem

  1. Click on Enable
  2. Click on Allow Preview
  3. import images
  4. Select seg_ofade20k preprocessing, model selection seg
  5. Click to generate preview

What should have happened?

Generate preview images in a normal production process (even if Apple Silicon is not supported, it should not cause unexpected exits in Python).

Commit where the problem happens

webui: controlnet:

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

No

Console logs

./webui.sh

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

################################################################
Running on gitawake0w user
################################################################

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

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

################################################################
Launching launch.py...
################################################################
Python 3.10.11 (main, Apr  7 2023, 07:24:53) [Clang 14.0.0 (clang-1400.0.29.202)]
Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
Installing requirements for Web UI

Launching Web UI with arguments: --skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate
Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled
No module 'xformers'. Proceeding without it.
Loading weights [fc2511737a] from /Users/gitawake0w/PycharmProjects/stable-diffusion-webui/models/Stable-diffusion/chilloutmix_NiPrunedFp32Fix.safetensors
Creating model from config: /Users/gitawake0w/PycharmProjects/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying cross attention optimization (InvokeAI).
Textual inversion embeddings loaded(0): 
Model loaded in 2.2s (load weights from disk: 0.2s, create model: 0.5s, apply weights to model: 0.6s, apply half(): 0.3s, move model to device: 0.6s).
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 5.1s (import torch: 0.7s, import gradio: 0.6s, import ldm: 0.3s, other imports: 0.5s, load scripts: 0.5s, load SD checkpoint: 2.2s, create ui: 0.2s).
ControlNet preprocessor location: /Users/gitawake0w/PycharmProjects/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads
Loading config /Users/gitawake0w/PycharmProjects/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/oneformer/configs/ade20k/oneformer_swin_large_IN21k_384_bs16_160k.yaml with yaml.unsafe_load. Your machine may be at risk if the file contains malicious content.
Loading config /Users/gitawake0w/PycharmProjects/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/oneformer/configs/ade20k/Base-ADE20K-UnifiedSegmentation.yaml with yaml.unsafe_load. Your machine may be at risk if the file contains malicious content.
/AppleInternal/Library/BuildRoots/9941690d-bcf7-11ed-a645-863efbbaf80d/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShaders/MPSCore/Types/MPSNDArray.mm:794: failed assertion `[MPSNDArray, initWithBuffer:descriptor:] Error: buffer is not large enough. Must be 97344 bytes
'
zsh: abort      ./webui.sh

Additional information

No response

Gitawake commented 1 year ago

seg_ofcoco logs:


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

################################################################
Running on gitawake0w user
################################################################

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

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

################################################################
Launching launch.py...
################################################################
Python 3.10.11 (main, Apr  7 2023, 07:24:53) [Clang 14.0.0 (clang-1400.0.29.202)]
Commit hash: 22bcc7be428c94e9408f589966c2040187245d81
Installing requirements for Web UI

Launching Web UI with arguments: --skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate
Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled
No module 'xformers'. Proceeding without it.
Loading weights [fc2511737a] from /Users/gitawake0w/PycharmProjects/stable-diffusion-webui/models/Stable-diffusion/chilloutmix_NiPrunedFp32Fix.safetensors
Creating model from config: /Users/gitawake0w/PycharmProjects/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying cross attention optimization (InvokeAI).
Textual inversion embeddings loaded(0): 
Model loaded in 3.4s (load weights from disk: 0.1s, create model: 0.5s, apply weights to model: 1.8s, apply half(): 0.3s, move model to device: 0.6s).
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 6.3s (import torch: 0.7s, import gradio: 0.6s, import ldm: 0.3s, other imports: 0.5s, load scripts: 0.5s, load SD checkpoint: 3.4s, create ui: 0.2s).
ControlNet preprocessor location: /Users/gitawake0w/PycharmProjects/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads
/AppleInternal/Library/BuildRoots/9941690d-bcf7-11ed-a645-863efbbaf80d/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShaders/MPSCore/Types/MPSNDArray.mm:794: failed assertion `[MPSNDArray, initWithBuffer:descriptor:] Error: buffer is not large enough. Must be 147456 bytes
'
zsh: abort      ./webui.sh```
lllyasviel commented 1 year ago

of does not work with apple