cr8 commited on
Commit
7eeace0
·
verified ·
1 Parent(s): aaf0b46

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -9
app.py CHANGED
@@ -63,8 +63,9 @@ with gr.Blocks(title="Sticker Maker") as interface:
63
 
64
  with gr.Column():
65
  output_image = gr.Image(
66
- label="Preview and Download", type="pil", interactive=False
67
  )
 
68
 
69
  # Show/hide outline options based on checkbox
70
  add_outline.change(
@@ -75,15 +76,9 @@ with gr.Blocks(title="Sticker Maker") as interface:
75
 
76
  # Process image and allow direct download from preview pane
77
  create_btn.click(
78
- fn=lambda *args: process_image(*args)[0],
79
  inputs=[image_upload, outline_size, outline_color, add_outline],
80
- outputs=output_image,
81
- )
82
-
83
- output_image.change(
84
- fn=lambda img: process_image(img, outline_size=0, outline_color="#FFFFFF", add_outline=False)[1],
85
- inputs=output_image,
86
- outputs=gr.File(label="Download Sticker as PNG"),
87
  )
88
 
89
  if __name__ == "__main__":
 
63
 
64
  with gr.Column():
65
  output_image = gr.Image(
66
+ label="Preview", type="pil", interactive=False
67
  )
68
+ download_file = gr.File(label="Download Sticker as PNG")
69
 
70
  # Show/hide outline options based on checkbox
71
  add_outline.change(
 
76
 
77
  # Process image and allow direct download from preview pane
78
  create_btn.click(
79
+ fn=process_image,
80
  inputs=[image_upload, outline_size, outline_color, add_outline],
81
+ outputs=[output_image, download_file],
 
 
 
 
 
 
82
  )
83
 
84
  if __name__ == "__main__":