Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit 09ed1ae

Browse files
Swap params
1 parent b5797d4 commit 09ed1ae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

utils/lora.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ def inject_inferable_lora(
479479
model,
480480
lora_path='',
481481
unet_replace_modules=["UNet3DConditionModel"],
482-
text_encoder_replace_modules=["CLIPTextModel"],
482+
text_encoder_replace_modules=["CLIPEncoderLayer"],
483483
is_extended=False,
484484
r=16
485485
):
@@ -499,7 +499,7 @@ def is_unet(f): return 'unet' in f and model.unet.__class__.__name__ == "UNet3DC
499499
monkeypatch_or_replace_lora(
500500
model.text_encoder,
501501
torch.load(lora_file),
502-
target_replace_module=unet_replace_modules,
502+
target_replace_module=text_encoder_replace_modules,
503503
r=r
504504
)
505505
print("Successfully loaded Text Encoder LoRa.")
@@ -509,7 +509,7 @@ def is_unet(f): return 'unet' in f and model.unet.__class__.__name__ == "UNet3DC
509509
monkeypatch_or_replace_lora_extended(
510510
model.unet,
511511
torch.load(lora_file),
512-
target_replace_module=text_encoder_replace_modules,
512+
target_replace_module=unet_replace_modules,
513513
r=r
514514
)
515515
print("Successfully loaded UNET LoRa.")

0 commit comments

Comments
 (0)