aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobsol <33932119+read-0nly@users.noreply.github.com>2023-11-28 00:21:43 +0000
committerGitHub <noreply@github.com>2023-11-28 00:21:43 +0000
commit3cd6e1d0a0877e6f1ac931c8253e6eee09da3805 (patch)
tree10267d6eb79879821398684429012d79a8d29da1
parent4afaaf8a020c1df457bcf7250cb1c7f609699fa7 (diff)
downloadstable-diffusion-webui-gfx803-3cd6e1d0a0877e6f1ac931c8253e6eee09da3805.tar.gz
stable-diffusion-webui-gfx803-3cd6e1d0a0877e6f1ac931c8253e6eee09da3805.tar.bz2
stable-diffusion-webui-gfx803-3cd6e1d0a0877e6f1ac931c8253e6eee09da3805.zip
Update devices.py
fixes issue where "--use-cpu" all properly makes SD run on CPU but leaves ControlNet (and other extensions, I presume) pointed at GPU, causing a crash in ControlNet caused by a mismatch between devices between SD and CN https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/14097
-rw-r--r--modules/devices.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/devices.py b/modules/devices.py
index c01f0602..65efcf1e 100644
--- a/modules/devices.py
+++ b/modules/devices.py
@@ -38,7 +38,7 @@ def get_optimal_device():
def get_device_for(task):
- if task in shared.cmd_opts.use_cpu:
+ if task in shared.cmd_opts.use_cpu or "all" in shared.cmd_opts.use_cpu:
return cpu
return get_optimal_device()