besarismaili commited on
Commit
4230814
·
1 Parent(s): 5ba3af7
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -45,10 +45,13 @@ def anim(f_promt, s_promt, stability_key):
45
 
46
  # Render each frame of animation
47
  for idx, frame in enumerate(animator.render()):
48
- file_path = f"frame_{idx:05d}.png"
49
  frame.save(file_path)
50
- print("saved: "+file_path)
51
- yield file_path # Yield the path to the generated frame
 
 
 
52
 
53
  with gr.Blocks() as demo:
54
  gr.Markdown("Stability Animation")
@@ -58,7 +61,11 @@ with gr.Blocks() as demo:
58
 
59
  outimg = gr.Files(label="Generated Files")
60
  btn = gr.Button('Anim')
61
-
 
 
 
 
62
  btn.click(fn=anim, inputs=[f_promt, s_promt, stability_key], outputs=[outimg],api_name="AnimAPI")
63
 
64
  demo.launch()
 
45
 
46
  # Render each frame of animation
47
  for idx, frame in enumerate(animator.render()):
48
+ file_path = os.path.join("output", f"frame_{idx:05d}.png")
49
  frame.save(file_path)
50
+ yield file_path
51
+
52
+ def file():
53
+ app_dir = os.getcwd()
54
+ return app_dir
55
 
56
  with gr.Blocks() as demo:
57
  gr.Markdown("Stability Animation")
 
61
 
62
  outimg = gr.Files(label="Generated Files")
63
  btn = gr.Button('Anim')
64
+ fbtn = gr.Button('Get Dir')
65
+ files = gr.Textbox("dir")
66
+
67
+ btn.click(fn=file, inputs=[], outputs=[files])
68
+
69
  btn.click(fn=anim, inputs=[f_promt, s_promt, stability_key], outputs=[outimg],api_name="AnimAPI")
70
 
71
  demo.launch()