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
5d6dfce5
Commit
5d6dfce5
authored
Nov 24, 2023
by
comfyanonymous
Browse files
Fix importing diffusers unets.
parent
e020ab61
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
10 deletions
+20
-10
comfy/model_detection.py
comfy/model_detection.py
+20
-10
No files found.
comfy/model_detection.py
View file @
5d6dfce5
...
...
@@ -232,52 +232,62 @@ def unet_config_from_diffusers_unet(state_dict, dtype):
SDXL
=
{
'use_checkpoint'
:
False
,
'image_size'
:
32
,
'out_channels'
:
4
,
'use_spatial_transformer'
:
True
,
'legacy'
:
False
,
'num_classes'
:
'sequential'
,
'adm_in_channels'
:
2816
,
'dtype'
:
dtype
,
'in_channels'
:
4
,
'model_channels'
:
320
,
'num_res_blocks'
:
[
2
,
2
,
2
],
'transformer_depth'
:
[
0
,
0
,
2
,
2
,
10
,
10
],
'channel_mult'
:
[
1
,
2
,
4
],
'transformer_depth_middle'
:
10
,
'use_linear_in_transformer'
:
True
,
'context_dim'
:
2048
,
'num_head_channels'
:
64
,
'transformer_depth_output'
:
[
0
,
0
,
0
,
2
,
2
,
2
,
10
,
10
,
10
]}
'use_linear_in_transformer'
:
True
,
'context_dim'
:
2048
,
'num_head_channels'
:
64
,
'transformer_depth_output'
:
[
0
,
0
,
0
,
2
,
2
,
2
,
10
,
10
,
10
],
'use_temporal_attention'
:
False
,
'use_temporal_resblock'
:
False
}
SDXL_refiner
=
{
'use_checkpoint'
:
False
,
'image_size'
:
32
,
'out_channels'
:
4
,
'use_spatial_transformer'
:
True
,
'legacy'
:
False
,
'num_classes'
:
'sequential'
,
'adm_in_channels'
:
2560
,
'dtype'
:
dtype
,
'in_channels'
:
4
,
'model_channels'
:
384
,
'num_res_blocks'
:
[
2
,
2
,
2
,
2
],
'transformer_depth'
:
[
0
,
0
,
4
,
4
,
4
,
4
,
0
,
0
],
'channel_mult'
:
[
1
,
2
,
4
,
4
],
'transformer_depth_middle'
:
4
,
'use_linear_in_transformer'
:
True
,
'context_dim'
:
1280
,
'num_head_channels'
:
64
,
'transformer_depth_output'
:
[
0
,
0
,
0
,
4
,
4
,
4
,
4
,
4
,
4
,
0
,
0
,
0
]}
'use_linear_in_transformer'
:
True
,
'context_dim'
:
1280
,
'num_head_channels'
:
64
,
'transformer_depth_output'
:
[
0
,
0
,
0
,
4
,
4
,
4
,
4
,
4
,
4
,
0
,
0
,
0
],
'use_temporal_attention'
:
False
,
'use_temporal_resblock'
:
False
}
SD21
=
{
'use_checkpoint'
:
False
,
'image_size'
:
32
,
'out_channels'
:
4
,
'use_spatial_transformer'
:
True
,
'legacy'
:
False
,
'adm_in_channels'
:
None
,
'dtype'
:
dtype
,
'in_channels'
:
4
,
'model_channels'
:
320
,
'num_res_blocks'
:
[
2
,
2
,
2
,
2
],
'transformer_depth'
:
[
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
],
'channel_mult'
:
[
1
,
2
,
4
,
4
],
'transformer_depth_middle'
:
1
,
'use_linear_in_transformer'
:
True
,
'context_dim'
:
1024
,
'num_head_channels'
:
64
,
'transformer_depth_output'
:
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
]}
'context_dim'
:
1024
,
'num_head_channels'
:
64
,
'transformer_depth_output'
:
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
],
'use_temporal_attention'
:
False
,
'use_temporal_resblock'
:
False
}
SD21_uncliph
=
{
'use_checkpoint'
:
False
,
'image_size'
:
32
,
'out_channels'
:
4
,
'use_spatial_transformer'
:
True
,
'legacy'
:
False
,
'num_classes'
:
'sequential'
,
'adm_in_channels'
:
2048
,
'dtype'
:
dtype
,
'in_channels'
:
4
,
'model_channels'
:
320
,
'num_res_blocks'
:
[
2
,
2
,
2
,
2
],
'transformer_depth'
:
[
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
],
'channel_mult'
:
[
1
,
2
,
4
,
4
],
'transformer_depth_middle'
:
1
,
'use_linear_in_transformer'
:
True
,
'context_dim'
:
1024
,
'num_head_channels'
:
64
,
'transformer_depth_output'
:
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
]}
'use_linear_in_transformer'
:
True
,
'context_dim'
:
1024
,
'num_head_channels'
:
64
,
'transformer_depth_output'
:
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
],
'use_temporal_attention'
:
False
,
'use_temporal_resblock'
:
False
}
SD21_unclipl
=
{
'use_checkpoint'
:
False
,
'image_size'
:
32
,
'out_channels'
:
4
,
'use_spatial_transformer'
:
True
,
'legacy'
:
False
,
'num_classes'
:
'sequential'
,
'adm_in_channels'
:
1536
,
'dtype'
:
dtype
,
'in_channels'
:
4
,
'model_channels'
:
320
,
'num_res_blocks'
:
[
2
,
2
,
2
,
2
],
'transformer_depth'
:
[
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
],
'channel_mult'
:
[
1
,
2
,
4
,
4
],
'transformer_depth_middle'
:
1
,
'use_linear_in_transformer'
:
True
,
'context_dim'
:
1024
,
'num_head_channels'
:
64
,
'transformer_depth_output'
:
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
]}
'use_linear_in_transformer'
:
True
,
'context_dim'
:
1024
,
'num_head_channels'
:
64
,
'transformer_depth_output'
:
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
],
'use_temporal_attention'
:
False
,
'use_temporal_resblock'
:
False
}
SD15
=
{
'use_checkpoint'
:
False
,
'image_size'
:
32
,
'out_channels'
:
4
,
'use_spatial_transformer'
:
True
,
'legacy'
:
False
,
'adm_in_channels'
:
None
,
'dtype'
:
dtype
,
'in_channels'
:
4
,
'model_channels'
:
320
,
'num_res_blocks'
:
[
2
,
2
,
2
,
2
],
'transformer_depth'
:
[
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
],
'channel_mult'
:
[
1
,
2
,
4
,
4
],
'transformer_depth_middle'
:
1
,
'use_linear_in_transformer'
:
False
,
'context_dim'
:
768
,
'num_heads'
:
8
,
'transformer_depth_output'
:
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
]}
'transformer_depth_output'
:
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
0
,
0
,
0
],
'use_temporal_attention'
:
False
,
'use_temporal_resblock'
:
False
}
SDXL_mid_cnet
=
{
'use_checkpoint'
:
False
,
'image_size'
:
32
,
'out_channels'
:
4
,
'use_spatial_transformer'
:
True
,
'legacy'
:
False
,
'num_classes'
:
'sequential'
,
'adm_in_channels'
:
2816
,
'dtype'
:
dtype
,
'in_channels'
:
4
,
'model_channels'
:
320
,
'num_res_blocks'
:
[
2
,
2
,
2
],
'transformer_depth'
:
[
0
,
0
,
0
,
0
,
1
,
1
],
'channel_mult'
:
[
1
,
2
,
4
],
'transformer_depth_middle'
:
1
,
'use_linear_in_transformer'
:
True
,
'context_dim'
:
2048
,
'num_head_channels'
:
64
,
'transformer_depth_output'
:
[
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
]}
'use_linear_in_transformer'
:
True
,
'context_dim'
:
2048
,
'num_head_channels'
:
64
,
'transformer_depth_output'
:
[
0
,
0
,
0
,
0
,
0
,
0
,
1
,
1
,
1
],
'use_temporal_attention'
:
False
,
'use_temporal_resblock'
:
False
}
SDXL_small_cnet
=
{
'use_checkpoint'
:
False
,
'image_size'
:
32
,
'out_channels'
:
4
,
'use_spatial_transformer'
:
True
,
'legacy'
:
False
,
'num_classes'
:
'sequential'
,
'adm_in_channels'
:
2816
,
'dtype'
:
dtype
,
'in_channels'
:
4
,
'model_channels'
:
320
,
'num_res_blocks'
:
[
2
,
2
,
2
],
'transformer_depth'
:
[
0
,
0
,
0
,
0
,
0
,
0
],
'channel_mult'
:
[
1
,
2
,
4
],
'transformer_depth_middle'
:
0
,
'use_linear_in_transformer'
:
True
,
'num_head_channels'
:
64
,
'context_dim'
:
1
,
'transformer_depth_output'
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
]}
'use_linear_in_transformer'
:
True
,
'num_head_channels'
:
64
,
'context_dim'
:
1
,
'transformer_depth_output'
:
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
'use_temporal_attention'
:
False
,
'use_temporal_resblock'
:
False
}
SDXL_diffusers_inpaint
=
{
'use_checkpoint'
:
False
,
'image_size'
:
32
,
'out_channels'
:
4
,
'use_spatial_transformer'
:
True
,
'legacy'
:
False
,
'num_classes'
:
'sequential'
,
'adm_in_channels'
:
2816
,
'dtype'
:
dtype
,
'in_channels'
:
9
,
'model_channels'
:
320
,
'num_res_blocks'
:
[
2
,
2
,
2
],
'transformer_depth'
:
[
0
,
0
,
2
,
2
,
10
,
10
],
'channel_mult'
:
[
1
,
2
,
4
],
'transformer_depth_middle'
:
10
,
'use_linear_in_transformer'
:
True
,
'context_dim'
:
2048
,
'num_head_channels'
:
64
,
'transformer_depth_output'
:
[
0
,
0
,
0
,
2
,
2
,
2
,
10
,
10
,
10
]}
'use_linear_in_transformer'
:
True
,
'context_dim'
:
2048
,
'num_head_channels'
:
64
,
'transformer_depth_output'
:
[
0
,
0
,
0
,
2
,
2
,
2
,
10
,
10
,
10
],
'use_temporal_attention'
:
False
,
'use_temporal_resblock'
:
False
}
SSD_1B
=
{
'use_checkpoint'
:
False
,
'image_size'
:
32
,
'out_channels'
:
4
,
'use_spatial_transformer'
:
True
,
'legacy'
:
False
,
'num_classes'
:
'sequential'
,
'adm_in_channels'
:
2816
,
'dtype'
:
dtype
,
'in_channels'
:
4
,
'model_channels'
:
320
,
'num_res_blocks'
:
[
2
,
2
,
2
],
'transformer_depth'
:
[
0
,
0
,
2
,
2
,
4
,
4
],
'transformer_depth_output'
:
[
0
,
0
,
0
,
1
,
1
,
2
,
10
,
4
,
4
],
'channel_mult'
:
[
1
,
2
,
4
],
'transformer_depth_middle'
:
-
1
,
'use_linear_in_transformer'
:
True
,
'context_dim'
:
2048
,
'num_head_channels'
:
64
}
'channel_mult'
:
[
1
,
2
,
4
],
'transformer_depth_middle'
:
-
1
,
'use_linear_in_transformer'
:
True
,
'context_dim'
:
2048
,
'num_head_channels'
:
64
,
'use_temporal_attention'
:
False
,
'use_temporal_resblock'
:
False
}
supported_models
=
[
SDXL
,
SDXL_refiner
,
SD21
,
SD15
,
SD21_uncliph
,
SD21_unclipl
,
SDXL_mid_cnet
,
SDXL_small_cnet
,
SDXL_diffusers_inpaint
,
SSD_1B
]
...
...
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