Fix: Update deprecated APIs and dependencies

#30
by akseljoonas HF Staff - opened
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -634,7 +634,7 @@ def i2i_interface(with_example=False):
634
  fcs_lvl : gr.update(visible=x),
635
  clr_adj : gr.update(visible=x), },
636
  inputs=sim_flag,
637
- outputs=[explain, fid_lvl, fcs_lvl, clr_adj, seed],)
638
 
639
  button.click(
640
  vd_inference.inference_i2i,
@@ -696,7 +696,7 @@ def t2t_interface(with_example=False):
696
  fn=vd_inference.inference_t2t,
697
  inputs=[text, seed],
698
  outputs=[txt_output],
699
- cache_examples=cache_examples, )
700
 
701
  class image_mimage_swap(object):
702
  def __init__(self, block0, block1):
@@ -812,7 +812,7 @@ class example_visible_only_hack(object):
812
  # msk0.change(
813
  # fn=swapf0,
814
  # inputs=[img0, imgm0, msk0],
815
- # outputs=[img0, imgm0],)
816
  # input_session.append([img0, imgm0, istrength0, fcs0, msk0])
817
 
818
  # with gr.Column():
@@ -829,12 +829,12 @@ class example_visible_only_hack(object):
829
  # msk1.change(
830
  # fn=swapf1,
831
  # inputs=[img1, imgm1, msk1],
832
- # outputs=[img1, imgm1],)
833
  # input_session.append([img1, imgm1, istrength1, fcs1, msk1])
834
 
835
  # gr.HTML('<p id=myinst>&nbsp Weight: The strength of the reference image. This weight is subject to <u>Text Domination</u>).</p>'+
836
  # '<p id=myinst>&nbsp Focus: Focus on what aspect of the image? (0-semantic, 0.5-balanced (default), 1-style).</p>'+
837
- # '<p id=myinst>&nbsp Mask: Remove regions on reference image so they will not influence the output.</p>',)
838
 
839
  # text = gr.Textbox(lines=2, placeholder="Input prompt...", label='Text Input')
840
  # tstrength = gr.Slider(label="Text Domination (NoEffect -- TextOnly)", minimum=0, maximum=1, value=0, step=0.02)
@@ -862,7 +862,7 @@ class example_visible_only_hack(object):
862
  # fn=vd_inference.inference_tcg,
863
  # inputs=input_list,
864
  # outputs=[input_gallary, output_gallary, ],
865
- # cache_examples=cache_examples, )
866
 
867
  # gr.HTML('<br><p id=myinst>&nbsp How to add mask: Please see the following instructions.</p><br>'+
868
  # '<div id="maskinst">'+
@@ -891,12 +891,12 @@ class example_visible_only_hack(object):
891
  # msk = gr.Checkbox(label='Use mask?')
892
  # gr.HTML('<p id=myinst>&nbsp Weight: The strength of the reference image. This weight is subject to <u>Text Domination</u>).</p>'+
893
  # '<p id=myinst>&nbsp Focus: Focus on what aspect of the image? (0-semantic, 0.5-balanced (default), 1-style).</p>'+
894
- # '<p id=myinst>&nbsp Mask: Remove regions on reference image so they will not influence the output.</p>',)
895
 
896
  # msk.change(
897
  # fn=image_mimage_swap(img, imgm),
898
  # inputs=[img, imgm, msk],
899
- # outputs=[img, imgm],)
900
  # input_session.append([img, imgm, istrength, fcs, msk])
901
 
902
  # text = gr.Textbox(lines=2, placeholder="Input prompt...", label='Text Input')
@@ -917,7 +917,7 @@ class example_visible_only_hack(object):
917
  # button.click(
918
  # vd_inference.inference_mcg,
919
  # inputs=input_list,
920
- # outputs=[input_gallary, output_gallary], )
921
 
922
  # if with_example:
923
  # create_myexamples(
@@ -926,7 +926,7 @@ class example_visible_only_hack(object):
926
  # fn=vd_inference.inference_mcg,
927
  # inputs=input_list,
928
  # outputs=[input_gallary, output_gallary],
929
- # cache_examples=cache_examples, )
930
 
