Skip to content

Commit

Permalink
Fix lowvram union controlnet bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Jul 17, 2024
1 parent 1cde6b2 commit 281ad42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion comfy/cldm/cldm.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def union_controlnet_merge(self, hint, control_type, emb, context):
controlnet_cond = self.input_hint_block(hint[idx], emb, context)
feat_seq = torch.mean(controlnet_cond, dim=(2, 3))
if idx < len(control_type):
feat_seq += self.task_embedding[control_type[idx]]
feat_seq += self.task_embedding[control_type[idx]].to(dtype=feat_seq.dtype, device=feat_seq.device)

inputs.append(feat_seq.unsqueeze(1))
condition_list.append(controlnet_cond)
Expand Down

0 comments on commit 281ad42

Please sign in to comment.