karimbenharrak commited on
Commit
4400ef7
1 Parent(s): 56e3148

Update handler.py

Browse files
Files changed (1) hide show
  1. 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
- #self.pipe = AutoPipelineForInpainting.from_pretrained(
23
  "runwayml/stable-diffusion-inpainting",
24
  revision="fp16",
25
  torch_dtype=torch.float16,
26
  )
27
  # use DPMSolverMultistepScheduler
28
- #self.pipe.scheduler = DPMSolverMultistepScheduler.from_config(self.pipe.scheduler.config)
29
  # move to device
30
- #self.pipe = self.pipe.to(device)
31
 
32
- #self.pipe2 = AutoPipelineForInpainting.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0", torch_dtype=torch.float16, variant="fp16", use_safetensors=True)
33
- #self.pipe2.to("cuda")
34
 
35
- #self.pipe3 = AutoPipelineForImage2Image.from_pipe(self.pipe2)
 
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