931
  # gr.HTML('<br><p id=myinst>&nbsp How to add mask: Please see the following instructions.</p><br>'+
932
  # '<div id="maskinst">'+
@@ -1110,5 +1110,5 @@ if True:
1110
  </div>
1111
  """.format(' '+vd_inference.which))
1112
 
1113
- # demo.launch(share=True)
1114
  demo.launch(debug=True)
 
634
  fcs_lvl : gr.update(visible=x),
635
  clr_adj : gr.update(visible=x), },
636
  inputs=sim_flag,
637
+ outputs=[explain, fid_lvl, fcs_lvl, clr_adj, seed])
638
 
639
  button.click(
640
  vd_inference.inference_i2i,
 
696
  fn=vd_inference.inference_t2t,
697
  inputs=[text, seed],
698
  outputs=[txt_output],
699
+ cache_examples=cache_examples)
700
 
701
  class image_mimage_swap(object):
702
  def __init__(self, block0, block1):
 
812
  # msk0.change(
813
  # fn=swapf0,
814
  # inputs=[img0, imgm0, msk0],
815
+ # outputs=[img0, imgm0])
816
  # input_session.append([img0, imgm0, istrength0, fcs0, msk0])
817
 
818
  # with gr.Column():
 
829
  # msk1.change(
830
  # fn=swapf1,
831
  # inputs=[img1, imgm1, msk1],
832
+ # outputs=[img1, imgm1])
833
  # input_session.append([img1, imgm1, istrength1, fcs1, msk1])
834
 
835
  # gr.HTML('<p id=myinst>&nbsp Weight: The strength of the reference image. This weight is subject to <u>Text Domination</u>).</p>'+
836
  # '<p id=myinst>&nbsp Focus: Focus on what aspect of the image? (0-semantic, 0.5-balanced (default), 1-style).</p>'+
837
+ # '<p id=myinst>&nbsp Mask: Remove regions on reference image so they will not influence the output.</p>')
838
 
839
  # text = gr.Textbox(lines=2, placeholder="Input prompt...", label='Text Input')
840
  # tstrength = gr.Slider(label="Text Domination (NoEffect -- TextOnly)", minimum=0, maximum=1, value=0, step=0.02)
 
862
  # fn=vd_inference.inference_tcg,
863
  # inputs=input_list,
864
  # outputs=[input_gallary, output_gallary, ],
865
+ # cache_examples=cache_examples)
866
 
867
  # gr.HTML('<br><p id=myinst>&nbsp How to add mask: Please see the following instructions.</p><br>'+
868
  # '<div id="maskinst">'+
 
891
  # msk = gr.Checkbox(label='Use mask?')
892
  # gr.HTML('<p id=myinst>&nbsp Weight: The strength of the reference image. This weight is subject to <u>Text Domination</u>).</p>'+
893
  # '<p id=myinst>&nbsp Focus: Focus on what aspect of the image? (0-semantic, 0.5-balanced (default), 1-style).</p>'+
894
+ # '<p id=myinst>&nbsp Mask: Remove regions on reference image so they will not influence the output.</p>')
895
 
896
  # msk.change(
897
  # fn=image_mimage_swap(img, imgm),
898
  # inputs=[img, imgm, msk],
899
+ # outputs=[img, imgm])
900
  # input_session.append([img, imgm, istrength, fcs, msk])
901
 
902
  # text = gr.Textbox(lines=2, placeholder="Input prompt...", label='Text Input')
 
917
  # button.click(
918
  # vd_inference.inference_mcg,
919
  # inputs=input_list,
920
+ # outputs=[input_gallary, output_gallary])
921
 
922
  # if with_example:
923
  # create_myexamples(
 
926
  # fn=vd_inference.inference_mcg,
927
  # inputs=input_list,
928
  # outputs=[input_gallary, output_gallary],
929
+ # cache_examples=cache_examples)
930
 
931
  # gr.HTML('<br><p id=myinst>&nbsp How to add mask: Please see the following instructions.</p><br>'+
932
  # '<div id="maskinst">'+
 
1110
  </div>
1111
  """.format(' '+vd_inference.which))
1112
 
1113
+ # demo.launch()
1114
  demo.launch(debug=True)