Fix ControlNet++ lowvram issue with task_embedding

This commit is contained in:
Jedrzej Kosinski
2024-07-18 14:04:24 -05:00
parent 10ad2e68e3
commit a895854a8e
+1 -1
View File
@@ -164,7 +164,7 @@ class ControlNetPlusPlus(ControlNetCLDM):
controlnet_cond = self.input_hint_block(hint[indexes[idx][0]], emb, context)
feat_seq = torch.mean(controlnet_cond, dim=(2, 3))
if idx < indexes.shape[0]:
feat_seq += self.task_embedding[indexes[idx][0]]
feat_seq += self.task_embedding[indexes[idx][0]].to(dtype=feat_seq.dtype, device=feat_seq.device)
inputs.append(feat_seq.unsqueeze(1))
condition_list.append(controlnet_cond)