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
8daedc5b
Commit
8daedc5b
authored
Feb 27, 2024
by
comfyanonymous
Browse files
Auto detect playground v2.5 model.
parent
d46583ec
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
comfy/model_base.py
comfy/model_base.py
+5
-1
comfy/supported_models.py
comfy/supported_models.py
+7
-1
No files found.
comfy/model_base.py
View file @
8daedc5b
...
...
@@ -15,9 +15,10 @@ class ModelType(Enum):
V_PREDICTION
=
2
V_PREDICTION_EDM
=
3
STABLE_CASCADE
=
4
EDM
=
5
from
comfy.model_sampling
import
EPS
,
V_PREDICTION
,
ModelSamplingDiscrete
,
ModelSamplingContinuousEDM
,
StableCascadeSampling
from
comfy.model_sampling
import
EPS
,
V_PREDICTION
,
EDM
,
ModelSamplingDiscrete
,
ModelSamplingContinuousEDM
,
StableCascadeSampling
def
model_sampling
(
model_config
,
model_type
):
...
...
@@ -33,6 +34,9 @@ def model_sampling(model_config, model_type):
elif
model_type
==
ModelType
.
STABLE_CASCADE
:
c
=
EPS
s
=
StableCascadeSampling
elif
model_type
==
ModelType
.
EDM
:
c
=
EDM
s
=
ModelSamplingContinuousEDM
class
ModelSampling
(
s
,
c
):
pass
...
...
comfy/supported_models.py
View file @
8daedc5b
...
...
@@ -163,7 +163,13 @@ class SDXL(supported_models_base.BASE):
latent_format
=
latent_formats
.
SDXL
def
model_type
(
self
,
state_dict
,
prefix
=
""
):
if
"v_pred"
in
state_dict
:
if
'edm_mean'
in
state_dict
and
'edm_std'
in
state_dict
:
#Playground V2.5
self
.
latent_format
=
latent_formats
.
SDXL_Playground_2_5
()
self
.
sampling_settings
[
"sigma_data"
]
=
0.5
self
.
sampling_settings
[
"sigma_max"
]
=
80.0
self
.
sampling_settings
[
"sigma_min"
]
=
0.002
return
model_base
.
ModelType
.
EDM
elif
"v_pred"
in
state_dict
:
return
model_base
.
ModelType
.
V_PREDICTION
else
:
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