Spaces:
Runtime error
Runtime error
Commit
·
5d8217d
1
Parent(s):
134e0da
app.py
CHANGED
@@ -46,14 +46,15 @@ def anim(f_promt, s_promt, stability_key):
|
|
46 |
repo_dir = os.getenv('HF_COMET_ROOT_PATH', '/')
|
47 |
|
48 |
# Define output folder path
|
49 |
-
output_dir = os.path.join("
|
|
|
50 |
|
51 |
# Render each frame of animation
|
52 |
for idx, frame in enumerate(animator.render()):
|
53 |
file_path = os.path.join(output_dir, f"frame_{idx:05d}.png")
|
54 |
frame.save(file_path)
|
55 |
print("Created frame at:"+file_path)
|
56 |
-
yield gr.
|
57 |
|
58 |
with gr.Blocks() as demo:
|
59 |
gr.Markdown("Stability Animation")
|
@@ -61,7 +62,7 @@ with gr.Blocks() as demo:
|
|
61 |
s_promt = gr.Textbox(label="Second Prompt", value="a photo of a cute dog")
|
62 |
stability_key = gr.Textbox(label="Stability Key", value="")
|
63 |
|
64 |
-
outimg = gr.
|
65 |
btn = gr.Button('Anim')
|
66 |
|
67 |
btn.click(fn=anim, inputs=[f_promt, s_promt, stability_key], outputs=[outimg],api_name="AnimAPI")
|
|
|
46 |
repo_dir = os.getenv('HF_COMET_ROOT_PATH', '/')
|
47 |
|
48 |
# Define output folder path
|
49 |
+
output_dir = os.path.join(repo_dir, "output")
|
50 |
+
image_path = "/tmp/frames/"
|
51 |
|
52 |
# Render each frame of animation
|
53 |
for idx, frame in enumerate(animator.render()):
|
54 |
file_path = os.path.join(output_dir, f"frame_{idx:05d}.png")
|
55 |
frame.save(file_path)
|
56 |
print("Created frame at:"+file_path)
|
57 |
+
yield gr.Image(value=file_path)
|
58 |
|
59 |
with gr.Blocks() as demo:
|
60 |
gr.Markdown("Stability Animation")
|
|
|
62 |
s_promt = gr.Textbox(label="Second Prompt", value="a photo of a cute dog")
|
63 |
stability_key = gr.Textbox(label="Stability Key", value="")
|
64 |
|
65 |
+
outimg = gr.Image(label="Generated Files")
|
66 |
btn = gr.Button('Anim')
|
67 |
|
68 |
btn.click(fn=anim, inputs=[f_promt, s_promt, stability_key], outputs=[outimg],api_name="AnimAPI")
|