Update handler.py
Browse files- handler.py +4 -5
handler.py
CHANGED
@@ -21,11 +21,10 @@ class EndpointHandler():
|
|
21 |
# Load StableDiffusionPipeline
|
22 |
self.stable_diffusion_id = "runwayml/stable-diffusion-v1-5"
|
23 |
self.pipe = AutoPipelineForText2Image.from_pretrained(self.stable_diffusion_id,
|
24 |
-
torch_dtype=dtype
|
25 |
-
|
26 |
-
pipe.
|
27 |
-
pipe.
|
28 |
-
pipe = pipe.to(device)
|
29 |
self.seed = 42
|
30 |
# Define Generator with seed
|
31 |
self.generator = torch.Generator(device="cpu").manual_seed(self.seed)
|
|
|
21 |
# Load StableDiffusionPipeline
|
22 |
self.stable_diffusion_id = "runwayml/stable-diffusion-v1-5"
|
23 |
self.pipe = AutoPipelineForText2Image.from_pretrained(self.stable_diffusion_id,
|
24 |
+
torch_dtype=dtype)
|
25 |
+
self.pipe.load_lora_weights("pytorch_lora_weights.safetensors")
|
26 |
+
self.pipe.enable_xformers_memory_efficient_attention()
|
27 |
+
self.pipe = self.pipe.to(device)
|
|
|
28 |
self.seed = 42
|
29 |
# Define Generator with seed
|
30 |
self.generator = torch.Generator(device="cpu").manual_seed(self.seed)
|