Spaces:
Sleeping
Sleeping
LittleLirow
commited on
Commit
·
67dce58
1
Parent(s):
80b4d74
Add file download button functionality
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ def generate_video(text, auth_openai, auth_elevenlabs, auth_replicate, auth_rev)
|
|
17 |
return generated_video
|
18 |
|
19 |
def download_video(video_path):
|
20 |
-
|
21 |
|
22 |
with gr.Blocks() as demo:
|
23 |
gr.Markdown("Generate a narrated horror story video from a text prompt.")
|
@@ -35,8 +35,10 @@ with gr.Blocks() as demo:
|
|
35 |
with gr.Column():
|
36 |
video_out = gr.Video(label="Output", interactive=False)
|
37 |
download_button = gr.Button("Download")
|
|
|
|
|
38 |
|
39 |
generate_button.click(generate_video, inputs=[prompt_input, auth_openai_input, auth_eleven_input, auth_replicate_input, auth_rev_input], outputs=[video_out])
|
40 |
-
download_button.click(download_video, inputs=[video_out])
|
41 |
|
42 |
demo.launch(debug=True, enable_queue=True)
|
|
|
17 |
return generated_video
|
18 |
|
19 |
def download_video(video_path):
|
20 |
+
return video_path
|
21 |
|
22 |
with gr.Blocks() as demo:
|
23 |
gr.Markdown("Generate a narrated horror story video from a text prompt.")
|
|
|
35 |
with gr.Column():
|
36 |
video_out = gr.Video(label="Output", interactive=False)
|
37 |
download_button = gr.Button("Download")
|
38 |
+
output_file = gr.outputs.File(label="Video Output")
|
39 |
+
output_file.type = "video/mp4"
|
40 |
|
41 |
generate_button.click(generate_video, inputs=[prompt_input, auth_openai_input, auth_eleven_input, auth_replicate_input, auth_rev_input], outputs=[video_out])
|
42 |
+
download_button.click(download_video, inputs=[video_out], outputs=[output_file])
|
43 |
|
44 |
demo.launch(debug=True, enable_queue=True)
|