The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Remove unnecessary code.
comfyanonymous98f828fad986
diff --git a/comfy/ldm/modules/attention.py b/comfy/ldm/modules/attention.pyindex 426530867..88ee2f32d 100644--- a/comfy/ldm/modules/attention.py+++ b/comfy/ldm/modules/attention.py@@ -318,11 +318,7 @@ def attention_xformers(q, k, v, heads, mask=None, attn_precision=None):return attention_pytorch(q, k, v, heads, mask)q, k, v = map(- lambda t: t.unsqueeze(3)- .reshape(b, -1, heads, dim_head)- .permute(0, 2, 1, 3)- .reshape(b * heads, -1, dim_head)- .contiguous(),+ lambda t: t.reshape(b, -1, heads, dim_head),(q, k, v),)@@ -335,10 +331,7 @@ def attention_xformers(q, k, v, heads, mask=None, attn_precision=None):out = xformers.ops.memory_efficient_attention(q, k, v, attn_bias=mask)out = (- out.unsqueeze(0)- .reshape(b, heads, -1, dim_head)- .permute(0, 2, 1, 3)- .reshape(b, -1, heads * dim_head)+ out.reshape(b, -1, heads * dim_head))return outdiff --git a/comfy/ldm/modules/diffusionmodules/model.py b/comfy/ldm/modules/diffusionmodules/model.pyindex fabc5c5e5..04eb83b21 100644--- a/comfy/ldm/modules/diffusionmodules/model.py+++ b/comfy/ldm/modules/diffusionmodules/model.py@@ -3,7 +3,6 @@ import mathimport torchimport torch.nn as nnimport numpy as np-from einops import rearrangefrom typing import Optional, Anyimport logging