From cd7eb9bd362daafc6ea1b539e3ac78088619e5ba Mon Sep 17 00:00:00 2001 From: patientx Date: Sun, 11 May 2025 20:39:42 +0300 Subject: [PATCH] "Boolean value of Tensor with more than one value is ambiguous" fix --- comfy/customzluda/zluda.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy/customzluda/zluda.py b/comfy/customzluda/zluda.py index 5d02c7b8c..a96c3e849 100644 --- a/comfy/customzluda/zluda.py +++ b/comfy/customzluda/zluda.py @@ -261,7 +261,7 @@ def do_hijack(): def amd_flash_wrapper(query, key, value, attn_mask=None, dropout_p=0.0, is_causal=False, scale=None): try: if (query.shape[-1] <= 128 and - not attn_mask and + attn_mask is None and # fix flash-attention error : "Flash attention error: Boolean value of Tensor with more than one value is ambiguous" query.dtype != torch.float32): if scale is None: scale = query.shape[-1] ** -0.5