Add Schedulers

This commit is contained in:
Kent Keirsey 2024-03-28 09:28:16 -04:00
parent e8eb9fd533
commit 66d254b715
4 changed files with 10 additions and 2 deletions

View File

@ -14,6 +14,8 @@ from diffusers import (
LMSDiscreteScheduler, LMSDiscreteScheduler,
PNDMScheduler, PNDMScheduler,
UniPCMultistepScheduler, UniPCMultistepScheduler,
EDMDPMSolverMultistepScheduler,
EDMEulerScheduler
) )
SCHEDULER_MAP = { SCHEDULER_MAP = {
@ -32,7 +34,7 @@ SCHEDULER_MAP = {
"kdpm_2_a": (KDPM2AncestralDiscreteScheduler, {}), "kdpm_2_a": (KDPM2AncestralDiscreteScheduler, {}),
"dpmpp_2s": (DPMSolverSinglestepScheduler, {"use_karras_sigmas": False}), "dpmpp_2s": (DPMSolverSinglestepScheduler, {"use_karras_sigmas": False}),
"dpmpp_2s_k": (DPMSolverSinglestepScheduler, {"use_karras_sigmas": True}), "dpmpp_2s_k": (DPMSolverSinglestepScheduler, {"use_karras_sigmas": True}),
"dpmpp_2m": (DPMSolverMultistepScheduler, {"use_karras_sigmas": False}), "dpmpp_2m": (DPMSolverMultistepScheduler, {"use_karras_sigmas": False, "euler_at_final": True}),
"dpmpp_2m_k": (DPMSolverMultistepScheduler, {"use_karras_sigmas": True}), "dpmpp_2m_k": (DPMSolverMultistepScheduler, {"use_karras_sigmas": True}),
"dpmpp_2m_sde": (DPMSolverMultistepScheduler, {"use_karras_sigmas": False, "algorithm_type": "sde-dpmsolver++"}), "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_2m_sde_k": (DPMSolverMultistepScheduler, {"use_karras_sigmas": True, "algorithm_type": "sde-dpmsolver++"}),
@ -40,4 +42,6 @@ SCHEDULER_MAP = {
"dpmpp_sde_k": (DPMSolverSDEScheduler, {"use_karras_sigmas": True, "noise_sampler_seed": 0}), "dpmpp_sde_k": (DPMSolverSDEScheduler, {"use_karras_sigmas": True, "noise_sampler_seed": 0}),
"unipc": (UniPCMultistepScheduler, {"cpu_only": True}), "unipc": (UniPCMultistepScheduler, {"cpu_only": True}),
"lcm": (LCMScheduler, {}), "lcm": (LCMScheduler, {}),
"edm_euler": (EDMEulerScheduler, {}),
"edm_dpmpp_2m": (EDMDPMSolverMultistepScheduler, {}),
} }

View File

@ -9,7 +9,7 @@ module.exports = {
// https://github.com/qdanik/eslint-plugin-path // https://github.com/qdanik/eslint-plugin-path
'path/no-relative-imports': ['error', { maxDepth: 0 }], 'path/no-relative-imports': ['error', { maxDepth: 0 }],
// https://github.com/edvardchen/eslint-plugin-i18next/blob/HEAD/docs/rules/no-literal-string.md // https://github.com/edvardchen/eslint-plugin-i18next/blob/HEAD/docs/rules/no-literal-string.md
'i18next/no-literal-string': 'error', 'i18next/no-literal-string': 'warn',
}, },
overrides: [ overrides: [
/** /**

View File

@ -49,6 +49,8 @@ export const zSchedulerField = z.enum([
'euler_a', 'euler_a',
'kdpm_2_a', 'kdpm_2_a',
'lcm', 'lcm',
'edm_euler',
'edm_dpmpp_2m',
]); ]);
export type SchedulerField = z.infer<typeof zSchedulerField>; export type SchedulerField = z.infer<typeof zSchedulerField>;
// #endregion // #endregion

View File

@ -75,4 +75,6 @@ export const SCHEDULER_OPTIONS: ComboboxOption[] = [
{ value: 'euler_a', label: 'Euler Ancestral' }, { value: 'euler_a', label: 'Euler Ancestral' },
{ value: 'kdpm_2_a', label: 'KDPM 2 Ancestral' }, { value: 'kdpm_2_a', label: 'KDPM 2 Ancestral' },
{ value: 'lcm', label: 'LCM' }, { value: 'lcm', label: 'LCM' },
{ value: 'edm_euler', label: 'EDM Euler' },
{ value: 'edm_dpmpp_2m', label: 'EDM DPM++ 2M' },
].sort((a, b) => a.label.localeCompare(b.label)); ].sort((a, b) => a.label.localeCompare(b.label));