besarismaili commited on
Commit
bf3ae0a
·
1 Parent(s): b841619
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -42,8 +42,13 @@ def anim(f_promt, s_promt):
42
  )
43
 
44
  # Render each frame of animation
 
45
  for idx, frame in enumerate(animator.render()):
46
- frame.save(f"frame_{idx:05d}.png")
 
 
 
 
47
 
48
  with gr.Blocks() as demo:
49
  gr.Markdown("Stability Animation")
@@ -53,4 +58,7 @@ with gr.Blocks() as demo:
53
  btn = gr.Button('Anim')
54
  btn.click(fn=anim, inputs=[f_promt,s_promt], outputs=[outimg],api_name="AnimAPI")
55
 
 
 
 
56
  demo.launch()
 
42
  )
43
 
44
  # Render each frame of animation
45
+ file_paths = []
46
  for idx, frame in enumerate(animator.render()):
47
+ file_path = f"frame_{idx:05d}.png"
48
+ frame.save(file_path)
49
+ file_paths.append(file_path)
50
+
51
+ return file_paths
52
 
53
  with gr.Blocks() as demo:
54
  gr.Markdown("Stability Animation")
 
58
  btn = gr.Button('Anim')
59
  btn.click(fn=anim, inputs=[f_promt,s_promt], outputs=[outimg],api_name="AnimAPI")
60
 
61
+ # Add a File component to display the generated files
62
+ gr.Files(label="Generated Files", source=btn)
63
+
64
  demo.launch()