sd-webui-controlnet
sd-webui-controlnet copied to clipboard
MacOS?
Is ControlNet compatible with MacOS. I could install it, and see it in the webUI, but when I use it, I get following error:
Loading preprocessor: canny, model: control_sd15_canny [fef5e48e] Loaded state_dict from [/Users/koen/Documents/SD/stable-diffusion-webui/extensions/sd-webui-controlnet/models/control_sd15_canny.pth] ControlNet model control_sd15_canny [fef5e48e] loaded. 0%| | 0/16 [00:00<?, ?it/s]loc("mps_add"("(mpsFileLoc): /AppleInternal/Library/BuildRoots/a0876c02-1788-11ed-b9c4-96898e02b808/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShadersGraph/mpsgraph/MetalPerformanceShadersGraph/Core/Files/MPSGraphUtilities.mm":219:0)): error: input types 'tensor<2x1280xf32>' and 'tensor<*xf16>' are not broadcast compatible LLVM ERROR: Failed to infer result type(s). zsh: abort ./webui.sh koen@Koens-MacBook-Pro-2 stable-diffusion-webui % /opt/homebrew/Cellar/[email protected]/3.10.10/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d '
Shortly after "Python quit unexpectedly"
Koen
Related: #68, will fix later
Make sure you start web UI with --no-half
for now. I do plan to try to get it working without --no-half
but it may be up to a few days until I have enough time for that.
--no-half seems to work. Thanks!!
Just a note to say that the latest commit of this repo works fine with A1111 on macOS (M2) and any model that is based on SD1.5 without the need of --no-half
. These are my startup flags (recommended by @brkirch in other threads) and OS environment:
--theme=dark --upcast-sampling --opt-sub-quad-attention --use-cpu interrogate
python: 3.10.9 • torch: 2.0.0 • xformers: N/A • gradio: 3.16.2 • commit: [3715ece0]
However, any attempt to use SD2.1 (even the 512x512px model) or a model based on it (e.g.,Future Diffusion or Robo Diffusion v2), will generate the following error:
(mpsFileLoc): /AppleInternal/Library/BuildRoots/9e200cfa-7d96-11ed-886f-a23c4f261b56/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShadersGraph/mpsgraph/MetalPerformanceShadersGraph/Core/Files/MPSGraphUtilities.mm:39:0: error: 'mps.matmul' op contracting dimensions differ 1024 & 768 (mpsFileLoc): /AppleInternal/Library/BuildRoots/9e200cfa-7d96-11ed-886f-a23c4f261b56/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShadersGraph/mpsgraph/MetalPerformanceShadersGraph/Core/Files/MPSGraphUtilities.mm:39:0: note: see current operation: %3 = "mps.matmul"(%arg0, %2) {transpose_lhs = false, transpose_rhs = false} : (tensor<2x77x1024xf32>, tensor<768x320xf32>) -> tensor<2x77x320xf32> ./automatic1111.sh: line 16: 27859 Segmentation fault: 11
and
/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d '
I tried to add --no-half
, but it makes no difference.
Also, flagging Upcast cross attention layer to float32
inside A1111 makes no difference either.
error: 'mps.matmul' op contracting dimensions differ 1024 & 768
Pretrained controlnet model is for sd1.5/sd1.4, not compatible with sd2/sd2.1/inpainting model.
another error seemingly related with macOS or could the execution model be a problem - currently using wd15 should I use default sd? --no-half is added
(mpsFileLoc): /AppleInternal/Library/BuildRoots/97f6331a-ba75-11ed-a4bc-863efbbaf80d/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShadersGraph/mpsgraph/MetalPerformanceShadersGraph/Core/Files/MPSGraphUtilities.mm:39:0: error: 'mps.matmul' op contracting dimensions differ 1024 & 768 (mpsFileLoc): /AppleInternal/Library/BuildRoots/97f6331a-ba75-11ed-a4bc-863efbbaf80d/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShadersGraph/mpsgraph/MetalPerformanceShadersGraph/Core/Files/MPSGraphUtilities.mm:39:0: note: see current operation: %5 = "mps.matmul"(%arg0, %4) {transpose_lhs = false, transpose_rhs = false} : (tensor<2x77x1024xf32>, tensor<768x320xf32>) -> tensor<2x77x320xf32> /opt/homebrew/Cellar/[email protected]/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d ' zsh: segmentation fault sh webui.sh
ok edit: seems to run with default so next question - can I get it to run with another model
the same error happy "segmentation fault":
- success commit: 9ea19a74a027a29e0a80c1b9f901331a82d63db3
- error commit: ca03f4e3d8a4839009af083d305aa195be956c01