lixiang46 commited on
Commit
9de3e9f
1 Parent(s): f4f9448
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -131,9 +131,9 @@ with gr.Blocks(css=css) as Tryon:
131
  """)
132
  with gr.Column(elem_id = "col-showcase"):
133
  with gr.Row():
134
- image1 = gr.Image(label="Model", scale=1, value="assets/examples/model1.png", show_share_button=False, type="numpy")
135
- image2 = gr.Image(label="Garment", scale=1, value="assets/examples/garment1.png", show_share_button=False, type="numpy")
136
- image3 = gr.Image(label="Result", scale=1, value="assets/examples/result1.png", show_share_button=False, type="numpy")
137
  show_case = gr.Examples(
138
  examples=[
139
  ["assets/examples/model1.png", "assets/examples/garment1.png", "assets/examples/result1.png"],
@@ -143,8 +143,10 @@ with gr.Blocks(css=css) as Tryon:
143
  label=None
144
  )
145
 
146
- gr.on(
147
- triggers = [image1.change],
 
 
148
  fn=start_tryon,
149
  inputs=[image1, image2, seed, randomize_seed],
150
  outputs=[image_out, seed_used, result_info]
 
131
  """)
132
  with gr.Column(elem_id = "col-showcase"):
133
  with gr.Row():
134
+ image1 = gr.Image(label="Model", scale=1, value="assets/examples/model1.png", show_share_button=False, type="numpy", sources=None)
135
+ image2 = gr.Image(label="Garment", scale=1, value="assets/examples/garment1.png", show_share_button=False, type="numpy", sources=None)
136
+ image3 = gr.Image(label="Result", scale=1, value="assets/examples/result1.png", show_share_button=False, type="numpy", sources=None)
137
  show_case = gr.Examples(
138
  examples=[
139
  ["assets/examples/model1.png", "assets/examples/garment1.png", "assets/examples/result1.png"],
 
143
  label=None
144
  )
145
 
146
+ image1.change(
147
+ imgs = image1,
148
+ garm_img = image2
149
+ ).then(
150
  fn=start_tryon,
151
  inputs=[image1, image2, seed, randomize_seed],
152
  outputs=[image_out, seed_used, result_info]