charleselena
commited on
Commit
•
a923e3f
1
Parent(s):
3eb4425
fix sintaxis error
Browse files- handler.py +16 -8
handler.py
CHANGED
@@ -68,14 +68,22 @@ class EndpointHandler():
|
|
68 |
# Load StableDiffusionControlNetPipeline
|
69 |
self.stable_diffusion_id = "runwayml/stable-diffusion-v1-5"
|
70 |
#self.stable_diffusion_id = "Lykon/dreamshaper-8"
|
71 |
-
self.pipe = StableDiffusionControlNetPipeline.from_pretrained(self.stable_diffusion_id,
|
72 |
-
controlnet=self.controlnet,
|
73 |
-
torch_dtype=dtype,
|
74 |
-
#safety_checker=None).to(device)
|
75 |
-
#processor = AutoProcessor.from_pretrained("CompVis/stable-diffusion-safety-checker")
|
76 |
-
#safety_checker = SafetyChecker.from_pretrained("CompVis/stable-diffusion-safety-checker")
|
77 |
-
safety_checker = StableDiffusionSafetyChecker.from_pretrained("CompVis/stable-diffusion-safety-checker")
|
78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
# Define Generator with seed
|
80 |
self.generator = torch.Generator(device="cpu").manual_seed(3)
|
81 |
|
|
|
68 |
# Load StableDiffusionControlNetPipeline
|
69 |
self.stable_diffusion_id = "runwayml/stable-diffusion-v1-5"
|
70 |
#self.stable_diffusion_id = "Lykon/dreamshaper-8"
|
71 |
+
# self.pipe = StableDiffusionControlNetPipeline.from_pretrained(self.stable_diffusion_id,
|
72 |
+
# controlnet=self.controlnet,
|
73 |
+
# torch_dtype=dtype,
|
74 |
+
# #safety_checker=None).to(device)
|
75 |
+
# #processor = AutoProcessor.from_pretrained("CompVis/stable-diffusion-safety-checker")
|
76 |
+
# #safety_checker = SafetyChecker.from_pretrained("CompVis/stable-diffusion-safety-checker")
|
77 |
+
# safety_checker = StableDiffusionSafetyChecker.from_pretrained("CompVis/stable-diffusion-safety-checker")
|
78 |
+
|
79 |
+
self.pipe = StableDiffusionControlNetPipeline.from_pretrained(
|
80 |
+
self.stable_diffusion_id,
|
81 |
+
controlnet=self.controlnet,
|
82 |
+
torch_dtype=dtype,
|
83 |
+
safety_checker = StableDiffusionSafetyChecker.from_pretrained("CompVis/stable-diffusion-safety-checker")
|
84 |
+
).to(device)
|
85 |
+
|
86 |
+
|
87 |
# Define Generator with seed
|
88 |
self.generator = torch.Generator(device="cpu").manual_seed(3)
|
89 |
|