Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38238ea475 | ||
|
|
16c88765fd | ||
|
|
0785d73e38 | ||
|
|
70cb308c80 | ||
|
|
c39aad681a | ||
|
|
6dc99ad241 | ||
|
|
49e0628e73 | ||
|
|
d6d788b9ee |
+8
-2
@@ -116,8 +116,8 @@ class AttentionCouple:
|
||||
masks_uncond = get_masks_from_q(self.negative_positive_masks[0], q_list[0], extra_options["original_shape"])
|
||||
masks_cond = get_masks_from_q(self.negative_positive_masks[1], q_list[0], extra_options["original_shape"])
|
||||
|
||||
context_uncond = self.negative_positive_conds[0][0]
|
||||
context_cond = self.negative_positive_conds[1][0]
|
||||
context_uncond = torch.cat([cond for cond in self.negative_positive_conds[0]], dim=0)
|
||||
context_cond = torch.cat([cond for cond in self.negative_positive_conds[1]], dim=0)
|
||||
|
||||
k_uncond = module.to_k(context_uncond)
|
||||
k_cond = module.to_k(context_cond)
|
||||
@@ -138,7 +138,13 @@ class AttentionCouple:
|
||||
length = len_neg
|
||||
|
||||
q_target = q_list[i].repeat(length, 1, 1)
|
||||
k = torch.cat([k[i].unsqueeze(0).repeat(b,1,1) for i in range(length)], dim=0)
|
||||
v = torch.cat([v[i].unsqueeze(0).repeat(b,1,1) for i in range(length)], dim=0)
|
||||
|
||||
if k.dtype != q_target.dtype or v.dtype != q_target.dtype:
|
||||
# Ensure all dtypes match
|
||||
k = k.to(q_target.dtype)
|
||||
v = v.to(q_target.dtype)
|
||||
qkv = optimized_attention(q_target, k, v, extra_options["n_heads"])
|
||||
qkv = qkv * masks
|
||||
qkv = qkv.view(length, b, -1, module.heads * module.dim_head).sum(dim=0)
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
[project]
|
||||
name = "comfyui-comfycouple"
|
||||
description = "If you want to draw two different characters together without blending their features, so you could try to check out this custom node."
|
||||
version = "0.1.2"
|
||||
license = "GPL-3.0"
|
||||
version = "0.1.4"
|
||||
license = { text = "GNU General Public License v3.0" }
|
||||
|
||||
[project.urls]
|
||||
Repository = "https://github.com/Danand/ComfyUI-ComfyCouple"
|
||||
|
||||
Reference in New Issue
Block a user