AashishNKumar commited on
Commit
d83e447
·
verified ·
1 Parent(s): f95820c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -5
app.py CHANGED
@@ -866,14 +866,32 @@ with gr.Blocks(theme=gr.themes.Soft()) as iface:
866
  step=1,
867
  value=25,
868
  )
869
- # Advanced options placeholder
870
- img2vid_advanced = gr.Group() # Create advanced options later if needed
 
 
 
 
 
 
 
 
 
 
 
 
 
871
  img2vid_generate = gr.Button("Step 6: Generate Video", variant="primary", size="lg")
872
 
873
  with gr.Column():
874
  img2vid_output = gr.Video(label="Generated Output")
875
 
876
- img2vid_preset.change(fn=preset_changed, inputs=[img2vid_preset], outputs=img2vid_advanced)
 
 
 
 
 
877
 
878
  img2vid_generate.click(
879
  fn=generate_video_from_image,
@@ -884,7 +902,8 @@ with gr.Blocks(theme=gr.themes.Soft()) as iface:
884
  img2vid_analytics_toggle,
885
  img2vid_negative_prompt,
886
  img2vid_frame_rate,
887
- img2vid_advanced,
 
888
  ],
889
  outputs=img2vid_output,
890
  concurrency_limit=1,
@@ -894,4 +913,3 @@ with gr.Blocks(theme=gr.themes.Soft()) as iface:
894
 
895
  if __name__ == "__main__":
896
  iface.queue(max_size=64, default_concurrency_limit=1, api_open=True).launch(share=True, show_api=True)
897
-
 
866
  step=1,
867
  value=25,
868
  )
869
+ # Replace `gr.Group` with actual advanced settings components
870
+ img2vid_advanced_1 = gr.Slider(
871
+ label="Guidance Scale",
872
+ minimum=1,
873
+ maximum=20,
874
+ step=0.1,
875
+ value=3.5,
876
+ )
877
+ img2vid_advanced_2 = gr.Slider(
878
+ label="Inference Steps",
879
+ minimum=20,
880
+ maximum=100,
881
+ step=1,
882
+ value=40,
883
+ )
884
  img2vid_generate = gr.Button("Step 6: Generate Video", variant="primary", size="lg")
885
 
886
  with gr.Column():
887
  img2vid_output = gr.Video(label="Generated Output")
888
 
889
+ # Update `preset_changed` to only modify valid outputs
890
+ img2vid_preset.change(
891
+ fn=preset_changed,
892
+ inputs=[img2vid_preset],
893
+ outputs=[img2vid_advanced_1, img2vid_advanced_2], # Only include valid output components
894
+ )
895
 
896
  img2vid_generate.click(
897
  fn=generate_video_from_image,
 
902
  img2vid_analytics_toggle,
903
  img2vid_negative_prompt,
904
  img2vid_frame_rate,
905
+ img2vid_advanced_1,
906
+ img2vid_advanced_2,
907
  ],
908
  outputs=img2vid_output,
909
  concurrency_limit=1,
 
913
 
914
  if __name__ == "__main__":
915
  iface.queue(max_size=64, default_concurrency_limit=1, api_open=True).launch(share=True, show_api=True)