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 ace step nan issue on some hardware/pytorch configs. (#12289)
comfyanonymous26dd7eb42180
diff --git a/comfy/text_encoders/llama.py b/comfy/text_encoders/llama.pyindex 3afd094d1..b6735d210 100644--- a/comfy/text_encoders/llama.py+++ b/comfy/text_encoders/llama.py@@ -651,10 +651,10 @@ class Llama2_(nn.Module):mask = Noneif attention_mask is not None:mask = 1.0 - attention_mask.to(x.dtype).reshape((attention_mask.shape[0], 1, -1, attention_mask.shape[-1])).expand(attention_mask.shape[0], 1, seq_len, attention_mask.shape[-1])- mask = mask.masked_fill(mask.to(torch.bool), torch.finfo(x.dtype).min)+ mask = mask.masked_fill(mask.to(torch.bool), torch.finfo(x.dtype).min / 4)if seq_len > 1:- causal_mask = torch.empty(past_len + seq_len, past_len + seq_len, dtype=x.dtype, device=x.device).fill_(torch.finfo(x.dtype).min).triu_(1)+ causal_mask = torch.empty(past_len + seq_len, past_len + seq_len, dtype=x.dtype, device=x.device).fill_(torch.finfo(x.dtype).min / 4).triu_(1)if mask is not None:mask += causal_maskelse: