2023-05-11 12:40:03 +00:00
|
|
|
from diffusers import (
|
|
|
|
DDIMScheduler,
|
2023-08-18 15:13:28 +00:00
|
|
|
DDPMScheduler,
|
|
|
|
DEISMultistepScheduler,
|
2023-05-11 12:40:03 +00:00
|
|
|
DPMSolverMultistepScheduler,
|
2023-08-18 15:13:28 +00:00
|
|
|
DPMSolverSDEScheduler,
|
|
|
|
DPMSolverSinglestepScheduler,
|
2023-05-11 12:40:03 +00:00
|
|
|
EulerAncestralDiscreteScheduler,
|
2023-08-18 15:13:28 +00:00
|
|
|
EulerDiscreteScheduler,
|
2023-05-11 14:23:33 +00:00
|
|
|
HeunDiscreteScheduler,
|
2023-08-18 15:13:28 +00:00
|
|
|
KDPM2AncestralDiscreteScheduler,
|
|
|
|
KDPM2DiscreteScheduler,
|
2023-11-08 06:28:37 +00:00
|
|
|
LCMScheduler,
|
2023-05-11 14:23:33 +00:00
|
|
|
LMSDiscreteScheduler,
|
|
|
|
PNDMScheduler,
|
|
|
|
UniPCMultistepScheduler,
|
2023-07-27 14:54:01 +00:00
|
|
|
)
|
2023-05-11 12:40:03 +00:00
|
|
|
|
2023-11-10 23:44:43 +00:00
|
|
|
SCHEDULER_MAP = {
|
|
|
|
"ddim": (DDIMScheduler, {}),
|
|
|
|
"ddpm": (DDPMScheduler, {}),
|
|
|
|
"deis": (DEISMultistepScheduler, {}),
|
|
|
|
"lms": (LMSDiscreteScheduler, {"use_karras_sigmas": False}),
|
|
|
|
"lms_k": (LMSDiscreteScheduler, {"use_karras_sigmas": True}),
|
|
|
|
"pndm": (PNDMScheduler, {}),
|
|
|
|
"heun": (HeunDiscreteScheduler, {"use_karras_sigmas": False}),
|
|
|
|
"heun_k": (HeunDiscreteScheduler, {"use_karras_sigmas": True}),
|
|
|
|
"euler": (EulerDiscreteScheduler, {"use_karras_sigmas": False}),
|
|
|
|
"euler_k": (EulerDiscreteScheduler, {"use_karras_sigmas": True}),
|
|
|
|
"euler_a": (EulerAncestralDiscreteScheduler, {}),
|
|
|
|
"kdpm_2": (KDPM2DiscreteScheduler, {}),
|
|
|
|
"kdpm_2_a": (KDPM2AncestralDiscreteScheduler, {}),
|
|
|
|
"dpmpp_2s": (DPMSolverSinglestepScheduler, {"use_karras_sigmas": False}),
|
|
|
|
"dpmpp_2s_k": (DPMSolverSinglestepScheduler, {"use_karras_sigmas": True}),
|
|
|
|
"dpmpp_2m": (DPMSolverMultistepScheduler, {"use_karras_sigmas": False}),
|
|
|
|
"dpmpp_2m_k": (DPMSolverMultistepScheduler, {"use_karras_sigmas": True}),
|
|
|
|
"dpmpp_2m_sde": (DPMSolverMultistepScheduler, {"use_karras_sigmas": False, "algorithm_type": "sde-dpmsolver++"}),
|
|
|
|
"dpmpp_2m_sde_k": (DPMSolverMultistepScheduler, {"use_karras_sigmas": True, "algorithm_type": "sde-dpmsolver++"}),
|
|
|
|
"dpmpp_sde": (DPMSolverSDEScheduler, {"use_karras_sigmas": False, "noise_sampler_seed": 0}),
|
|
|
|
"dpmpp_sde_k": (DPMSolverSDEScheduler, {"use_karras_sigmas": True, "noise_sampler_seed": 0}),
|
|
|
|
"unipc": (UniPCMultistepScheduler, {"cpu_only": True}),
|
|
|
|
"lcm": (LCMScheduler, {}),
|
|
|
|
}
|