Update handler.py
Browse files- handler.py +3 -2
handler.py
CHANGED
|
@@ -13,8 +13,9 @@ class EndpointHandler():
|
|
| 13 |
|
| 14 |
def __init__(self, path=""):
|
| 15 |
model_id = "timbrooks/instruct-pix2pix"
|
| 16 |
-
self.
|
| 17 |
-
self.
|
|
|
|
| 18 |
|
| 19 |
def __call__(self, data):
|
| 20 |
|
|
|
|
| 13 |
|
| 14 |
def __init__(self, path=""):
|
| 15 |
model_id = "timbrooks/instruct-pix2pix"
|
| 16 |
+
self.pipe = StableDiffusionInstructPix2PixPipeline.from_pretrained(model_id, torch_dtype=torch.float16, safety_checker=None)
|
| 17 |
+
self.pipe.to("cuda")
|
| 18 |
+
self.pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(self.pipe.scheduler.config)
|
| 19 |
|
| 20 |
def __call__(self, data):
|
| 21 |
|