tonyassi commited on
Commit
3d2adfb
1 Parent(s): ba2bf14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -66,7 +66,7 @@ def generate(image_editor, prompt, neg_prompt, versions):
66
  final_gallery = versions
67
  final_gallery.append(final_image)
68
 
69
- return final_dict, gr.Gallery(value=final_gallery, visible=True)
70
 
71
  with gr.Blocks() as demo:
72
  gr.Markdown("""
@@ -83,12 +83,12 @@ with gr.Blocks() as demo:
83
  neg_prompt = gr.Textbox(label='Negative Prompt', value='ugly, deformed')
84
  with gr.Column():
85
  version_gallery = gr.Gallery(label="Versions", type="pil", object_fit='contain', visible=False)
86
- restore_button = gr.Button("Restore Version")
87
  selected = gr.Number(show_label=False, visible=False)
88
 
89
 
90
  version_gallery.select(get_select_index, None, selected)
91
- generate_button.click(fn=generate, inputs=[sketch_pad,prompt, neg_prompt, version_gallery], outputs=[sketch_pad, version_gallery])
92
  restore_button.click(fn=restore_version, inputs=[selected, version_gallery], outputs=sketch_pad)
93
 
94
  demo.launch()
 
66
  final_gallery = versions
67
  final_gallery.append(final_image)
68
 
69
+ return final_dict, gr.Gallery(value=final_gallery, visible=True), gr.update(visible=True)
70
 
71
  with gr.Blocks() as demo:
72
  gr.Markdown("""
 
83
  neg_prompt = gr.Textbox(label='Negative Prompt', value='ugly, deformed')
84
  with gr.Column():
85
  version_gallery = gr.Gallery(label="Versions", type="pil", object_fit='contain', visible=False)
86
+ restore_button = gr.Button("Restore Version", visible=False)
87
  selected = gr.Number(show_label=False, visible=False)
88
 
89
 
90
  version_gallery.select(get_select_index, None, selected)
91
+ generate_button.click(fn=generate, inputs=[sketch_pad,prompt, neg_prompt, version_gallery], outputs=[sketch_pad, version_gallery, restore_button])
92
  restore_button.click(fn=restore_version, inputs=[selected, version_gallery], outputs=sketch_pad)
93
 
94
  demo.launch()