Fix lowvram union controlnet bug.

This commit is contained in:
comfyanonymous 2024-07-17 10:16:31 -04:00
parent 1cde6b2eff
commit 281ad42df4

View File

@ -361,7 +361,7 @@ class ControlNet(nn.Module):
controlnet_cond = self.input_hint_block(hint[idx], emb, context) controlnet_cond = self.input_hint_block(hint[idx], emb, context)
feat_seq = torch.mean(controlnet_cond, dim=(2, 3)) feat_seq = torch.mean(controlnet_cond, dim=(2, 3))
if idx < len(control_type): 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)) inputs.append(feat_seq.unsqueeze(1))
condition_list.append(controlnet_cond) condition_list.append(controlnet_cond)