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
chenpangpang
ComfyUI
Commits
25b51b1a
Commit
25b51b1a
authored
Jul 25, 2024
by
comfyanonymous
Browse files
Hunyuan DiT lora support.
parent
61a2b00b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
comfy/lora.py
comfy/lora.py
+6
-0
No files found.
comfy/lora.py
View file @
25b51b1a
...
...
@@ -282,4 +282,10 @@ def model_lora_keys_unet(model, key_map={}):
key_lora
=
"transformer.{}"
.
format
(
k
[:
-
len
(
".weight"
)])
#simpletrainer and probably regular diffusers lora format
key_map
[
key_lora
]
=
to
if
isinstance
(
model
,
comfy
.
model_base
.
HunyuanDiT
):
for
k
in
sdk
:
if
k
.
startswith
(
"diffusion_model."
)
and
k
.
endswith
(
".weight"
):
key_lora
=
k
[
len
(
"diffusion_model."
):
-
len
(
".weight"
)]
key_map
[
"base_model.model.{}"
.
format
(
key_lora
)]
=
k
#official hunyuan lora format
return
key_map
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