Skip to content

Commit

Permalink
Add SamplerEulerAncestralCFG++ custom sampler node (comfyanonymous#3901)
Browse files Browse the repository at this point in the history
(for eta and s_noise)
  • Loading branch information
petercrabtree authored and csokun committed Jul 10, 2024
1 parent a23d45c commit fa35cc2
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions comfy_extras/nodes_custom_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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,
Expand All @@ -639,3 +659,7 @@ def add_noise(self, model, noise, sigmas, latent_image):
"AddNoise": AddNoise,
"SamplerCustomAdvanced": SamplerCustomAdvanced,
}

NODE_DISPLAY_NAME_MAPPINGS = {
"SamplerEulerAncestralCFGPP": "SamplerEulerAncestralCFG++",
}

0 comments on commit fa35cc2

Please sign in to comment.