Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
renzhc
diffusers_dcu
Commits
bc1d28c8
Unverified
Commit
bc1d28c8
authored
Dec 01, 2023
by
Patrick von Platen
Committed by
GitHub
Dec 01, 2023
Browse files
[From Single File] Allow Text Encoder to be passed (#6020)
Allow text encoder to be passed
parent
af378c1d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
src/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py
...diffusers/pipelines/stable_diffusion/convert_from_ckpt.py
+6
-3
No files found.
src/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py
View file @
bc1d28c8
...
@@ -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"
}
if
text_encoder
is
None
:
text_model
=
convert_open_clip_checkpoint
(
text_model
=
convert_open_clip_checkpoint
(
checkpoint
,
config_name
,
local_files_only
=
local_files_only
,
**
config_kwargs
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
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment