Commit ·
946d8b7
1
Parent(s): c6d41c8
Update handler.py
Browse files- handler.py +4 -2
handler.py
CHANGED
|
@@ -50,6 +50,8 @@ class EndpointHandler:
|
|
| 50 |
image = pipe(prompt, num_inference_steps=30, generator=generator, image=control_image).images[0]
|
| 51 |
|
| 52 |
# postprocess the prediction
|
| 53 |
-
|
|
|
|
|
|
|
| 54 |
|
| 55 |
-
return
|
|
|
|
| 50 |
image = pipe(prompt, num_inference_steps=30, generator=generator, image=control_image).images[0]
|
| 51 |
|
| 52 |
# postprocess the prediction
|
| 53 |
+
buffered = BytesIO()
|
| 54 |
+
image.save(buffered, format="JPEG")
|
| 55 |
+
img_str = base64.b64encode(buffered.getvalue())
|
| 56 |
|
| 57 |
+
return {"result": img_str.decode()}
|