From 9c1168a0886d5f0b21180c785f4f15fe361ba4fe Mon Sep 17 00:00:00 2001 From: rockerBOO Date: Thu, 23 Jan 2025 16:52:36 -0500 Subject: [PATCH 1/2] Add more dpmsolver++2m samplers to solve SDXL sampling artifacts --- library/train_util.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/library/train_util.py b/library/train_util.py index 72b5b24db..eeace35a3 100644 --- a/library/train_util.py +++ b/library/train_util.py @@ -5980,6 +5980,31 @@ def get_my_scheduler( elif sample_sampler == "dpmsolver" or sample_sampler == "dpmsolver++": scheduler_cls = DPMSolverMultistepScheduler sched_init_args["algorithm_type"] = sample_sampler + elif sample_sampler == "dpmsolver++_2m": + scheduler_cls = DPMSolverMultistepScheduler + elif sample_sampler == "dpmsolver++_2m_lu": + scheduler_cls = DPMSolverMultistepScheduler + elif sample_sampler == "dpmsolver++_2m_k": + scheduler_cls = DPMSolverMultistepScheduler + sched_init_args["use_karras_sigmas"] = True + elif sample_sampler == "dpmsolver++_2m_stable": + scheduler_cls = DPMSolverMultistepScheduler + sched_init_args["euler_at_final"] = True + elif sample_sampler == "dpmsolver++_2m_sde": + scheduler_cls = DPMSolverMultistepScheduler + sched_init_args["algorithm_type"] = "sde-dpmsolver++" + elif sample_sampler == "dpmsolver++_2m_sde_k": + scheduler_cls = DPMSolverMultistepScheduler + sched_init_args["algorithm_type"] = "sde-dpmsolver++" + sched_init_args["use_karras_sigmas"] = True + elif sample_sampler == "dpmsolver++_2m_sde_lu": + scheduler_cls = DPMSolverMultistepScheduler + sched_init_args["algorithm_type"] = "sde-dpmsolver++" + sched_init_args["use_lu_lambdas"] = True + elif sample_sampler == "dpmsolver++_2m_sde_stable": + scheduler_cls = DPMSolverMultistepScheduler + sched_init_args["algorithm_type"] = "sde-dpmsolver++" + sched_init_args["euler_at_final"] = True elif sample_sampler == "dpmsingle": scheduler_cls = DPMSolverSinglestepScheduler elif sample_sampler == "heun": From ca6b68ef7da70ea410145991c1b098590d46f0a2 Mon Sep 17 00:00:00 2001 From: rockerBOO Date: Thu, 23 Jan 2025 17:12:53 -0500 Subject: [PATCH 2/2] Fix dpmsolver++_2m_lu --- library/train_util.py | 1 + 1 file changed, 1 insertion(+) diff --git a/library/train_util.py b/library/train_util.py index eeace35a3..ac1089887 100644 --- a/library/train_util.py +++ b/library/train_util.py @@ -5984,6 +5984,7 @@ def get_my_scheduler( scheduler_cls = DPMSolverMultistepScheduler elif sample_sampler == "dpmsolver++_2m_lu": scheduler_cls = DPMSolverMultistepScheduler + sched_init_args["use_lu_lambdas"] = True elif sample_sampler == "dpmsolver++_2m_k": scheduler_cls = DPMSolverMultistepScheduler sched_init_args["use_karras_sigmas"] = True