Geek7 commited on
Commit
3ecd8a0
·
verified ·
1 Parent(s): cd230ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -28,11 +28,12 @@ def generate_image():
28
 
29
  # Save the generated image to a BytesIO object
30
  img_byte_arr = io.BytesIO()
31
- generated_image.save(img_byte_arr, format='JPEG')
32
  img_byte_arr.seek(0) # Move the cursor to the beginning of the BytesIO object
33
 
34
  # Send the generated image back to the client
35
- return send_file(img_byte_arr, mimetype='image/jpeg')
 
36
 
37
  if __name__ == "__main__":
38
- app.run(debug=True)
 
28
 
29
  # Save the generated image to a BytesIO object
30
  img_byte_arr = io.BytesIO()
31
+ generated_image.save(img_byte_arr, format='PNG')
32
  img_byte_arr.seek(0) # Move the cursor to the beginning of the BytesIO object
33
 
34
  # Send the generated image back to the client
35
+ return send_file(img_byte_arr, mimetype='image/png')
36
+
37
 
38
  if __name__ == "__main__":
39
+ app.run(host='0.0.0.0', port=7860) # Run directly if needed for testing