From 279052a5e9625b0d912342c75b4317afafc63b21 Mon Sep 17 00:00:00 2001 From: nullquant Date: Sat, 4 May 2024 12:26:12 +0300 Subject: [PATCH] add_text_embeds shape --- brushnet/brushnet.py | 6 +++--- brushnet_nodes.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/brushnet/brushnet.py b/brushnet/brushnet.py index 41ace1d..93a32bd 100644 --- a/brushnet/brushnet.py +++ b/brushnet/brushnet.py @@ -751,8 +751,8 @@ class BrushNetModel(ModelMixin, ConfigMixin): if timestep is None and time_emb is None: raise ValueError(f"`timestep` and `emb` are both None") - print("BN: sample.device", sample.device) - print("BN: TE.device", self.time_embedding.linear_1.weight.device) + #print("BN: sample.device", sample.device) + #print("BN: TE.device", self.time_embedding.linear_1.weight.device) if timestep is not None: # 1. time @@ -779,7 +779,7 @@ class BrushNetModel(ModelMixin, ConfigMixin): # there might be better ways to encapsulate this. t_emb = t_emb.to(dtype=sample.dtype) - print("t_emb.device =",t_emb.device) + #print("t_emb.device =",t_emb.device) emb = self.time_embedding(t_emb, timestep_cond) aug_emb = None diff --git a/brushnet_nodes.py b/brushnet_nodes.py index d8702cc..d111b3b 100644 --- a/brushnet_nodes.py +++ b/brushnet_nodes.py @@ -265,7 +265,7 @@ class BrushNet: print('BrushNet: negative conditioning has not pooled_output') if is_SDXL: print('BrushNet will not produce correct results') - negative_pooled_prompt_embeds = torch.empty([1, 1280], device=brushnet['brushnet'].device) + negative_pooled_prompt_embeds = torch.empty([1, add_text_embeds.shape[1]], device=brushnet['brushnet'].device) add_time_ids = torch.FloatTensor([[height, width, 0., 0., height, width]]).to(brushnet['brushnet'].device) negative_add_time_ids = add_time_ids