Update handler.py
Browse files- handler.py +9 -7
handler.py
CHANGED
@@ -17,22 +17,24 @@ class EndpointHandler():
|
|
17 |
|
18 |
self.pipe = AutoPipelineForInpainting.from_pretrained("diffusers/stable-diffusion-xl-1.0-inpainting-0.1", torch_dtype=torch.float16, variant="fp16").to("cuda")
|
19 |
self.generator = torch.Generator(device="cuda").manual_seed(0)
|
20 |
-
|
|
|
21 |
# load StableDiffusionInpaintPipeline pipeline
|
22 |
-
|
23 |
"runwayml/stable-diffusion-inpainting",
|
24 |
revision="fp16",
|
25 |
torch_dtype=torch.float16,
|
26 |
)
|
27 |
# use DPMSolverMultistepScheduler
|
28 |
-
|
29 |
# move to device
|
30 |
-
|
31 |
|
32 |
-
|
33 |
-
|
34 |
|
35 |
-
|
|
|
36 |
|
37 |
|
38 |
|
|
|
17 |
|
18 |
self.pipe = AutoPipelineForInpainting.from_pretrained("diffusers/stable-diffusion-xl-1.0-inpainting-0.1", torch_dtype=torch.float16, variant="fp16").to("cuda")
|
19 |
self.generator = torch.Generator(device="cuda").manual_seed(0)
|
20 |
+
|
21 |
+
"""
|
22 |
# load StableDiffusionInpaintPipeline pipeline
|
23 |
+
self.pipe = AutoPipelineForInpainting.from_pretrained(
|
24 |
"runwayml/stable-diffusion-inpainting",
|
25 |
revision="fp16",
|
26 |
torch_dtype=torch.float16,
|
27 |
)
|
28 |
# use DPMSolverMultistepScheduler
|
29 |
+
self.pipe.scheduler = DPMSolverMultistepScheduler.from_config(self.pipe.scheduler.config)
|
30 |
# move to device
|
31 |
+
self.pipe = self.pipe.to(device)
|
32 |
|
33 |
+
self.pipe2 = AutoPipelineForInpainting.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0", torch_dtype=torch.float16, variant="fp16", use_safetensors=True)
|
34 |
+
self.pipe2.to("cuda")
|
35 |
|
36 |
+
self.pipe3 = AutoPipelineForImage2Image.from_pipe(self.pipe2)
|
37 |
+
"""
|
38 |
|
39 |
|
40 |
|