From 12da6ef581cd9f47a4341d74159ce32f3d2f3e8d Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Thu, 20 Feb 2025 09:29:59 -0500 Subject: [PATCH] Apparently directml supports fp16. --- comfy/model_management.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/comfy/model_management.py b/comfy/model_management.py index 9ff63f35d..9066e0dc2 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -1021,8 +1021,6 @@ def is_directml_enabled(): return False def should_use_fp16(device=None, model_params=0, prioritize_performance=True, manual_cast=False): - global directml_enabled - if device is not None: if is_device_cpu(device): return False @@ -1033,8 +1031,8 @@ def should_use_fp16(device=None, model_params=0, prioritize_performance=True, ma if FORCE_FP32: return False - if directml_enabled: - return False + if is_directml_enabled(): + return True if (device is not None and is_device_mps(device)) or mps_mode(): return True