Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from motion_utils.video_generator_svd import generate_video_from_image | |
| import tempfile | |
| import os | |
| def process(image, duration, fps): | |
| with tempfile.TemporaryDirectory() as tmpdir: | |
| image_path = os.path.join(tmpdir, "input_image.png") | |
| output_path = os.path.join(tmpdir, "output_video.mp4") | |
| image.save(image_path) | |
| generate_video_from_image(image_path, duration, fps, output_path) | |
| return output_path | |
| with gr.Blocks() as demo: | |
| gr.Markdown("### SkyReels V3 - Stable Video Diffusion (sans prompt)") | |
| with gr.Row(): | |
| with gr.Column(): | |
| input_image = gr.Image(label="Image source", type="pil") | |
| duration = gr.Slider(1, 10, value=4, step=1, label="Durée (secondes)") | |
| fps = gr.Slider(5, 30, value=10, step=1, label="FPS (images/seconde)") | |
| btn = gr.Button("Générer la vidéo") | |
| with gr.Column(): | |
| output_video = gr.Video(label="Vidéo générée") | |
| btn.click(fn=process, inputs=[input_image, duration, fps], outputs=output_video) | |
| demo.launch() | |