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
327ca131
Commit
327ca131
authored
Mar 27, 2024
by
comfyanonymous
Browse files
Support SDXS 0.9
parent
8ae1e4d1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
comfy/model_detection.py
comfy/model_detection.py
+7
-1
comfy/supported_models.py
comfy/supported_models.py
+2
-2
No files found.
comfy/model_detection.py
View file @
327ca131
...
...
@@ -345,7 +345,13 @@ def unet_config_from_diffusers_unet(state_dict, dtype=None):
'channel_mult'
:
[
1
,
2
,
4
],
'transformer_depth_middle'
:
6
,
'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
,
Segmind_Vega
,
KOALA_700M
,
KOALA_1B
]
SD09_XS
=
{
'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'
:
[
1
,
1
,
1
],
'transformer_depth'
:
[
1
,
1
,
1
],
'channel_mult'
:
[
1
,
2
,
4
],
'transformer_depth_middle'
:
-
2
,
'use_linear_in_transformer'
:
True
,
'context_dim'
:
1024
,
'num_head_channels'
:
64
,
'transformer_depth_output'
:
[
1
,
1
,
1
,
1
,
1
,
1
],
'use_temporal_attention'
:
False
,
'use_temporal_resblock'
:
False
,
'disable_self_attentions'
:
[
True
,
False
,
False
]}
supported_models
=
[
SDXL
,
SDXL_refiner
,
SD21
,
SD15
,
SD21_uncliph
,
SD21_unclipl
,
SDXL_mid_cnet
,
SDXL_small_cnet
,
SDXL_diffusers_inpaint
,
SSD_1B
,
Segmind_Vega
,
KOALA_700M
,
KOALA_1B
,
SD09_XS
]
for
unet_config
in
supported_models
:
matches
=
True
...
...
comfy/supported_models.py
View file @
327ca131
...
...
@@ -70,8 +70,8 @@ class SD20(supported_models_base.BASE):
def
model_type
(
self
,
state_dict
,
prefix
=
""
):
if
self
.
unet_config
[
"in_channels"
]
==
4
:
#SD2.0 inpainting models are not v prediction
k
=
"{}output_blocks.11.1.transformer_blocks.0.norm1.bias"
.
format
(
prefix
)
out
=
state_dict
[
k
]
if
torch
.
std
(
out
,
unbiased
=
False
)
>
0.09
:
# not sure how well this will actually work. I guess we will find out.
out
=
state_dict
.
get
(
k
,
None
)
if
out
is
not
None
and
torch
.
std
(
out
,
unbiased
=
False
)
>
0.09
:
# not sure how well this will actually work. I guess we will find out.
return
model_base
.
ModelType
.
V_PREDICTION
return
model_base
.
ModelType
.
EPS
...
...
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