radames commited on
Commit
ebc6505
·
1 Parent(s): 4058d57

fast scheduler

Browse files
Files changed (1) hide show
  1. stablediffusion-infinity/app.py +3 -3
stablediffusion-infinity/app.py CHANGED
@@ -13,7 +13,7 @@ from fastapi_utils.tasks import repeat_every
13
  import numpy as np
14
  import torch
15
  from torch import autocast
16
- from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
17
  from diffusers.models import AutoencoderKL
18
 
19
  from PIL import Image
@@ -108,10 +108,10 @@ def sync_rooms_data_repo():
108
 
109
  def get_model():
110
  if "inpaint" not in model:
 
111
  inpaint = DiffusionPipeline.from_pretrained(
112
  "stabilityai/stable-diffusion-2-inpainting", torch_dtype=torch.float16, revision="fp16")
113
- inpaint.scheduler = DPMSolverMultistepScheduler.from_config(
114
- inpaint.scheduler.config)
115
  inpaint = inpaint.to("cuda")
116
  model["inpaint"] = inpaint
117
 
 
13
  import numpy as np
14
  import torch
15
  from torch import autocast
16
+ from diffusers import DiffusionPipeline, EulerAncestralDiscreteScheduler
17
  from diffusers.models import AutoencoderKL
18
 
19
  from PIL import Image
 
108
 
109
  def get_model():
110
  if "inpaint" not in model:
111
+ scheduler = EulerAncestralDiscreteScheduler.from_pretrained("stabilityai/stable-diffusion-2-base", subfolder="scheduler")
112
  inpaint = DiffusionPipeline.from_pretrained(
113
  "stabilityai/stable-diffusion-2-inpainting", torch_dtype=torch.float16, revision="fp16")
114
+ inpaint.scheduler = scheduler
 
115
  inpaint = inpaint.to("cuda")
116
  model["inpaint"] = inpaint
117