openfree commited on
Commit
c7bde22
ยท
verified ยท
1 Parent(s): 395a648

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +83 -3
app.py CHANGED
@@ -778,8 +778,87 @@ with gr.Blocks(theme=gr.themes.Soft()) as iface:
778
  section5_generate = gr.Button("์ƒ์„ฑ")
779
  section5_video = gr.Video(label="์„น์…˜ 5 ์˜์ƒ")
780
 
781
- # Event handlers (๊ธฐ์กด ํ•ธ๋“ค๋Ÿฌ๋“ค)
782
- [์ด์ „ ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ๋“ค๊ณผ ๋™์ผ...]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
783
 
784
  # ์ƒˆ๋กœ์šด ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ ์ถ”๊ฐ€
785
  section1_regenerate.click(
@@ -812,7 +891,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as iface:
812
  outputs=section5_prompt
813
  )
814
 
815
- # ๊ธฐ์กด ์„น์…˜ ์ƒ์„ฑ ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ๋“ค
816
  section1_generate.click(
817
  fn=lambda p, pr: generate_section_video(p, pr, 1),
818
  inputs=[section1_prompt, scenario_preset],
@@ -843,6 +922,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as iface:
843
  outputs=section5_video
844
  )
845
 
 
846
  if __name__ == "__main__":
847
  iface.queue(max_size=64, default_concurrency_limit=1, api_open=False).launch(
848
  share=True, show_api=False
 
778
  section5_generate = gr.Button("์ƒ์„ฑ")
779
  section5_video = gr.Video(label="์„น์…˜ 5 ์˜์ƒ")
780
 
781
+ # Event handlers
782
+ txt2vid_preset.change(
783
+ fn=preset_changed,
784
+ inputs=[txt2vid_preset],
785
+ outputs=[
786
+ txt2vid_current_height,
787
+ txt2vid_current_width,
788
+ txt2vid_current_num_frames,
789
+ *txt2vid_advanced[3:]
790
+ ]
791
+ )
792
+
793
+ txt2vid_enhance_toggle.change(
794
+ fn=update_prompt_t2v,
795
+ inputs=[txt2vid_prompt, txt2vid_enhance_toggle],
796
+ outputs=txt2vid_prompt
797
+ )
798
+
799
+ txt2vid_generate.click(
800
+ fn=generate_video_from_text,
801
+ inputs=[
802
+ txt2vid_prompt,
803
+ txt2vid_enhance_toggle,
804
+ txt2vid_negative_prompt,
805
+ txt2vid_frame_rate,
806
+ *txt2vid_advanced[:3],
807
+ txt2vid_current_height,
808
+ txt2vid_current_width,
809
+ txt2vid_current_num_frames,
810
+ ],
811
+ outputs=txt2vid_output,
812
+ concurrency_limit=1,
813
+ concurrency_id="generate_video",
814
+ queue=True,
815
+ )
816
+
817
+ img2vid_preset.change(
818
+ fn=preset_changed,
819
+ inputs=[img2vid_preset],
820
+ outputs=[
821
+ img2vid_current_height,
822
+ img2vid_current_width,
823
+ img2vid_current_num_frames,
824
+ *img2vid_advanced[3:]
825
+ ]
826
+ )
827
+
828
+ img2vid_enhance_toggle.change(
829
+ fn=update_prompt_i2v,
830
+ inputs=[img2vid_prompt, img2vid_enhance_toggle],
831
+ outputs=img2vid_prompt
832
+ )
833
+
834
+ img2vid_generate.click(
835
+ fn=generate_video_from_image,
836
+ inputs=[
837
+ img2vid_image,
838
+ img2vid_prompt,
839
+ img2vid_enhance_toggle,
840
+ img2vid_negative_prompt,
841
+ img2vid_frame_rate,
842
+ *img2vid_advanced[:3],
843
+ img2vid_current_height,
844
+ img2vid_current_width,
845
+ img2vid_current_num_frames,
846
+ ],
847
+ outputs=img2vid_output,
848
+ concurrency_limit=1,
849
+ concurrency_id="generate_video",
850
+ queue=True,
851
+ )
852
+
853
+ # Scenario tab event handlers
854
+ analyze_btn.click(
855
+ fn=analyze_scenario,
856
+ inputs=[scenario_input],
857
+ outputs=[
858
+ section1_prompt, section2_prompt, section3_prompt,
859
+ section4_prompt, section5_prompt
860
+ ]
861
+ )
862
 
863
  # ์ƒˆ๋กœ์šด ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ ์ถ”๊ฐ€
864
  section1_regenerate.click(
 
891
  outputs=section5_prompt
892
  )
893
 
894
+ # ์„น์…˜ ์ƒ์„ฑ ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ
895
  section1_generate.click(
896
  fn=lambda p, pr: generate_section_video(p, pr, 1),
897
  inputs=[section1_prompt, scenario_preset],
 
922
  outputs=section5_video
923
  )
924
 
925
+
926
  if __name__ == "__main__":
927
  iface.queue(max_size=64, default_concurrency_limit=1, api_open=False).launch(
928
  share=True, show_api=False