hysts HF staff commited on
Commit
875eadd
1 Parent(s): 1925f49
Files changed (1) hide show
  1. app.py +27 -25
app.py CHANGED
@@ -846,55 +846,57 @@ if __name__ == "__main__":
846
  )
847
 
848
  image_upload_button.upload(
849
- preprocess_image, image_upload_button, [input_image, first_frame_path, tracking_points]
 
 
850
  )
851
 
852
  image_end_upload_button.upload(
853
- preprocess_image_end, image_end_upload_button, [input_image_end, last_frame_path, tracking_points]
 
 
854
  )
855
 
856
  add_drag_button.click(
857
- add_drag,
858
- tracking_points,
859
- [
860
- tracking_points,
861
- ],
862
  )
863
 
864
  delete_last_drag_button.click(
865
- delete_last_drag,
866
- [tracking_points, first_frame_path, last_frame_path],
867
- [tracking_points, input_image, input_image_end],
868
  )
869
 
870
  delete_last_step_button.click(
871
- delete_last_step,
872
- [tracking_points, first_frame_path, last_frame_path],
873
- [tracking_points, input_image, input_image_end],
874
  )
875
 
876
  reset_button.click(
877
- reset_states,
878
- [first_frame_path, last_frame_path, tracking_points],
879
- [first_frame_path, last_frame_path, tracking_points],
880
  )
881
 
882
  input_image.select(
883
- add_tracking_points,
884
- [tracking_points, first_frame_path, last_frame_path],
885
- [tracking_points, input_image, input_image_end],
886
  )
887
 
888
  input_image_end.select(
889
- add_tracking_points,
890
- [tracking_points, first_frame_path, last_frame_path],
891
- [tracking_points, input_image, input_image_end],
892
  )
893
 
894
  run_button.click(
895
- Framer.run,
896
- [first_frame_path, last_frame_path, tracking_points, controlnet_cond_scale, motion_bucket_id],
897
- output_video,
898
  )
899
 
900
  demo.launch()
 
846
  )
847
 
848
  image_upload_button.upload(
849
+ fn=preprocess_image,
850
+ inputs=image_upload_button,
851
+ outputs=[input_image, first_frame_path, tracking_points],
852
  )
853
 
854
  image_end_upload_button.upload(
855
+ fn=preprocess_image_end,
856
+ inputs=image_end_upload_button,
857
+ outputs=[input_image_end, last_frame_path, tracking_points],
858
  )
859
 
860
  add_drag_button.click(
861
+ fn=add_drag,
862
+ inputs=tracking_points,
863
+ outputs=tracking_points,
 
 
864
  )
865
 
866
  delete_last_drag_button.click(
867
+ fn=delete_last_drag,
868
+ inputs=[tracking_points, first_frame_path, last_frame_path],
869
+ outputs=[tracking_points, input_image, input_image_end],
870
  )
871
 
872
  delete_last_step_button.click(
873
+ fn=delete_last_step,
874
+ inputs=[tracking_points, first_frame_path, last_frame_path],
875
+ outputs=[tracking_points, input_image, input_image_end],
876
  )
877
 
878
  reset_button.click(
879
+ fn=reset_states,
880
+ inputs=[first_frame_path, last_frame_path, tracking_points],
881
+ outputs=[first_frame_path, last_frame_path, tracking_points],
882
  )
883
 
884
  input_image.select(
885
+ fn=add_tracking_points,
886
+ inputs=[tracking_points, first_frame_path, last_frame_path],
887
+ outputs=[tracking_points, input_image, input_image_end],
888
  )
889
 
890
  input_image_end.select(
891
+ fn=add_tracking_points,
892
+ inputs=[tracking_points, first_frame_path, last_frame_path],
893
+ outputs=[tracking_points, input_image, input_image_end],
894
  )
895
 
896
  run_button.click(
897
+ fn=Framer.run,
898
+ inputs=[first_frame_path, last_frame_path, tracking_points, controlnet_cond_scale, motion_bucket_id],
899
+ outputs=output_video,
900
  )
901
 
902
  demo.launch()