Update main.py
Browse files
main.py
CHANGED
@@ -44,9 +44,13 @@ async def enhance_image(
|
|
44 |
)
|
45 |
|
46 |
# Read the result image and encode it in base64
|
47 |
-
with open(result[0], "rb") as
|
48 |
-
|
49 |
|
|
|
|
|
|
|
|
|
50 |
# Clean up the temporary file
|
51 |
os.remove(temp_file_path)
|
52 |
|
|
|
44 |
)
|
45 |
|
46 |
# Read the result image and encode it in base64
|
47 |
+
with open(result[0], "rb") as image_file:
|
48 |
+
image_data = base64.b64encode(image_file.read()).decode("utf-8")
|
49 |
|
50 |
+
return {
|
51 |
+
"sketch_image_base64": f"data:image/png;base64,{image_data}",
|
52 |
+
"result_file": result[1]
|
53 |
+
}
|
54 |
# Clean up the temporary file
|
55 |
os.remove(temp_file_path)
|
56 |
|