Uthar commited on
Commit
e3a615c
·
verified ·
1 Parent(s): 7e92123

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -117,6 +117,15 @@ js="""
117
  <script>console.log("BOOOOOOOOOOOOOOOOBS");</script>
118
  """
119
 
 
 
 
 
 
 
 
 
 
120
  with gr.Blocks(fill_width=True, head=js) as demo:
121
  with gr.Tab(str(num_models) + ' Models'):
122
  with gr.Column(scale=2):
@@ -142,7 +151,7 @@ with gr.Blocks(fill_width=True, head=js) as demo:
142
  with gr.Row():
143
  output = [gr.Image(label=m, show_download_button=True,
144
  interactive=False, width=112, height=112, show_share_button=False, format="png",
145
- visible=True) for m in default_models]
146
  current_models = [gr.Textbox(m, visible=False) for m in default_models]
147
 
148
  with gr.Column(scale=2):
 
117
  <script>console.log("BOOOOOOOOOOOOOOOOBS");</script>
118
  """
119
 
120
+ js_upload = """
121
+ () => {
122
+ const link = document.createElement('a');
123
+ link.href = output_data;
124
+ link.download = 'uploaded_image.png';
125
+ link.click();
126
+ }
127
+ """
128
+
129
  with gr.Blocks(fill_width=True, head=js) as demo:
130
  with gr.Tab(str(num_models) + ' Models'):
131
  with gr.Column(scale=2):
 
151
  with gr.Row():
152
  output = [gr.Image(label=m, show_download_button=True,
153
  interactive=False, width=112, height=112, show_share_button=False, format="png",
154
+ visible=True, js=js_upload) for m in default_models]
155
  current_models = [gr.Textbox(m, visible=False) for m in default_models]
156
 
157
  with gr.Column(scale=2):