Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more dpmsolver++2m samplers to solve SDXL sampling artifacts #1895

Draft
wants to merge 2 commits into
base: sd3
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions library/train_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5980,6 +5980,32 @@ 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
sched_init_args["use_lu_lambdas"] = True
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":
Expand Down
Loading