Commit 2bf051fd authored by comfyanonymous's avatar comfyanonymous
Browse files

Add a basic node to generate sigmas from scheduler.

parent d234ca55
...@@ -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,
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment