From fa35cc287cdb6caa3a8735353bfe7256eb2c5c9f Mon Sep 17 00:00:00 2001 From: Peter Crabtree Date: Mon, 1 Jul 2024 17:42:17 -0400 Subject: [PATCH] Add SamplerEulerAncestralCFG++ custom sampler node (#3901) (for eta and s_noise) --- comfy_extras/nodes_custom_sampler.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/comfy_extras/nodes_custom_sampler.py b/comfy_extras/nodes_custom_sampler.py index 69f1b94181a..64a8c06312c 100644 --- a/comfy_extras/nodes_custom_sampler.py +++ b/comfy_extras/nodes_custom_sampler.py @@ -293,6 +293,25 @@ def get_sampler(self, eta, s_noise): sampler = comfy.samplers.ksampler("euler_ancestral", {"eta": eta, "s_noise": s_noise}) return (sampler, ) +class SamplerEulerAncestralCFGPP: + @classmethod + def INPUT_TYPES(s): + return { + "required": { + "eta": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step":0.01, "round": False}), + "s_noise": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 10.0, "step":0.01, "round": False}), + }} + RETURN_TYPES = ("SAMPLER",) + CATEGORY = "sampling/custom_sampling/samplers" + + FUNCTION = "get_sampler" + + def get_sampler(self, eta, s_noise): + sampler = comfy.samplers.ksampler( + "euler_ancestral_cfg_pp", + {"eta": eta, "s_noise": s_noise}) + return (sampler, ) + class SamplerLMS: @classmethod def INPUT_TYPES(s): @@ -622,6 +641,7 @@ def add_noise(self, model, noise, sigmas, latent_image): "SDTurboScheduler": SDTurboScheduler, "KSamplerSelect": KSamplerSelect, "SamplerEulerAncestral": SamplerEulerAncestral, + "SamplerEulerAncestralCFGPP": SamplerEulerAncestralCFGPP, "SamplerLMS": SamplerLMS, "SamplerDPMPP_3M_SDE": SamplerDPMPP_3M_SDE, "SamplerDPMPP_2M_SDE": SamplerDPMPP_2M_SDE, @@ -639,3 +659,7 @@ def add_noise(self, model, noise, sigmas, latent_image): "AddNoise": AddNoise, "SamplerCustomAdvanced": SamplerCustomAdvanced, } + +NODE_DISPLAY_NAME_MAPPINGS = { + "SamplerEulerAncestralCFGPP": "SamplerEulerAncestralCFG++", +} \ No newline at end of file