Spaces:
Runtime error
Runtime error
fast scheduler
Browse files
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,
|
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 =
|
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 |
|