Skip to content

Commit

Permalink
Update devices.py
Browse files Browse the repository at this point in the history
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

AUTOMATIC1111#14097
  • Loading branch information
read-0nly authored and ruchej committed Sep 30, 2024
1 parent 7e4376b commit 6180a63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 6180a63

Please sign in to comment.