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
1088d185
Commit
1088d185
authored
Apr 05, 2024
by
comfyanonymous
Browse files
Support for CosXL models.
parent
41ed7e85
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
comfy/model_base.py
comfy/model_base.py
+4
-2
comfy/supported_models.py
comfy/supported_models.py
+6
-1
No files found.
comfy/model_base.py
View file @
1088d185
...
@@ -503,8 +503,10 @@ class SD15_instructpix2pix(IP2P, BaseModel):
...
@@ -503,8 +503,10 @@ class SD15_instructpix2pix(IP2P, BaseModel):
class
SDXL_instructpix2pix
(
IP2P
,
SDXL
):
class
SDXL_instructpix2pix
(
IP2P
,
SDXL
):
def
__init__
(
self
,
model_config
,
model_type
=
ModelType
.
EPS
,
device
=
None
):
def
__init__
(
self
,
model_config
,
model_type
=
ModelType
.
EPS
,
device
=
None
):
super
().
__init__
(
model_config
,
model_type
,
device
=
device
)
super
().
__init__
(
model_config
,
model_type
,
device
=
device
)
# self.process_ip2p_image_in = lambda image: comfy.latent_formats.SDXL().process_in(image)
if
model_type
==
ModelType
.
V_PREDICTION_EDM
:
self
.
process_ip2p_image_in
=
lambda
image
:
image
self
.
process_ip2p_image_in
=
lambda
image
:
comfy
.
latent_formats
.
SDXL
().
process_in
(
image
)
#cosxl ip2p
else
:
self
.
process_ip2p_image_in
=
lambda
image
:
image
#diffusers ip2p
class
StableCascade_C
(
BaseModel
):
class
StableCascade_C
(
BaseModel
):
...
...
comfy/supported_models.py
View file @
1088d185
...
@@ -174,6 +174,11 @@ class SDXL(supported_models_base.BASE):
...
@@ -174,6 +174,11 @@ class SDXL(supported_models_base.BASE):
self
.
sampling_settings
[
"sigma_max"
]
=
80.0
self
.
sampling_settings
[
"sigma_max"
]
=
80.0
self
.
sampling_settings
[
"sigma_min"
]
=
0.002
self
.
sampling_settings
[
"sigma_min"
]
=
0.002
return
model_base
.
ModelType
.
EDM
return
model_base
.
ModelType
.
EDM
elif
"edm_vpred.sigma_max"
in
state_dict
:
self
.
sampling_settings
[
"sigma_max"
]
=
float
(
state_dict
[
"edm_vpred.sigma_max"
].
item
())
if
"edm_vpred.sigma_min"
in
state_dict
:
self
.
sampling_settings
[
"sigma_min"
]
=
float
(
state_dict
[
"edm_vpred.sigma_min"
].
item
())
return
model_base
.
ModelType
.
V_PREDICTION_EDM
elif
"v_pred"
in
state_dict
:
elif
"v_pred"
in
state_dict
:
return
model_base
.
ModelType
.
V_PREDICTION
return
model_base
.
ModelType
.
V_PREDICTION
else
:
else
:
...
@@ -469,7 +474,7 @@ class SDXL_instructpix2pix(SDXL):
...
@@ -469,7 +474,7 @@ class SDXL_instructpix2pix(SDXL):
}
}
def
get_model
(
self
,
state_dict
,
prefix
=
""
,
device
=
None
):
def
get_model
(
self
,
state_dict
,
prefix
=
""
,
device
=
None
):
return
model_base
.
SDXL_instructpix2pix
(
self
,
device
=
device
)
return
model_base
.
SDXL_instructpix2pix
(
self
,
model_type
=
self
.
model_type
(
state_dict
,
prefix
),
device
=
device
)
models
=
[
Stable_Zero123
,
SD15_instructpix2pix
,
SD15
,
SD20
,
SD21UnclipL
,
SD21UnclipH
,
SDXL_instructpix2pix
,
SDXLRefiner
,
SDXL
,
SSD1B
,
KOALA_700M
,
KOALA_1B
,
Segmind_Vega
,
SD_X4Upscaler
,
Stable_Cascade_C
,
Stable_Cascade_B
,
SV3D_u
,
SV3D_p
]
models
=
[
Stable_Zero123
,
SD15_instructpix2pix
,
SD15
,
SD20
,
SD21UnclipL
,
SD21UnclipH
,
SDXL_instructpix2pix
,
SDXLRefiner
,
SDXL
,
SSD1B
,
KOALA_700M
,
KOALA_1B
,
Segmind_Vega
,
SD_X4Upscaler
,
Stable_Cascade_C
,
Stable_Cascade_B
,
SV3D_u
,
SV3D_p
]
...
...
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