Commit
•
0687973
1
Parent(s):
e849c2a
Update handler.py
Browse files- handler.py +4 -3
handler.py
CHANGED
@@ -15,8 +15,8 @@ if device.type != 'cuda':
|
|
15 |
class EndpointHandler():
|
16 |
def __init__(self, path=""):
|
17 |
|
18 |
-
self.fast_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 |
self.smooth_pipe = StableDiffusionXLImg2ImgPipeline.from_pretrained(
|
@@ -74,7 +74,7 @@ class EndpointHandler():
|
|
74 |
else:
|
75 |
image = None
|
76 |
mask_image = None
|
77 |
-
|
78 |
if(method == "fast"):
|
79 |
image = self.fast_pipe(
|
80 |
prompt=prompt,
|
@@ -88,6 +88,7 @@ class EndpointHandler():
|
|
88 |
).images[0]
|
89 |
|
90 |
return image
|
|
|
91 |
|
92 |
#pipe = AutoPipelineForInpainting.from_pretrained("diffusers/stable-diffusion-xl-1.0-inpainting-0.1", torch_dtype=torch.float16, variant="fp16").to("cuda")
|
93 |
|
|
|
15 |
class EndpointHandler():
|
16 |
def __init__(self, path=""):
|
17 |
|
18 |
+
#self.fast_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 |
self.smooth_pipe = StableDiffusionXLImg2ImgPipeline.from_pretrained(
|
|
|
74 |
else:
|
75 |
image = None
|
76 |
mask_image = None
|
77 |
+
"""
|
78 |
if(method == "fast"):
|
79 |
image = self.fast_pipe(
|
80 |
prompt=prompt,
|
|
|
88 |
).images[0]
|
89 |
|
90 |
return image
|
91 |
+
"""
|
92 |
|
93 |
#pipe = AutoPipelineForInpainting.from_pretrained("diffusers/stable-diffusion-xl-1.0-inpainting-0.1", torch_dtype=torch.float16, variant="fp16").to("cuda")
|
94 |
|