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
603f02d6
"vscode:/vscode.git/clone" did not exist on "1be66f985aeefdcfc90082f09e0402ee59ca5e50"
Commit
603f02d6
authored
Jul 05, 2023
by
comfyanonymous
Browse files
Fix loras not working when loading checkpoint with config.
parent
ccb1b259
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
comfy/utils.py
comfy/utils.py
+4
-2
No files found.
comfy/utils.py
View file @
603f02d6
...
@@ -140,8 +140,10 @@ def unet_to_diffusers(unet_config):
...
@@ -140,8 +140,10 @@ def unet_to_diffusers(unet_config):
channel_mult
=
unet_config
[
"channel_mult"
]
channel_mult
=
unet_config
[
"channel_mult"
]
transformer_depth
=
unet_config
[
"transformer_depth"
]
transformer_depth
=
unet_config
[
"transformer_depth"
]
num_blocks
=
len
(
channel_mult
)
num_blocks
=
len
(
channel_mult
)
if
not
isinstance
(
num_res_blocks
,
lis
t
):
if
isinstance
(
num_res_blocks
,
in
t
):
num_res_blocks
=
[
num_res_blocks
]
*
num_blocks
num_res_blocks
=
[
num_res_blocks
]
*
num_blocks
if
isinstance
(
transformer_depth
,
int
):
transformer_depth
=
[
transformer_depth
]
*
num_blocks
transformers_per_layer
=
[]
transformers_per_layer
=
[]
res
=
1
res
=
1
...
@@ -152,7 +154,7 @@ def unet_to_diffusers(unet_config):
...
@@ -152,7 +154,7 @@ def unet_to_diffusers(unet_config):
transformers_per_layer
.
append
(
transformers
)
transformers_per_layer
.
append
(
transformers
)
res
*=
2
res
*=
2
transformers_mid
=
unet_config
.
get
(
"transformer_depth_middle"
,
transformer
s_per_layer
[
-
1
])
transformers_mid
=
unet_config
.
get
(
"transformer_depth_middle"
,
transformer
_depth
[
-
1
])
diffusers_unet_map
=
{}
diffusers_unet_map
=
{}
for
x
in
range
(
num_blocks
):
for
x
in
range
(
num_blocks
):
...
...
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