mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-04 11:12:35 +00:00
Modular device management
This commit is contained in:

committed by
AUTOMATIC1111

parent
065e310a3f
commit
b5d1af11b7
@@ -9,6 +9,7 @@ import tqdm
|
||||
|
||||
import modules.artists
|
||||
from modules.paths import script_path, sd_path
|
||||
from modules.devices import get_optimal_device
|
||||
import modules.styles
|
||||
|
||||
config_filename = "config.json"
|
||||
@@ -43,12 +44,8 @@ parser.add_argument("--ui-config-file", type=str, help="filename to use for ui c
|
||||
|
||||
cmd_opts = parser.parse_args()
|
||||
|
||||
if torch.has_cuda:
|
||||
device = torch.device("cuda")
|
||||
elif torch.has_mps:
|
||||
device = torch.device("mps")
|
||||
else:
|
||||
device = torch.device("cpu")
|
||||
device = get_optimal_device()
|
||||
|
||||
batch_cond_uncond = cmd_opts.always_batch_cond_uncond or not (cmd_opts.lowvram or cmd_opts.medvram)
|
||||
parallel_processing_allowed = not cmd_opts.lowvram and not cmd_opts.medvram
|
||||
|
||||
|
Reference in New Issue
Block a user