Unverified Commit bc1d28c8 authored by Patrick von Platen's avatar Patrick von Platen Committed by GitHub
Browse files

[From Single File] Allow Text Encoder to be passed (#6020)

Allow text encoder to be passed
parent af378c1d
...@@ -1480,9 +1480,12 @@ def download_from_original_stable_diffusion_ckpt( ...@@ -1480,9 +1480,12 @@ def download_from_original_stable_diffusion_ckpt(
config_name = "stabilityai/stable-diffusion-2" config_name = "stabilityai/stable-diffusion-2"
config_kwargs = {"subfolder": "text_encoder"} config_kwargs = {"subfolder": "text_encoder"}
text_model = convert_open_clip_checkpoint( if text_encoder is None:
checkpoint, config_name, local_files_only=local_files_only, **config_kwargs text_model = convert_open_clip_checkpoint(
) checkpoint, config_name, local_files_only=local_files_only, **config_kwargs
)
else:
text_model = text_encoder
try: try:
tokenizer = CLIPTokenizer.from_pretrained( tokenizer = CLIPTokenizer.from_pretrained(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment