From 31b27afe69a8cabeabd051c1ffcf88fbe4549641 Mon Sep 17 00:00:00 2001 From: JettHu Date: Tue, 1 Jul 2025 11:19:13 +0800 Subject: [PATCH] Only enable torch.backends.cuda sdp(s) when not cpu mode --- comfy/model_management.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy/model_management.py b/comfy/model_management.py index 816caf18f..00ca26ecd 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -317,7 +317,7 @@ except: pass -if ENABLE_PYTORCH_ATTENTION: +if ENABLE_PYTORCH_ATTENTION and cpu_state != CPUState.CPU: torch.backends.cuda.enable_math_sdp(True) torch.backends.cuda.enable_flash_sdp(True) torch.backends.cuda.enable_mem_efficient_sdp(True)