palondomus commited on
Commit
e418e26
1 Parent(s): 33b57a9

Update CaesarAIART/caesaraiart.py

Browse files
Files changed (1) hide show
  1. CaesarAIART/caesaraiart.py +6 -4
CaesarAIART/caesaraiart.py CHANGED
@@ -27,10 +27,12 @@ class CaesarAIART:
27
  image_bytes = query({"inputs": prompt})
28
 
29
  image = Image.open(io.BytesIO(image_bytes))
30
- filtered_image = io.BytesIO()
31
- image.save(filtered_image, "PNG")
32
- filtered_image.seek(0)
33
- return filtered_image
 
 
34
 
35
  if __name__ == "__main__":
36
  prompt = "a photo of an astronaut riding a horse on mars"
 
27
  image_bytes = query({"inputs": prompt})
28
 
29
  image = Image.open(io.BytesIO(image_bytes))
30
+ # create a thumbnail image
31
+ imgio = io.BytesIO()
32
+ image.save(imgio, 'JPEG')
33
+ imgio.seek(0)
34
+ return imgio
35
+ #return StreamingResponse(content=imgio, media_type="image/jpeg"
36
 
37
  if __name__ == "__main__":
38
  prompt = "a photo of an astronaut riding a horse on mars"