Add function to split sigmas.

This commit is contained in:
comfyanonymous 2023-09-28 00:40:09 -04:00
parent 2bf051fda8
commit 76e0f8fc8f
1 changed files with 18 additions and 0 deletions

View File

@ -43,6 +43,23 @@ class KarrasScheduler:
sigmas = k_diffusion_sampling.get_sigmas_karras(n=steps, sigma_min=sigma_min, sigma_max=sigma_max, rho=rho)
return (sigmas, )
class SplitSigmas:
@classmethod
def INPUT_TYPES(s):
return {"required":
{"sigmas": ("SIGMAS", ),
"step": ("INT", {"default": 0, "min": 0, "max": 10000}),
}
}
RETURN_TYPES = ("SIGMAS","SIGMAS")
CATEGORY = "_for_testing/custom_sampling"
FUNCTION = "get_sigmas"
def get_sigmas(self, sigmas, step):
sigmas1 = sigmas[:step + 1]
sigmas2 = sigmas[step + 1:]
return (sigmas1, sigmas2)
class KSamplerSelect:
@classmethod
@ -116,4 +133,5 @@ NODE_CLASS_MAPPINGS = {
"KarrasScheduler": KarrasScheduler,
"KSamplerSelect": KSamplerSelect,
"BasicScheduler": BasicScheduler,
"SplitSigmas": SplitSigmas,
}