Add result image decode
Browse files- handler.py +4 -1
handler.py
CHANGED
@@ -26,6 +26,9 @@ class EndpointHandler():
|
|
26 |
"width": 768}
|
27 |
|
28 |
img = self._pipe(**params).images[0]
|
|
|
|
|
|
|
29 |
res = {"status": 200,
|
30 |
-
"image": base64.b64encode(
|
31 |
return res
|
|
|
26 |
"width": 768}
|
27 |
|
28 |
img = self._pipe(**params).images[0]
|
29 |
+
buf = BytesIO()
|
30 |
+
img.save(buf)
|
31 |
+
|
32 |
res = {"status": 200,
|
33 |
+
"image": base64.b64encode(buf).decode("utf8")}
|
34 |
return res
|