From 1b3eee672cec4bf89d06a72ddd5866f8e331aa7e Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Tue, 20 Aug 2024 00:31:04 -0400 Subject: [PATCH] Fix potential issue with multi devices. --- comfy/model_management.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comfy/model_management.py b/comfy/model_management.py index fb136bd1..27a3c9d6 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -979,7 +979,7 @@ def should_use_fp16(device=None, model_params=0, prioritize_performance=True, ma if torch.version.hip: return True - props = torch.cuda.get_device_properties("cuda") + props = torch.cuda.get_device_properties(device) if props.major >= 8: return True @@ -1035,7 +1035,7 @@ def should_use_bf16(device=None, model_params=0, prioritize_performance=True, ma if is_intel_xpu(): return True - props = torch.cuda.get_device_properties("cuda") + props = torch.cuda.get_device_properties(device) if props.major >= 8: return True