Skip to content

Commit

Permalink
fix: apply strength control correctly (maybe AUTOMATIC1111#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikubill committed Feb 13, 2023
1 parent 0e75238 commit 5d65a4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scripts/cldm.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ def forward2(*args, **kwargs):
model._original_forward = model.forward
model.forward = forward2.__get__(model, UNetModel)

def notify(self, cond_like):
def notify(self, cond_like, weight):
self.hint_cond = cond_like
self.weight = weight
# print(self.hint_cond.shape)

def restore(self, model):
Expand Down
2 changes: 1 addition & 1 deletion scripts/controlnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def restore_networks():

self.control = control
# control = torch.stack([control for _ in range(bsz)], dim=0)
self.latest_network.notify(control)
self.latest_network.notify(control, weight)

self.set_infotext_fields(p, self.latest_params)

Expand Down

0 comments on commit 5d65a4e

Please sign in to comment.