openfree commited on
Commit
6727cff
β€’
1 Parent(s): 99ef2e5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -21
app.py CHANGED
@@ -253,18 +253,16 @@ preset_options = [
253
  {"label": "[16:9] 512x320, 10.3초", "width": 512, "height": 320, "num_frames": 257},
254
  ]
255
 
256
-
257
- # preset_changed ν•¨μˆ˜ μˆ˜μ •
258
  def preset_changed(preset):
259
  selected = next(item for item in preset_options if item["label"] == preset)
260
- return {
261
- "txt2vid_height": selected["height"],
262
- "txt2vid_width": selected["width"],
263
- "txt2vid_frames": selected["num_frames"],
264
- "height_slider": gr.update(visible=False),
265
- "width_slider": gr.update(visible=False),
266
- "num_frames_slider": gr.update(visible=False),
267
- }
268
 
269
  def generate_video_from_text(
270
  prompt="",
@@ -605,19 +603,18 @@ with gr.Blocks(theme=gr.themes.Soft()) as iface:
605
  with gr.Column():
606
  img2vid_output = gr.Video(label="μƒμ„±λœ λΉ„λ””μ˜€")
607
 
608
- # preset λ³€κ²½ 이벀트 ν•Έλ“€λŸ¬ μˆ˜μ •
609
  txt2vid_preset.change(
610
  fn=preset_changed,
611
  inputs=[txt2vid_preset],
612
- outputs={
613
- txt2vid_current_height: "txt2vid_height",
614
- txt2vid_current_width: "txt2vid_width",
615
- txt2vid_current_num_frames: "txt2vid_frames",
616
- txt2vid_advanced[3]: "height_slider",
617
- txt2vid_advanced[4]: "width_slider",
618
- txt2vid_advanced[5]: "num_frames_slider",
619
- }
620
- )
621
 
622
 
623
  txt2vid_enhance_toggle.change(
@@ -643,7 +640,6 @@ with gr.Blocks(theme=gr.themes.Soft()) as iface:
643
  queue=True,
644
  )
645
 
646
-
647
  img2vid_preset.change(
648
  fn=preset_changed,
649
  inputs=[img2vid_preset],
 
253
  {"label": "[16:9] 512x320, 10.3초", "width": 512, "height": 320, "num_frames": 257},
254
  ]
255
 
 
 
256
  def preset_changed(preset):
257
  selected = next(item for item in preset_options if item["label"] == preset)
258
+ return [
259
+ selected["height"],
260
+ selected["width"],
261
+ selected["num_frames"],
262
+ gr.update(visible=False),
263
+ gr.update(visible=False),
264
+ gr.update(visible=False),
265
+ ]
266
 
267
  def generate_video_from_text(
268
  prompt="",
 
603
  with gr.Column():
604
  img2vid_output = gr.Video(label="μƒμ„±λœ λΉ„λ””μ˜€")
605
 
 
606
  txt2vid_preset.change(
607
  fn=preset_changed,
608
  inputs=[txt2vid_preset],
609
+ outputs=[
610
+ txt2vid_current_height,
611
+ txt2vid_current_width,
612
+ txt2vid_current_num_frames,
613
+ *txt2vid_advanced[3:]
614
+ ]
615
+ )
616
+
617
+
618
 
619
 
620
  txt2vid_enhance_toggle.change(
 
640
  queue=True,
641
  )
642
 
 
643
  img2vid_preset.change(
644
  fn=preset_changed,
645
  inputs=[img2vid_preset],