Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Add SamplerEulerAncestralCFG++ custom sampler node (#3901)

Peter Crabtreeb82d67d5bfa9
diff --git a/comfy_extras/nodes_custom_sampler.py b/comfy_extras/nodes_custom_sampler.py
index 69f1b9418..64a8c0631 100644
--- a/comfy_extras/nodes_custom_sampler.py
+++ b/comfy_extras/nodes_custom_sampler.py
@@ -293,6 +293,25 @@ class SamplerEulerAncestral:
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 @@ NODE_CLASS_MAPPINGS = {
"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 @@ NODE_CLASS_MAPPINGS = {
"AddNoise": AddNoise,
"SamplerCustomAdvanced": SamplerCustomAdvanced,
}
+
+NODE_DISPLAY_NAME_MAPPINGS = {
+ "SamplerEulerAncestralCFGPP": "SamplerEulerAncestralCFG++",
+}
\ No newline at end of file