From cbd3ba3dec9cb0a64bd308e6dfacad3c9cadbbd9 Mon Sep 17 00:00:00 2001 From: Jon Vojtush <11096910+nomadicGopher@users.noreply.github.com> Date: Fri, 17 Apr 2026 05:19:38 +0000 Subject: [PATCH] Update model_management.py fallback to cpu if nvidia is not available --- comfy/model_management.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/comfy/model_management.py b/comfy/model_management.py index bcf1399c4..42030e557 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -203,8 +203,10 @@ def get_torch_device(): return torch.device("npu", torch.npu.current_device()) elif is_mlu(): return torch.device("mlu", torch.mlu.current_device()) - else: + elif torch.cuda.is_available(): return torch.device(torch.cuda.current_device()) + else: + return torch.device("cpu") def get_total_memory(dev=None, torch_total_too=False): global directml_enabled