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
c6bd456c
Commit
c6bd456c
authored
Apr 04, 2024
by
comfyanonymous
Browse files
Make zero denoise a NOP.
parent
fcfd2bdf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
comfy/samplers.py
comfy/samplers.py
+9
-3
comfy_extras/nodes_custom_sampler.py
comfy_extras/nodes_custom_sampler.py
+5
-0
No files found.
comfy/samplers.py
View file @
c6bd456c
...
...
@@ -624,6 +624,9 @@ class CFGGuider:
return
self
.
inner_model
.
process_latent_out
(
samples
.
to
(
torch
.
float32
))
def
sample
(
self
,
noise
,
latent_image
,
sampler
,
sigmas
,
denoise_mask
=
None
,
callback
=
None
,
disable_pbar
=
False
,
seed
=
None
):
if
sigmas
.
shape
[
-
1
]
==
0
:
return
latent_image
self
.
conds
=
{}
for
k
in
self
.
original_conds
:
self
.
conds
[
k
]
=
list
(
map
(
lambda
a
:
a
.
copy
(),
self
.
original_conds
[
k
]))
...
...
@@ -721,6 +724,9 @@ class KSampler:
self
.
steps
=
steps
if
denoise
is
None
or
denoise
>
0.9999
:
self
.
sigmas
=
self
.
calculate_sigmas
(
steps
).
to
(
self
.
device
)
else
:
if
denoise
<=
0.0
:
self
.
sigmas
=
torch
.
FloatTensor
([])
else
:
new_steps
=
int
(
steps
/
denoise
)
sigmas
=
self
.
calculate_sigmas
(
new_steps
).
to
(
self
.
device
)
...
...
comfy_extras/nodes_custom_sampler.py
View file @
c6bd456c
...
...
@@ -24,6 +24,8 @@ class BasicScheduler:
def
get_sigmas
(
self
,
model
,
scheduler
,
steps
,
denoise
):
total_steps
=
steps
if
denoise
<
1.0
:
if
denoise
<=
0.0
:
return
(
torch
.
FloatTensor
([]),)
total_steps
=
int
(
steps
/
denoise
)
comfy
.
model_management
.
load_models_gpu
([
model
])
...
...
@@ -160,6 +162,9 @@ class FlipSigmas:
FUNCTION
=
"get_sigmas"
def
get_sigmas
(
self
,
sigmas
):
if
len
(
sigmas
)
==
0
:
return
(
sigmas
,)
sigmas
=
sigmas
.
flip
(
0
)
if
sigmas
[
0
]
==
0
:
sigmas
[
0
]
=
0.0001
...
...
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