frodos commited on
Commit
c99f459
1 Parent(s): 54b0e0a

Add result image decode

Browse files
Files changed (1) hide show
  1. 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(img).decode("utf8")}
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