Spaces:
Sleeping
Sleeping
palondomus
commited on
Commit
•
e418e26
1
Parent(s):
33b57a9
Update CaesarAIART/caesaraiart.py
Browse files
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 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
|
|
|
|
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"
|