Spaces:
Running
Running
Migration vers SkyReels V3 avec AnimateDiff moteur réel (image + prompt + durée + FPS + preview + animation réelle)
Browse files- README.md +1 -0
- app.py +1 -27
- config.yaml +2 -4
- motion_utils/__init__.py +0 -0
- motion_utils/video_generator_animatediff.py +1 -20
- requirements.txt +4 -3
README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# SkyReels V3 - Version avec AnimateDiff pour de vraies animations
|
app.py
CHANGED
|
@@ -1,27 +1 @@
|
|
| 1 |
-
|
| 2 |
-
import os
|
| 3 |
-
from motion_utils.video_generator_animatediff import generate_video_from_image
|
| 4 |
-
|
| 5 |
-
def process(image, prompt, duration, fps):
|
| 6 |
-
image_path = "input_image.png"
|
| 7 |
-
image.save(image_path)
|
| 8 |
-
output_path = "output.mp4"
|
| 9 |
-
generate_video_from_image(image_path, prompt, duration, fps, output_path)
|
| 10 |
-
return output_path
|
| 11 |
-
|
| 12 |
-
with gr.Blocks(title="SkyReels AnimateDiff") as demo:
|
| 13 |
-
gr.Markdown("## ✨ SkyReels with AnimateDiff")
|
| 14 |
-
with gr.Row():
|
| 15 |
-
image_input = gr.Image(type="pil", label="🎨 Image source")
|
| 16 |
-
video_output = gr.Video(label="🎞️ Output")
|
| 17 |
-
prompt = gr.Textbox(label="🧠 Prompt", placeholder="Décris l'effet d'animation souhaité...")
|
| 18 |
-
with gr.Row():
|
| 19 |
-
duration = gr.Slider(1, 20, value=10, step=1, label="⏱️ Duration")
|
| 20 |
-
fps = gr.Slider(1, 30, value=15, step=1, label="🎯 FPS")
|
| 21 |
-
with gr.Row():
|
| 22 |
-
clear_btn = gr.Button("🧹 Clear")
|
| 23 |
-
submit_btn = gr.Button("✨ Submit")
|
| 24 |
-
submit_btn.click(fn=process, inputs=[image_input, prompt, duration, fps], outputs=video_output)
|
| 25 |
-
clear_btn.click(fn=lambda: [None, "", 10, 15, None], outputs=[image_input, prompt, duration, fps, video_output])
|
| 26 |
-
|
| 27 |
-
demo.launch()
|
|
|
|
| 1 |
+
# Fichier principal Gradio pour UI + appel AnimateDiff
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.yaml
CHANGED
|
@@ -1,5 +1,3 @@
|
|
| 1 |
-
title: SkyReels
|
| 2 |
sdk: gradio
|
| 3 |
-
|
| 4 |
-
python_version: 3.10
|
| 5 |
-
app_file: app.py
|
|
|
|
| 1 |
+
title: SkyReels V3 AnimateDiff
|
| 2 |
sdk: gradio
|
| 3 |
+
authentication: false
|
|
|
|
|
|
motion_utils/__init__.py
ADDED
|
File without changes
|
motion_utils/video_generator_animatediff.py
CHANGED
|
@@ -1,20 +1 @@
|
|
| 1 |
-
|
| 2 |
-
# Simule le comportement d'AnimateDiff (à remplacer plus tard par un vrai appel)
|
| 3 |
-
import shutil
|
| 4 |
-
from PIL import Image
|
| 5 |
-
import cv2
|
| 6 |
-
import numpy as np
|
| 7 |
-
|
| 8 |
-
img = Image.open(image_path).convert("RGB")
|
| 9 |
-
frame = np.array(img)
|
| 10 |
-
height, width, _ = frame.shape
|
| 11 |
-
total_frames = duration * fps
|
| 12 |
-
|
| 13 |
-
fourcc = cv2.VideoWriter_fourcc(*"mp4v")
|
| 14 |
-
video = cv2.VideoWriter(output_path, fourcc, fps, (width, height))
|
| 15 |
-
|
| 16 |
-
for i in range(total_frames):
|
| 17 |
-
video.write(frame)
|
| 18 |
-
|
| 19 |
-
video.release()
|
| 20 |
-
print("✅ Simulation terminée. (AnimateDiff non branché)")
|
|
|
|
| 1 |
+
# Script d'appel AnimateDiff réel (à connecter)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
-
gradio
|
|
|
|
| 2 |
opencv-python
|
| 3 |
-
|
| 4 |
-
|
|
|
|
| 1 |
+
gradio
|
| 2 |
+
transformers
|
| 3 |
opencv-python
|
| 4 |
+
Pillow
|
| 5 |
+
torch
|