Skip to content

Commit

Permalink
Add a denoise parameter to BasicScheduler node.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Dec 31, 2023
1 parent 36e15f2 commit d1f3637
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions comfy_extras/nodes_custom_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,21 @@ def INPUT_TYPES(s):
{"model": ("MODEL",),
"scheduler": (comfy.samplers.SCHEDULER_NAMES, ),
"steps": ("INT", {"default": 20, "min": 1, "max": 10000}),
"denoise": ("FLOAT", {"default": 1.0, "min": 0.0, "max": 1.0, "step": 0.01}),
}
}
RETURN_TYPES = ("SIGMAS",)
CATEGORY = "sampling/custom_sampling/schedulers"

FUNCTION = "get_sigmas"

def get_sigmas(self, model, scheduler, steps):
sigmas = comfy.samplers.calculate_sigmas_scheduler(model.model, scheduler, steps).cpu()
def get_sigmas(self, model, scheduler, steps, denoise):
total_steps = steps
if denoise < 1.0:
total_steps = int(steps/denoise)

sigmas = comfy.samplers.calculate_sigmas_scheduler(model.model, scheduler, total_steps).cpu()
sigmas = sigmas[-(steps + 1):]
return (sigmas, )


Expand Down

0 comments on commit d1f3637

Please sign in to comment.