diff --git a/api/onnx_web/diffusion/load.py b/api/onnx_web/diffusion/load.py index 6e116b55..919694d3 100644 --- a/api/onnx_web/diffusion/load.py +++ b/api/onnx_web/diffusion/load.py @@ -18,6 +18,11 @@ from diffusers import ( PNDMScheduler, ) +try: + from diffusers import DEISMultistepScheduler +except: + from .stub_scheduler import StubScheduler as DEISMultistepScheduler + from ..params import DeviceParams, Size from ..utils import ServerContext, run_gc @@ -29,6 +34,7 @@ latent_factor = 8 pipeline_schedulers = { "ddim": DDIMScheduler, "ddpm": DDPMScheduler, + "deis-multi": DEISMultistepScheduler, "dpm-multi": DPMSolverMultistepScheduler, "dpm-single": DPMSolverSinglestepScheduler, "euler": EulerDiscreteScheduler, diff --git a/api/onnx_web/diffusion/stub_scheduler.py b/api/onnx_web/diffusion/stub_scheduler.py new file mode 100644 index 00000000..8de415a0 --- /dev/null +++ b/api/onnx_web/diffusion/stub_scheduler.py @@ -0,0 +1,6 @@ +from typing import Any + + +class StubScheduler(): + def step(self, model_output: Any, timestep: int, sample: Any, return_dict: bool = True) -> None: + raise NotImplemented("scheduler not available, try updating diffusers") diff --git a/gui/src/strings.ts b/gui/src/strings.ts index b58f525b..b16934ba 100644 --- a/gui/src/strings.ts +++ b/gui/src/strings.ts @@ -44,6 +44,7 @@ export const PLATFORM_LABELS: Record = { export const SCHEDULER_LABELS: Record = { 'ddim': 'DDIM', 'ddpm': 'DDPM', + 'deis-multi': 'DEIS Multistep', 'dpm-multi': 'DPM Multistep', 'dpm-single': 'DPM Singlestep', 'euler': 'Euler', diff --git a/onnx-web.code-workspace b/onnx-web.code-workspace index 8f441e9b..00ebaf55 100644 --- a/onnx-web.code-workspace +++ b/onnx-web.code-workspace @@ -22,6 +22,7 @@ "CUDA", "ddim", "ddpm", + "deis", "denoise", "denoising", "directml",