Skip to content

Commit 9504251

Browse files
authored
Merge PR #138 from Kosinkadink/develop
ControlNet++ fixes
2 parents 95d00fc + 906ef7f commit 9504251

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

adv_control/control.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ def load_controlnet(ckpt_path, timestep_keyframe: TimestepKeyframeGroup=None, mo
545545
has_temporal_res_block_key = True
546546
# ControlNet++ check
547547
elif "task_embedding" in key:
548-
raise Exception("ControlNet++ model detected; must be loaded using the Load ControlNet++ Model nodes.")
548+
pass
549549

550550
if has_controlnet_key and has_motion_modules_key:
551551
controlnet_type = ControlWeightType.SPARSECTRL

adv_control/control_plusplus.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def union_controlnet_merge(self, hint: list[Tensor], control_type, emb, context)
164164
controlnet_cond = self.input_hint_block(hint[indexes[idx][0]], emb, context)
165165
feat_seq = torch.mean(controlnet_cond, dim=(2, 3))
166166
if idx < indexes.shape[0]:
167-
feat_seq += self.task_embedding[indexes[idx][0]]
167+
feat_seq += self.task_embedding[indexes[idx][0]].to(dtype=feat_seq.dtype, device=feat_seq.device)
168168

169169
inputs.append(feat_seq.unsqueeze(1))
170170
condition_list.append(controlnet_cond)

0 commit comments

Comments
 (0)