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
a47f609f
Commit
a47f609f
authored
Jan 02, 2024
by
comfyanonymous
Browse files
Auto detect out_channels from model.
parent
79f73a4b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
comfy/model_detection.py
comfy/model_detection.py
+2
-1
No files found.
comfy/model_detection.py
View file @
a47f609f
...
@@ -34,7 +34,6 @@ def detect_unet_config(state_dict, key_prefix, dtype):
...
@@ -34,7 +34,6 @@ def detect_unet_config(state_dict, key_prefix, dtype):
unet_config
=
{
unet_config
=
{
"use_checkpoint"
:
False
,
"use_checkpoint"
:
False
,
"image_size"
:
32
,
"image_size"
:
32
,
"out_channels"
:
4
,
"use_spatial_transformer"
:
True
,
"use_spatial_transformer"
:
True
,
"legacy"
:
False
"legacy"
:
False
}
}
...
@@ -49,6 +48,7 @@ def detect_unet_config(state_dict, key_prefix, dtype):
...
@@ -49,6 +48,7 @@ def detect_unet_config(state_dict, key_prefix, dtype):
unet_config
[
"dtype"
]
=
dtype
unet_config
[
"dtype"
]
=
dtype
model_channels
=
state_dict
[
'{}input_blocks.0.0.weight'
.
format
(
key_prefix
)].
shape
[
0
]
model_channels
=
state_dict
[
'{}input_blocks.0.0.weight'
.
format
(
key_prefix
)].
shape
[
0
]
in_channels
=
state_dict
[
'{}input_blocks.0.0.weight'
.
format
(
key_prefix
)].
shape
[
1
]
in_channels
=
state_dict
[
'{}input_blocks.0.0.weight'
.
format
(
key_prefix
)].
shape
[
1
]
out_channels
=
state_dict
[
'{}out.2.weight'
.
format
(
key_prefix
)].
shape
[
0
]
num_res_blocks
=
[]
num_res_blocks
=
[]
channel_mult
=
[]
channel_mult
=
[]
...
@@ -122,6 +122,7 @@ def detect_unet_config(state_dict, key_prefix, dtype):
...
@@ -122,6 +122,7 @@ def detect_unet_config(state_dict, key_prefix, dtype):
transformer_depth_middle
=
-
1
transformer_depth_middle
=
-
1
unet_config
[
"in_channels"
]
=
in_channels
unet_config
[
"in_channels"
]
=
in_channels
unet_config
[
"out_channels"
]
=
out_channels
unet_config
[
"model_channels"
]
=
model_channels
unet_config
[
"model_channels"
]
=
model_channels
unet_config
[
"num_res_blocks"
]
=
num_res_blocks
unet_config
[
"num_res_blocks"
]
=
num_res_blocks
unet_config
[
"transformer_depth"
]
=
transformer_depth
unet_config
[
"transformer_depth"
]
=
transformer_depth
...
...
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