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
1d7dfc07
Commit
1d7dfc07
authored
Sep 27, 2023
by
comfyanonymous
Browse files
Make add_noise in SamplerCustom a boolean.
parent
1adcc4c3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
comfy_extras/nodes_custom_sampler.py
comfy_extras/nodes_custom_sampler.py
+3
-3
No files found.
comfy_extras/nodes_custom_sampler.py
View file @
1d7dfc07
...
@@ -2,7 +2,7 @@ import comfy.samplers
...
@@ -2,7 +2,7 @@ import comfy.samplers
import
comfy.sample
import
comfy.sample
from
comfy.k_diffusion
import
sampling
as
k_diffusion_sampling
from
comfy.k_diffusion
import
sampling
as
k_diffusion_sampling
import
latent_preview
import
latent_preview
import
torch
class
KarrasScheduler
:
class
KarrasScheduler
:
@
classmethod
@
classmethod
...
@@ -45,7 +45,7 @@ class SamplerCustom:
...
@@ -45,7 +45,7 @@ class SamplerCustom:
def
INPUT_TYPES
(
s
):
def
INPUT_TYPES
(
s
):
return
{
"required"
:
return
{
"required"
:
{
"model"
:
(
"MODEL"
,),
{
"model"
:
(
"MODEL"
,),
"add_noise"
:
(
[
"enable
"
,
"d
isable"
],
),
"add_noise"
:
(
"BOOLEAN
"
,
{
"d
efault"
:
True
}
),
"noise_seed"
:
(
"INT"
,
{
"default"
:
0
,
"min"
:
0
,
"max"
:
0xffffffffffffffff
}),
"noise_seed"
:
(
"INT"
,
{
"default"
:
0
,
"min"
:
0
,
"max"
:
0xffffffffffffffff
}),
"cfg"
:
(
"FLOAT"
,
{
"default"
:
8.0
,
"min"
:
0.0
,
"max"
:
100.0
,
"step"
:
0.5
,
"round"
:
0.01
}),
"cfg"
:
(
"FLOAT"
,
{
"default"
:
8.0
,
"min"
:
0.0
,
"max"
:
100.0
,
"step"
:
0.5
,
"round"
:
0.01
}),
"positive"
:
(
"CONDITIONING"
,
),
"positive"
:
(
"CONDITIONING"
,
),
...
@@ -66,7 +66,7 @@ class SamplerCustom:
...
@@ -66,7 +66,7 @@ class SamplerCustom:
def
sample
(
self
,
model
,
add_noise
,
noise_seed
,
cfg
,
positive
,
negative
,
sampler
,
sigmas
,
latent_image
):
def
sample
(
self
,
model
,
add_noise
,
noise_seed
,
cfg
,
positive
,
negative
,
sampler
,
sigmas
,
latent_image
):
latent
=
latent_image
latent
=
latent_image
latent_image
=
latent
[
"samples"
]
latent_image
=
latent
[
"samples"
]
if
add_noise
==
"disable"
:
if
not
add_noise
:
noise
=
torch
.
zeros
(
latent_image
.
size
(),
dtype
=
latent_image
.
dtype
,
layout
=
latent_image
.
layout
,
device
=
"cpu"
)
noise
=
torch
.
zeros
(
latent_image
.
size
(),
dtype
=
latent_image
.
dtype
,
layout
=
latent_image
.
layout
,
device
=
"cpu"
)
else
:
else
:
batch_inds
=
latent
[
"batch_index"
]
if
"batch_index"
in
latent
else
None
batch_inds
=
latent
[
"batch_index"
]
if
"batch_index"
in
latent
else
None
...
...
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