samplers add manual sigma adjustment

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-03-27 16:26:11 -04:00
parent ecb6730838
commit 0d6301ff25
8 changed files with 57 additions and 29 deletions
+2 -2
View File
@@ -59,8 +59,6 @@ def diffusers_callback(pipe, step: int = 0, timestep: int = 0, kwargs: dict = {}
if debug:
debug_callback(f'Callback: step={step} timestep={timestep} latents={latents.shape if latents is not None else None} kwargs={list(kwargs)}')
shared.state.step()
# order = getattr(pipe.scheduler, "order", 1) if hasattr(pipe, 'scheduler') else 1
# shared.state.sampling_step = step // order
if shared.state.interrupted or shared.state.skipped:
raise AssertionError('Interrupted...')
if shared.state.paused:
@@ -125,6 +123,8 @@ def diffusers_callback(pipe, step: int = 0, timestep: int = 0, kwargs: dict = {}
try:
shared.state.current_sigma = pipe.scheduler.sigmas[pipe.scheduler.step_index-1]
shared.state.current_sigma_next = pipe.scheduler.sigmas[pipe.scheduler.step_index]
if (shared.opts.schedulers_sigma_adjust != 1.0) and (timestep > 1000 * shared.opts.schedulers_sigma_adjust_min) and (timestep < 1000 * shared.opts.schedulers_sigma_adjust_max):
pipe.scheduler.sigmas[pipe.scheduler.step_index+1] = pipe.scheduler.sigmas[pipe.scheduler.step_index+1] * shared.opts.schedulers_sigma_adjust
except Exception:
pass
except Exception as e: