feat(samplers): add sigma-schedule parity to ER-SDE

ERSDEScheduler now accepts use_karras_sigmas, use_exponential_sigmas,
use_beta_sigmas, and use_flow_sigmas, matching the other flow schedulers.
The VP path derives alpha/sigma/lambda from the k-diffusion sigma so the
karras/beta/exponential transforms can use fractional timesteps; the
default schedule is numerically unchanged. use_flow_sigmas triggers flow
mode and add_noise tolerates fractional timesteps.

Wire the new keys into the ER-SDE presets so the sigma method selector
drives them, and cover ER-SDE in the scheduler stability test.
This commit is contained in:
CalamitousFelicitousness
2026-06-07 22:43:43 +01:00
parent d1ed1f7c93
commit f59e32ff17
3 changed files with 102 additions and 30 deletions
+5 -2
View File
@@ -28,6 +28,7 @@ from modules.schedulers.scheduler_flashflow import FlashFlowMatchEulerDiscreteSc
from modules.schedulers.scheduler_dpm_flowmatch import FlowMatchDPMSolverMultistepScheduler
from modules.schedulers.scheduler_dc import DCSolverMultistepScheduler
from modules.schedulers.scheduler_bdia import BDIA_DDIMScheduler
from modules.schedulers.scheduler_ersde import ERSDEScheduler
def test_scheduler(name, scheduler_class, config):
try:
@@ -61,7 +62,7 @@ def test_scheduler(name, scheduler_class, config):
# Re-introduce scaling calculation first
scaled_sample = scheduler.scale_model_input(sample, t)
if config.get("prediction_type") == "flow_prediction" or name in ["UFOGenScheduler", "TDDScheduler", "TCDScheduler", "BDIA_DDIMScheduler", "DCSolverMultistepScheduler"]:
if config.get("prediction_type") == "flow_prediction" or name in ["UFOGenScheduler", "TDDScheduler", "TCDScheduler", "BDIA_DDIMScheduler", "DCSolverMultistepScheduler", "ERSDEScheduler"]:
# Some new schedulers don't use K-diffusion scaling
expected_scale = 1.0
else:
@@ -239,6 +240,7 @@ def run_tests():
RiemannianFlowScheduler,
# sdnext schedulers
FlowUniPCMultistepScheduler, FlashFlowMatchEulerDiscreteScheduler, FlowMatchDPMSolverMultistepScheduler,
ERSDEScheduler,
]
for cls in flow_schedulers:
test_scheduler(cls.__name__, cls, {"prediction_type": "flow_prediction", "use_flow_sigmas": True})
@@ -250,7 +252,8 @@ def run_tests():
TDDScheduler,
TCDScheduler,
DCSolverMultistepScheduler,
BDIA_DDIMScheduler
BDIA_DDIMScheduler,
ERSDEScheduler
]
for prediction_type in ["epsilon", "v_prediction", "sample"]:
for cls in extended_schedulers: