mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-27 17:22:53 +03:00
[From Single File] Allow Text Encoder to be passed (#6020)
Allow text encoder to be passed
This commit is contained in:
committed by
GitHub
parent
af378c1dd1
commit
bc1d28c888
@@ -1480,9 +1480,12 @@ def download_from_original_stable_diffusion_ckpt(
|
||||
config_name = "stabilityai/stable-diffusion-2"
|
||||
config_kwargs = {"subfolder": "text_encoder"}
|
||||
|
||||
text_model = convert_open_clip_checkpoint(
|
||||
checkpoint, config_name, local_files_only=local_files_only, **config_kwargs
|
||||
)
|
||||
if text_encoder is None:
|
||||
text_model = convert_open_clip_checkpoint(
|
||||
checkpoint, config_name, local_files_only=local_files_only, **config_kwargs
|
||||
)
|
||||
else:
|
||||
text_model = text_encoder
|
||||
|
||||
try:
|
||||
tokenizer = CLIPTokenizer.from_pretrained(
|
||||
|
||||
Reference in New Issue
Block a user