Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Fix potential issue with multi devices.

comfyanonymous1b3eee672cec
diff --git a/comfy/model_management.py b/comfy/model_management.py
index fb136bd1e..27a3c9d68 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