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
1598a579
Commit
1598a579
authored
Mar 06, 2023
by
Patrick von Platen
Browse files
make style
parent
63805f8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
2 deletions
+0
-2
scripts/convert_lora_safetensor_to_diffusers.py
scripts/convert_lora_safetensor_to_diffusers.py
+0
-2
No files found.
scripts/convert_lora_safetensor_to_diffusers.py
View file @
1598a579
...
@@ -24,7 +24,6 @@ from diffusers import StableDiffusionPipeline
...
@@ -24,7 +24,6 @@ from diffusers import StableDiffusionPipeline
def
convert
(
base_model_path
,
checkpoint_path
,
LORA_PREFIX_UNET
,
LORA_PREFIX_TEXT_ENCODER
,
alpha
):
def
convert
(
base_model_path
,
checkpoint_path
,
LORA_PREFIX_UNET
,
LORA_PREFIX_TEXT_ENCODER
,
alpha
):
# load base model
# load base model
pipeline
=
StableDiffusionPipeline
.
from_pretrained
(
base_model_path
,
torch_dtype
=
torch
.
float32
)
pipeline
=
StableDiffusionPipeline
.
from_pretrained
(
base_model_path
,
torch_dtype
=
torch
.
float32
)
...
@@ -35,7 +34,6 @@ def convert(base_model_path, checkpoint_path, LORA_PREFIX_UNET, LORA_PREFIX_TEXT
...
@@ -35,7 +34,6 @@ def convert(base_model_path, checkpoint_path, LORA_PREFIX_UNET, LORA_PREFIX_TEXT
# directly update weight in diffusers model
# directly update weight in diffusers model
for
key
in
state_dict
:
for
key
in
state_dict
:
# it is suggested to print out the key, it usually will be something like below
# it is suggested to print out the key, it usually will be something like below
# "lora_te_text_model_encoder_layers_0_self_attn_k_proj.lora_down.weight"
# "lora_te_text_model_encoder_layers_0_self_attn_k_proj.lora_down.weight"
...
...
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