Fabrice-TIERCELIN commited on
Commit
84e6996
·
verified ·
1 Parent(s): 2e3f466

animate_example

Browse files
Files changed (1) hide show
  1. app.py +35 -1
app.py CHANGED
@@ -27,6 +27,40 @@ fps14Pipe.to("cuda")
27
 
28
  max_64_bit_int = 2**63 - 1
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  def animate(
31
  image: Image,
32
  seed: Optional[int] = 42,
@@ -233,7 +267,7 @@ with gr.Blocks() as demo:
233
  ],
234
  inputs=[image, seed, randomize_seed, motion_bucket_id, fps_id, noise_aug_strength, decoding_t, video_format, frame_format, version],
235
  outputs=[video_output],
236
- fn=animate,
237
  run_on_click=True,
238
  cache_examples=True,
239
  )
 
27
 
28
  max_64_bit_int = 2**63 - 1
29
 
30
+ def animate_example(
31
+ image: Image,
32
+ seed: Optional[int] = 42,
33
+ randomize_seed: bool = True,
34
+ motion_bucket_id: int = 127,
35
+ fps_id: int = 6,
36
+ noise_aug_strength: float = 0.1,
37
+ decoding_t: int = 3,
38
+ video_format: str = "mp4",
39
+ frame_format: str = "webp",
40
+ version: str = "auto",
41
+ output_folder: str = "outputs",
42
+ ):
43
+ video2,
44
+ gif_output2,
45
+ download_button2,
46
+ gallery2,
47
+ seed2,
48
+ information_msg2,
49
+ reset_btn2 = animate(
50
+ image,
51
+ seed,
52
+ randomize_seed,
53
+ motion_bucket_id,
54
+ fps_id,
55
+ noise_aug_strength,
56
+ decoding_t,
57
+ video_format,
58
+ frame_format,
59
+ version,
60
+ output_folder)
61
+
62
+ return video2
63
+
64
  def animate(
65
  image: Image,
66
  seed: Optional[int] = 42,
 
267
  ],
268
  inputs=[image, seed, randomize_seed, motion_bucket_id, fps_id, noise_aug_strength, decoding_t, video_format, frame_format, version],
269
  outputs=[video_output],
270
+ fn=animate_example,
271
  run_on_click=True,
272
  cache_examples=True,
273
  )