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
2bf051fd
Commit
2bf051fd
authored
Sep 28, 2023
by
comfyanonymous
Browse files
Add a basic node to generate sigmas from scheduler.
parent
d234ca55
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
comfy_extras/nodes_custom_sampler.py
comfy_extras/nodes_custom_sampler.py
+21
-0
No files found.
comfy_extras/nodes_custom_sampler.py
View file @
2bf051fd
...
@@ -4,6 +4,26 @@ from comfy.k_diffusion import sampling as k_diffusion_sampling
...
@@ -4,6 +4,26 @@ from comfy.k_diffusion import sampling as k_diffusion_sampling
import
latent_preview
import
latent_preview
import
torch
import
torch
class
BasicScheduler
:
@
classmethod
def
INPUT_TYPES
(
s
):
return
{
"required"
:
{
"model"
:
(
"MODEL"
,),
"scheduler"
:
(
comfy
.
samplers
.
SCHEDULER_NAMES
,
),
"steps"
:
(
"INT"
,
{
"default"
:
20
,
"min"
:
1
,
"max"
:
10000
}),
}
}
RETURN_TYPES
=
(
"SIGMAS"
,)
CATEGORY
=
"_for_testing/custom_sampling"
FUNCTION
=
"get_sigmas"
def
get_sigmas
(
self
,
model
,
scheduler
,
steps
):
sigmas
=
comfy
.
samplers
.
calculate_sigmas_scheduler
(
model
.
model
,
scheduler
,
steps
).
cpu
()
return
(
sigmas
,
)
class
KarrasScheduler
:
class
KarrasScheduler
:
@
classmethod
@
classmethod
def
INPUT_TYPES
(
s
):
def
INPUT_TYPES
(
s
):
...
@@ -95,4 +115,5 @@ NODE_CLASS_MAPPINGS = {
...
@@ -95,4 +115,5 @@ NODE_CLASS_MAPPINGS = {
"SamplerCustom"
:
SamplerCustom
,
"SamplerCustom"
:
SamplerCustom
,
"KarrasScheduler"
:
KarrasScheduler
,
"KarrasScheduler"
:
KarrasScheduler
,
"KSamplerSelect"
:
KSamplerSelect
,
"KSamplerSelect"
:
KSamplerSelect
,
"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