Skip to content

Commit 787195f

Browse files
Fix/controlnet lora (huggingface#5157)
* print * print * print * print * print * debugging * debugging * debugging * debugging * safer condition. * remove prints and try excepts. * Empty-Commit * Apply suggestions from code review --------- Co-authored-by: Patrick von Platen <[email protected]>
1 parent 48664d6 commit 787195f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/diffusers/loaders.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,7 +1922,7 @@ def _convert_kohya_lora_to_diffusers(cls, state_dict):
19221922
diffusers_name = diffusers_name.replace("emb.layers", "time_emb_proj")
19231923

19241924
# SDXL specificity.
1925-
if "emb" in diffusers_name and "time" not in diffusers_name:
1925+
if "emb" in diffusers_name and "time.emb.proj" not in diffusers_name:
19261926
pattern = r"\.\d+(?=\D*$)"
19271927
diffusers_name = re.sub(pattern, "", diffusers_name, count=1)
19281928
if ".in." in diffusers_name:
@@ -1935,7 +1935,7 @@ def _convert_kohya_lora_to_diffusers(cls, state_dict):
19351935
diffusers_name = diffusers_name.replace("skip.connection", "conv_shortcut")
19361936

19371937
# LyCORIS specificity.
1938-
if "time" in diffusers_name:
1938+
if "time.emb.proj" in diffusers_name:
19391939
diffusers_name = diffusers_name.replace("time.emb.proj", "time_emb_proj")
19401940
if "conv.shortcut" in diffusers_name:
19411941
diffusers_name = diffusers_name.replace("conv.shortcut", "conv_shortcut")

0 commit comments

Comments
 (0)