rishi9440 commited on
Commit
80f97ab
·
1 Parent(s): 4470c14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -28,5 +28,7 @@ def pil_to_base64_string(pil_image):
28
  # Launch the interface
29
  iface.launch()
30
 
31
- # After the interface is launched, you can download the output image as follows:
32
- output_pil = iface.get_output() # get the output PIL image from the
 
 
 
28
  # Launch the interface
29
  iface.launch()
30
 
31
+ output_pil = iface.get_output() # get the output PIL image from the interface
32
+ output_base64_str = pil_to_base64_string(output_pil) # convert the PIL image to base64 string
33
+ with open("output_image.png", "wb") as f:
34
+ f.write(base64.b64decode(output_base64_str)) # write the decoded base64 string to a file