Skip to content

Commit

Permalink
It doesn't make sense for c_crossattn and c_concat to be lists.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Aug 31, 2023
1 parent 5f101f4 commit 1c012d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions comfy/model_base.py
Expand Up @@ -50,10 +50,10 @@ def register_schedule(self, given_betas=None, beta_schedule="linear", timesteps=

def apply_model(self, x, t, c_concat=None, c_crossattn=None, c_adm=None, control=None, transformer_options={}):
if c_concat is not None:
xc = torch.cat([x] + c_concat, dim=1)
xc = torch.cat([x] + [c_concat], dim=1)
else:
xc = x
context = torch.cat(c_crossattn, 1)
context = c_crossattn
dtype = self.get_dtype()
xc = xc.to(dtype)
t = t.to(dtype)
Expand Down
4 changes: 2 additions & 2 deletions comfy/samplers.py
Expand Up @@ -165,9 +165,9 @@ def cond_cat(c_list):
c_crossattn_out.append(c)

if len(c_crossattn_out) > 0:
out['c_crossattn'] = [torch.cat(c_crossattn_out)]
out['c_crossattn'] = torch.cat(c_crossattn_out)
if len(c_concat) > 0:
out['c_concat'] = [torch.cat(c_concat)]
out['c_concat'] = torch.cat(c_concat)
if len(c_adm) > 0:
out['c_adm'] = torch.cat(c_adm)
return out
Expand Down

0 comments on commit 1c012d6

Please sign in to comment.