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
7faa4507
Commit
7faa4507
authored
Feb 21, 2024
by
comfyanonymous
Browse files
ModelSamplingDiscrete: x0 model support that predict a denoised image.
parent
18c151b3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
comfy_extras/nodes_model_advanced.py
comfy_extras/nodes_model_advanced.py
+7
-1
No files found.
comfy_extras/nodes_model_advanced.py
View file @
7faa4507
...
...
@@ -17,6 +17,10 @@ class LCM(comfy.model_sampling.EPS):
return
c_out
*
x0
+
c_skip
*
model_input
class
X0
(
comfy
.
model_sampling
.
EPS
):
def
calculate_denoised
(
self
,
sigma
,
model_output
,
model_input
):
return
model_output
class
ModelSamplingDiscreteDistilled
(
comfy
.
model_sampling
.
ModelSamplingDiscrete
):
original_timesteps
=
50
...
...
@@ -68,7 +72,7 @@ class ModelSamplingDiscrete:
@
classmethod
def
INPUT_TYPES
(
s
):
return
{
"required"
:
{
"model"
:
(
"MODEL"
,),
"sampling"
:
([
"eps"
,
"v_prediction"
,
"lcm"
],),
"sampling"
:
([
"eps"
,
"v_prediction"
,
"lcm"
,
"x0"
],),
"zsnr"
:
(
"BOOLEAN"
,
{
"default"
:
False
}),
}}
...
...
@@ -88,6 +92,8 @@ class ModelSamplingDiscrete:
elif
sampling
==
"lcm"
:
sampling_type
=
LCM
sampling_base
=
ModelSamplingDiscreteDistilled
elif
sampling
==
"x0"
:
sampling_type
=
X0
class
ModelSamplingAdvanced
(
sampling_base
,
sampling_type
):
pass
...
...
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