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
213976f8
"tests/pipelines/vscode:/vscode.git/clone" did not exist on "7b98c4cc67b7131724f1cb5315da1c01387c6667"
Commit
213976f8
authored
Sep 29, 2023
by
comfyanonymous
Browse files
Add ExponentialScheduler and PolyexponentialScheduler nodes.
parent
0f17993d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
comfy_extras/nodes_custom_sampler.py
comfy_extras/nodes_custom_sampler.py
+39
-0
No files found.
comfy_extras/nodes_custom_sampler.py
View file @
213976f8
...
@@ -43,6 +43,43 @@ class KarrasScheduler:
...
@@ -43,6 +43,43 @@ class KarrasScheduler:
sigmas
=
k_diffusion_sampling
.
get_sigmas_karras
(
n
=
steps
,
sigma_min
=
sigma_min
,
sigma_max
=
sigma_max
,
rho
=
rho
)
sigmas
=
k_diffusion_sampling
.
get_sigmas_karras
(
n
=
steps
,
sigma_min
=
sigma_min
,
sigma_max
=
sigma_max
,
rho
=
rho
)
return
(
sigmas
,
)
return
(
sigmas
,
)
class
ExponentialScheduler
:
@
classmethod
def
INPUT_TYPES
(
s
):
return
{
"required"
:
{
"steps"
:
(
"INT"
,
{
"default"
:
20
,
"min"
:
1
,
"max"
:
10000
}),
"sigma_max"
:
(
"FLOAT"
,
{
"default"
:
14.614642
,
"min"
:
0.0
,
"max"
:
1000.0
,
"step"
:
0.01
,
"round"
:
False
}),
"sigma_min"
:
(
"FLOAT"
,
{
"default"
:
0.0291675
,
"min"
:
0.0
,
"max"
:
1000.0
,
"step"
:
0.01
,
"round"
:
False
}),
}
}
RETURN_TYPES
=
(
"SIGMAS"
,)
CATEGORY
=
"_for_testing/custom_sampling"
FUNCTION
=
"get_sigmas"
def
get_sigmas
(
self
,
steps
,
sigma_max
,
sigma_min
):
sigmas
=
k_diffusion_sampling
.
get_sigmas_exponential
(
n
=
steps
,
sigma_min
=
sigma_min
,
sigma_max
=
sigma_max
)
return
(
sigmas
,
)
class
PolyexponentialScheduler
:
@
classmethod
def
INPUT_TYPES
(
s
):
return
{
"required"
:
{
"steps"
:
(
"INT"
,
{
"default"
:
20
,
"min"
:
1
,
"max"
:
10000
}),
"sigma_max"
:
(
"FLOAT"
,
{
"default"
:
14.614642
,
"min"
:
0.0
,
"max"
:
1000.0
,
"step"
:
0.01
,
"round"
:
False
}),
"sigma_min"
:
(
"FLOAT"
,
{
"default"
:
0.0291675
,
"min"
:
0.0
,
"max"
:
1000.0
,
"step"
:
0.01
,
"round"
:
False
}),
"rho"
:
(
"FLOAT"
,
{
"default"
:
1.0
,
"min"
:
0.0
,
"max"
:
100.0
,
"step"
:
0.01
,
"round"
:
False
}),
}
}
RETURN_TYPES
=
(
"SIGMAS"
,)
CATEGORY
=
"_for_testing/custom_sampling"
FUNCTION
=
"get_sigmas"
def
get_sigmas
(
self
,
steps
,
sigma_max
,
sigma_min
,
rho
):
sigmas
=
k_diffusion_sampling
.
get_sigmas_polyexponential
(
n
=
steps
,
sigma_min
=
sigma_min
,
sigma_max
=
sigma_max
,
rho
=
rho
)
return
(
sigmas
,
)
class
SplitSigmas
:
class
SplitSigmas
:
@
classmethod
@
classmethod
def
INPUT_TYPES
(
s
):
def
INPUT_TYPES
(
s
):
...
@@ -155,6 +192,8 @@ class SamplerCustom:
...
@@ -155,6 +192,8 @@ class SamplerCustom:
NODE_CLASS_MAPPINGS
=
{
NODE_CLASS_MAPPINGS
=
{
"SamplerCustom"
:
SamplerCustom
,
"SamplerCustom"
:
SamplerCustom
,
"KarrasScheduler"
:
KarrasScheduler
,
"KarrasScheduler"
:
KarrasScheduler
,
"ExponentialScheduler"
:
ExponentialScheduler
,
"PolyexponentialScheduler"
:
PolyexponentialScheduler
,
"KSamplerSelect"
:
KSamplerSelect
,
"KSamplerSelect"
:
KSamplerSelect
,
"SamplerDPMPP_2M_SDE"
:
SamplerDPMPP_2M_SDE
,
"SamplerDPMPP_2M_SDE"
:
SamplerDPMPP_2M_SDE
,
"BasicScheduler"
:
BasicScheduler
,
"BasicScheduler"
:
BasicScheduler
,
...
...
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