Skip to content

Commit

Permalink
Add SetFirstSigma node (#6459)
Browse files Browse the repository at this point in the history
Useful for models utilizing ztSNR. See: https://arxiv.org/abs/2409.15997
  • Loading branch information
catboxanon authored Jan 15, 2025
1 parent c78a456 commit 2cdbaf5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions comfy_extras/nodes_custom_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,24 @@ def get_sigmas(self, sigmas):
sigmas[0] = 0.0001
return (sigmas,)

class SetFirstSigma:
@classmethod
def INPUT_TYPES(s):
return {"required":
{"sigmas": ("SIGMAS", ),
"sigma": ("FLOAT", {"default": 136.0, "min": 0.0, "max": 20000.0, "step": 0.001, "round": False}),
}
}
RETURN_TYPES = ("SIGMAS",)
CATEGORY = "sampling/custom_sampling/sigmas"

FUNCTION = "set_first_sigma"

def set_first_sigma(self, sigmas, sigma):
sigmas = sigmas.clone()
sigmas[0] = sigma
return (sigmas, )

class KSamplerSelect:
@classmethod
def INPUT_TYPES(s):
Expand Down Expand Up @@ -710,6 +728,7 @@ def add_noise(self, model, noise, sigmas, latent_image):
"SplitSigmas": SplitSigmas,
"SplitSigmasDenoise": SplitSigmasDenoise,
"FlipSigmas": FlipSigmas,
"SetFirstSigma": SetFirstSigma,

"CFGGuider": CFGGuider,
"DualCFGGuider": DualCFGGuider,
Expand Down

0 comments on commit 2cdbaf5

Please sign in to comment.