Ashley Wright commited on
Commit
0972315
·
1 Parent(s): 71df5b2

Explicitly set image format

Browse files
Files changed (1) hide show
  1. src/main.py +2 -1
src/main.py CHANGED
@@ -3,6 +3,7 @@ from socket import socket, AF_UNIX, SOCK_STREAM
3
  from sys import byteorder
4
  from os import chmod
5
 
 
6
  from pipelines.models import TextToImageRequest
7
 
8
  from pipeline import load_pipeline, infer
@@ -30,7 +31,7 @@ def main():
30
  image = infer(request, pipeline)
31
 
32
  data = BytesIO()
33
- image.save(data, format=image.format)
34
 
35
  packet = data.getvalue()
36
 
 
3
  from sys import byteorder
4
  from os import chmod
5
 
6
+ from PIL.JpegImagePlugin import JpegImageFile
7
  from pipelines.models import TextToImageRequest
8
 
9
  from pipeline import load_pipeline, infer
 
31
  image = infer(request, pipeline)
32
 
33
  data = BytesIO()
34
+ image.save(data, format=JpegImageFile.format)
35
 
36
  packet = data.getvalue()
37