Update handler.py
Browse files- handler.py +7 -7
handler.py
CHANGED
@@ -51,16 +51,16 @@ class EndpointHandler:
|
|
51 |
# Preprocess input
|
52 |
control_image = self.preprocess(data)
|
53 |
# Generate output
|
54 |
-
|
55 |
-
prompt=data.get("prompt","),
|
56 |
-
control_image=
|
57 |
-
|
58 |
num_inference_steps=28,
|
59 |
-
height=
|
60 |
-
width=
|
61 |
).images[0]
|
62 |
# Postprocess output
|
63 |
-
return self.postprocess(
|
64 |
|
65 |
if __name__ == "__main__":
|
66 |
# Example usage
|
|
|
51 |
# Preprocess input
|
52 |
control_image = self.preprocess(data)
|
53 |
# Generate output
|
54 |
+
output_image = self.pipe(
|
55 |
+
prompt=data.get("prompt", ""),
|
56 |
+
control_image=control_image,
|
57 |
+
controlnet_conditioning_scale=0.6,
|
58 |
num_inference_steps=28,
|
59 |
+
height=control_image.size[1],
|
60 |
+
width=control_image.size[0],
|
61 |
).images[0]
|
62 |
# Postprocess output
|
63 |
+
return self.postprocess(output_image)
|
64 |
|
65 |
if __name__ == "__main__":
|
66 |
# Example usage
|