yizhangliu commited on
Commit
e2718c0
1 Parent(s): bb4525d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -272,23 +272,22 @@ with image_blocks as demo:
272
  with gr.Column():
273
  image = gr.Image(source='upload', tool='sketch', elem_id="image_upload", type="pil", label="Upload") #.style(height=400)
274
  with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
275
- # prompt = gr.Textbox(placeholder = 'Your prompt (what you want in place of what is erased)', show_label=False, elem_id="input-text")
276
  btn = gr.Button("Done!").style(
277
  margin=True,
278
  rounded=(True, True, True, True),
279
  full_width=True,
280
- )
281
- '''
282
  with gr.Column():
283
  image_out = gr.Image(label="Output", elem_id="output-img").style(height=400)
284
  with gr.Group(elem_id="share-btn-container"):
285
  community_icon = gr.HTML(community_icon_html, visible=False)
286
  loading_icon = gr.HTML(loading_icon_html, visible=False)
287
  share_button = gr.Button("Share to community", elem_id="share-btn", visible=False)
288
- '''
289
 
290
- # btn.click(fn=predict, inputs=[image, prompt], outputs=[image_out, community_icon, loading_icon, share_button])
291
- btn.click(fn=predict, inputs=[image], outputs=[image]) #, community_icon, loading_icon, share_button])
292
- # share_button.click(None, [], [], _js=share_js)
293
 
294
  image_blocks.launch()
 
272
  with gr.Column():
273
  image = gr.Image(source='upload', tool='sketch', elem_id="image_upload", type="pil", label="Upload") #.style(height=400)
274
  with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
275
+ prompt = gr.Textbox(placeholder = 'Your prompt (what you want in place of what is erased)', show_label=False, elem_id="input-text")
276
  btn = gr.Button("Done!").style(
277
  margin=True,
278
  rounded=(True, True, True, True),
279
  full_width=True,
280
+ )
 
281
  with gr.Column():
282
  image_out = gr.Image(label="Output", elem_id="output-img").style(height=400)
283
  with gr.Group(elem_id="share-btn-container"):
284
  community_icon = gr.HTML(community_icon_html, visible=False)
285
  loading_icon = gr.HTML(loading_icon_html, visible=False)
286
  share_button = gr.Button("Share to community", elem_id="share-btn", visible=False)
287
+
288
 
289
+ btn.click(fn=predict, inputs=[image, prompt], outputs=[image_out, community_icon, loading_icon, share_button])
290
+ #btn.click(fn=predict, inputs=[image], outputs=[image]) #, community_icon, loading_icon, share_button])
291
+ share_button.click(None, [], [], _js=share_js)
292
 
293
  image_blocks.launch()