Skip to content

Commit 3d08d8d

Browse files
authored
fix loading custom text encoder when using from_single_file (huggingface#4571)
fix loading custom text encoder when using from_single_file
1 parent bdc4c32 commit 3d08d8d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,8 @@ def convert_ldm_clip_checkpoint(checkpoint, local_files_only=False, text_encoder
783783
ctx = init_empty_weights if is_accelerate_available() else nullcontext
784784
with ctx():
785785
text_model = CLIPTextModel(config)
786+
else:
787+
text_model = text_encoder
786788

787789
keys = list(checkpoint.keys())
788790

0 commit comments

Comments
 (0)