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
01991f72
Commit
01991f72
authored
Jul 02, 2024
by
comfyanonymous
Browse files
Fix SamplerEulerCFGpp node.
parent
2f032016
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
comfy_extras/nodes_advanced_samplers.py
comfy_extras/nodes_advanced_samplers.py
+6
-6
No files found.
comfy_extras/nodes_advanced_samplers.py
View file @
01991f72
...
@@ -60,7 +60,7 @@ from comfy.k_diffusion.sampling import to_d
...
@@ -60,7 +60,7 @@ from comfy.k_diffusion.sampling import to_d
import
comfy.model_patcher
import
comfy.model_patcher
@
torch
.
no_grad
()
@
torch
.
no_grad
()
def
sample_euler_
cfg
pp
(
model
,
x
,
sigmas
,
extra_args
=
None
,
callback
=
None
,
disable
=
None
):
def
sample_euler_pp
(
model
,
x
,
sigmas
,
extra_args
=
None
,
callback
=
None
,
disable
=
None
):
extra_args
=
{}
if
extra_args
is
None
else
extra_args
extra_args
=
{}
if
extra_args
is
None
else
extra_args
temp
=
[
0
]
temp
=
[
0
]
...
@@ -75,11 +75,11 @@ def sample_euler_cfgpp(model, x, sigmas, extra_args=None, callback=None, disable
...
@@ -75,11 +75,11 @@ def sample_euler_cfgpp(model, x, sigmas, extra_args=None, callback=None, disable
for
i
in
trange
(
len
(
sigmas
)
-
1
,
disable
=
disable
):
for
i
in
trange
(
len
(
sigmas
)
-
1
,
disable
=
disable
):
sigma_hat
=
sigmas
[
i
]
sigma_hat
=
sigmas
[
i
]
denoised
=
model
(
x
,
sigma_hat
*
s_in
,
**
extra_args
)
denoised
=
model
(
x
,
sigma_hat
*
s_in
,
**
extra_args
)
d
=
to_d
(
x
,
sigma_hat
,
temp
[
0
]
)
d
=
to_d
(
x
-
denoised
+
temp
[
0
],
sigmas
[
i
],
denoised
)
if
callback
is
not
None
:
if
callback
is
not
None
:
callback
({
'x'
:
x
,
'i'
:
i
,
'sigma'
:
sigmas
[
i
],
'sigma_hat'
:
sigma_hat
,
'denoised'
:
denoised
})
callback
({
'x'
:
x
,
'i'
:
i
,
'sigma'
:
sigmas
[
i
],
'sigma_hat'
:
sigma_hat
,
'denoised'
:
denoised
})
dt
=
sigmas
[
i
+
1
]
-
sigma_hat
dt
=
sigmas
[
i
+
1
]
-
sigma_hat
x
=
denoised
+
sigmas
[
i
+
1
]
*
d
x
=
x
+
d
*
d
t
return
x
return
x
...
@@ -96,10 +96,10 @@ class SamplerEulerCFGpp:
...
@@ -96,10 +96,10 @@ class SamplerEulerCFGpp:
FUNCTION
=
"get_sampler"
FUNCTION
=
"get_sampler"
def
get_sampler
(
self
,
version
):
def
get_sampler
(
self
,
version
):
if
version
==
"
regular
"
:
if
version
==
"
alternative
"
:
sampler
=
comfy
.
samplers
.
KSAMPLER
(
sample_euler_
cfg
pp
)
sampler
=
comfy
.
samplers
.
KSAMPLER
(
sample_euler_pp
)
else
:
else
:
sampler
=
comfy
.
samplers
.
ksampler
(
"euler_pp"
)
sampler
=
comfy
.
samplers
.
ksampler
(
"euler_
cfg_
pp"
)
return
(
sampler
,
)
return
(
sampler
,
)
NODE_CLASS_MAPPINGS
=
{
NODE_CLASS_MAPPINGS
=
{
...
...
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