Skip to content

Commit

Permalink
feat: add support for DEIS multistep scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Feb 14, 2023
1 parent 05756b2 commit 6b6f2f0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/onnx_web/diffusion/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
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

Expand All @@ -29,6 +34,7 @@
pipeline_schedulers = {
"ddim": DDIMScheduler,
"ddpm": DDPMScheduler,
"deis-multi": DEISMultistepScheduler,
"dpm-multi": DPMSolverMultistepScheduler,
"dpm-single": DPMSolverSinglestepScheduler,
"euler": EulerDiscreteScheduler,
Expand Down
6 changes: 6 additions & 0 deletions api/onnx_web/diffusion/stub_scheduler.py
Original file line number Diff line number Diff line change
@@ -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")
1 change: 1 addition & 0 deletions gui/src/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const PLATFORM_LABELS: Record<string, string> = {
export const SCHEDULER_LABELS: Record<string, string> = {
'ddim': 'DDIM',
'ddpm': 'DDPM',
'deis-multi': 'DEIS Multistep',
'dpm-multi': 'DPM Multistep',
'dpm-single': 'DPM Singlestep',
'euler': 'Euler',
Expand Down
1 change: 1 addition & 0 deletions onnx-web.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"CUDA",
"ddim",
"ddpm",
"deis",
"denoise",
"denoising",
"directml",
Expand Down

0 comments on commit 6b6f2f0

Please sign in to comment.