fffiloni commited on
Commit
fa7e40b
·
verified ·
1 Parent(s): 125ed31

Update injection_main_HF.py

Browse files
Files changed (1) hide show
  1. injection_main_HF.py +39 -15
injection_main_HF.py CHANGED
@@ -630,19 +630,43 @@ if __name__ == "__main__":
630
  label="Seed",
631
  info="Random seed for the model",
632
  )
633
- app = gr.Interface(
634
- fn=style_transfer_app,
635
- inputs=[
636
- text_input,
637
- image_input,
638
- cfg_slider,
639
- content_slider,
640
- style_slider,
641
- seed_slider,
642
- ],
643
- outputs=["image"],
644
- title="Artist Interactive Demo",
645
- examples=examples,
646
- cache_examples=False
647
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
648
  app.launch(show_api=False, show_error=True)
 
630
  label="Seed",
631
  info="Random seed for the model",
632
  )
633
+ image_output= gr.Image(format="png")
634
+
635
+ with gr.Blocks() as app:
636
+
637
+ with gr.Column():
638
+ gr.Markdown("Artist Interactive Demo")
639
+ with gr.row():
640
+ with gr.Column():
641
+ text_input.render()
642
+ image_input.render()
643
+ with gr.Accordion("Advanced settings"):
644
+ with gr.Column():
645
+ cfg_slider.render()
646
+ content_slider.render()
647
+ style_slider.render()
648
+ seed_slider.render()
649
+ submit_btn = gr.Button("Submit")
650
+ with gr.Column():
651
+ image_output.render()
652
+ gr.Examples(
653
+ examples = examples,
654
+ inputs = [text_input, image_input],
655
+ cache_examples=False
656
+ )
657
+ submit_btn.click(
658
+ fn=style_transfer_app,
659
+ inputs=[
660
+ text_input,
661
+ image_input,
662
+ cfg_slider,
663
+ content_slider,
664
+ style_slider,
665
+ seed_slider,
666
+ ],
667
+ outputs=[image_output],
668
+ show_api=False
669
+ )
670
+
671
+
672
  app.launch(show_api=False, show_error=True)