Skip to content

Commit

Permalink
Merge PR #138 from Kosinkadink/develop
Browse files Browse the repository at this point in the history
ControlNet++ fixes
  • Loading branch information
Kosinkadink committed Jul 18, 2024
2 parents 95d00fc + 906ef7f commit 9504251
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion adv_control/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ def load_controlnet(ckpt_path, timestep_keyframe: TimestepKeyframeGroup=None, mo
has_temporal_res_block_key = True
# ControlNet++ check
elif "task_embedding" in key:
raise Exception("ControlNet++ model detected; must be loaded using the Load ControlNet++ Model nodes.")
pass

if has_controlnet_key and has_motion_modules_key:
controlnet_type = ControlWeightType.SPARSECTRL
Expand Down
2 changes: 1 addition & 1 deletion adv_control/control_plusplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def union_controlnet_merge(self, hint: list[Tensor], control_type, emb, context)
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)
Expand Down

0 comments on commit 9504251

Please sign in to comment.