mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-11 10:25:16 +00:00
Allow custom samplers to request discard penultimate sigma
This commit is contained in:
parent
fd73b5ee3a
commit
a352c021ec
@ -652,6 +652,7 @@ def sampler_object(name):
|
|||||||
class KSampler:
|
class KSampler:
|
||||||
SCHEDULERS = SCHEDULER_NAMES
|
SCHEDULERS = SCHEDULER_NAMES
|
||||||
SAMPLERS = SAMPLER_NAMES
|
SAMPLERS = SAMPLER_NAMES
|
||||||
|
DISCARD_PENULTIMATE_SIGMA_SAMPLERS = set(('dpm_2', 'dpm_2_ancestral', 'uni_pc', 'uni_pc_bh2'))
|
||||||
|
|
||||||
def __init__(self, model, steps, device, sampler=None, scheduler=None, denoise=None, model_options={}):
|
def __init__(self, model, steps, device, sampler=None, scheduler=None, denoise=None, model_options={}):
|
||||||
self.model = model
|
self.model = model
|
||||||
@ -670,7 +671,7 @@ class KSampler:
|
|||||||
sigmas = None
|
sigmas = None
|
||||||
|
|
||||||
discard_penultimate_sigma = False
|
discard_penultimate_sigma = False
|
||||||
if self.sampler in ['dpm_2', 'dpm_2_ancestral', 'uni_pc', 'uni_pc_bh2']:
|
if self.sampler in self.DISCARD_PENULTIMATE_SIGMA_SAMPLERS:
|
||||||
steps += 1
|
steps += 1
|
||||||
discard_penultimate_sigma = True
|
discard_penultimate_sigma = True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user