sd-webui-controlnet
sd-webui-controlnet copied to clipboard
MPS error on Apple M2Pro?
According to previous issues, I added --use-cpu all and --no-half to webui-user.sh like:
export COMMANDLINE_ARGS="--skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu all --no-half --disable-nan-check"
and add environment to webui-macos-env.sh
export PYTORCH_ENABLE_MPS_FALLBACK=1
however it report error:
RuntimeError: Input type (MPSFloatType) and weight type (torch.FloatTensor) should be the same
I traced into the code and found line 663 in controlnet.py:
control = torch.from_numpy(detected_map.copy()).float().to(devices.get_device_for("controlnet"))
and
which returns "mps". Does it mean control
is using MPS although I set use_cpu?
I wonder if I used wrong command_argument or it's a bug? Any solutions?
I removed
if has_mps(): return "mps"
and it works.
I removed
if has_mps(): return "mps"
and it works.
is it related to just controlnet or also the t2iadapter (style adapter) ?
testing to see if it works, but i do not find MPS calls in the controlnet.py
I have the same issue with the extension when trying to run t2iadapter_sketch-fp16 [75b15924] from https://huggingface.co/webui/ControlNet-modules-safetensors/tree/main the Controlnets are working just fine. (like diff_control_sd15_scribble_fp16 [1f29174d]) I'm also on running it on a MacPro with M1