Skip to content

Commit

Permalink
Add dpmpp_2s_ancestral as custom sampler (#4101)
Browse files Browse the repository at this point in the history
Adding dpmpp_2s_ancestral as custom sampler node to enable its use with eta and s_noise when using custom sampling.
  • Loading branch information
silveroxides committed Jul 27, 2024
1 parent f82d09c commit 9300058
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion comfy_extras/nodes_custom_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,23 @@ def get_sampler(self, eta, s_noise, r, noise_device):
sampler = comfy.samplers.ksampler(sampler_name, {"eta": eta, "s_noise": s_noise, "r": r})
return (sampler, )

class SamplerDPMPP_2S_Ancestral:
@classmethod
def INPUT_TYPES(s):
return {"required":
{"eta": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 100.0, "step":0.01, "round": False}),
"s_noise": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 100.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("dpmpp_2s_ancestral", {"eta": eta, "s_noise": s_noise})
return (sampler, )

class SamplerEulerAncestral:
@classmethod
def INPUT_TYPES(s):
Expand Down Expand Up @@ -666,6 +683,7 @@ def add_noise(self, model, noise, sigmas, latent_image):
"SamplerDPMPP_3M_SDE": SamplerDPMPP_3M_SDE,
"SamplerDPMPP_2M_SDE": SamplerDPMPP_2M_SDE,
"SamplerDPMPP_SDE": SamplerDPMPP_SDE,
"SamplerDPMPP_2S_Ancestral": SamplerDPMPP_2S_Ancestral,
"SamplerDPMAdaptative": SamplerDPMAdaptative,
"SplitSigmas": SplitSigmas,
"SplitSigmasDenoise": SplitSigmasDenoise,
Expand All @@ -682,4 +700,4 @@ def add_noise(self, model, noise, sigmas, latent_image):

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

0 comments on commit 9300058

Please sign in to comment.