Skip to content

Commit

Permalink
Merge branch 'master' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
jn-jairo committed Nov 9, 2023
2 parents 2501f8c + ec12000 commit 4716d45
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions comfy/lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,18 @@ def load_lora(lora, to_load):
loaded_keys.add(b_norm_name)
patch_dict["{}.bias".format(to_load[x][:-len(".weight")])] = (b_norm,)

diff_name = "{}.diff".format(x)
diff_weight = lora.get(diff_name, None)
if diff_weight is not None:
patch_dict[to_load[x]] = (diff_weight,)
loaded_keys.add(diff_name)

diff_bias_name = "{}.diff_b".format(x)
diff_bias = lora.get(diff_bias_name, None)
if diff_bias is not None:
patch_dict["{}.bias".format(to_load[x][:-len(".weight")])] = (diff_bias,)
loaded_keys.add(diff_bias_name)

for x in lora.keys():
if x not in loaded_keys:
print("lora key not loaded", x)
Expand Down

0 comments on commit 4716d45

Please sign in to comment.