karimbenharrak
commited on
Commit
•
17581a5
1
Parent(s):
b496ec8
Update handler.py
Browse files- handler.py +3 -3
handler.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
from typing import Dict, List, Any
|
2 |
import torch
|
3 |
-
from diffusers import DPMSolverMultistepScheduler, EulerDiscreteScheduler,
|
4 |
from PIL import Image
|
5 |
import base64
|
6 |
from io import BytesIO
|
@@ -32,10 +32,10 @@ class EndpointHandler():
|
|
32 |
|
33 |
|
34 |
self.pipe = StableDiffusionControlNetInpaintPipeline.from_pretrained(
|
35 |
-
"
|
36 |
)
|
37 |
|
38 |
-
self.pipe.scheduler =
|
39 |
self.pipe.enable_model_cpu_offload()
|
40 |
self.pipe.enable_xformers_memory_efficient_attention()
|
41 |
|
|
|
1 |
from typing import Dict, List, Any
|
2 |
import torch
|
3 |
+
from diffusers import DPMSolverMultistepScheduler, EulerDiscreteScheduler, EulerDiscreteScheduler, DDIMScheduler, StableDiffusionInpaintPipeline, AutoPipelineForInpainting, AutoPipelineForImage2Image, DiffusionPipeline, StableDiffusionXLImg2ImgPipeline, StableDiffusionControlNetInpaintPipeline, ControlNetModel, StableDiffusionPipeline
|
4 |
from PIL import Image
|
5 |
import base64
|
6 |
from io import BytesIO
|
|
|
32 |
|
33 |
|
34 |
self.pipe = StableDiffusionControlNetInpaintPipeline.from_pretrained(
|
35 |
+
"runwayml/stable-diffusion-v1-5", controlnet=self.controlnet, torch_dtype=torch.float16
|
36 |
)
|
37 |
|
38 |
+
self.pipe.scheduler = EulerDiscreteScheduler.from_config(self.pipe.scheduler.config)
|
39 |
self.pipe.enable_model_cpu_offload()
|
40 |
self.pipe.enable_xformers_memory_efficient_attention()
|
41 |
|