Makhinur commited on
Commit
1c16bbe
·
verified ·
1 Parent(s): 1f5da40

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +6 -2
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 img_file:
48
- b64_string = base64.b64encode(img_file.read()).decode('utf-8')
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