Update app.py
Browse files
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='
|
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/
|
|
|
36 |
|
37 |
if __name__ == "__main__":
|
38 |
-
app.run(
|
|
|
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
|