Spaces:
Sleeping
Sleeping
Anurag181011
commited on
Commit
·
44b8680
1
Parent(s):
7a7eaf8
Initial commit of Wan2.1 Text-to-Video model
Browse files- .gitattributes +1 -0
- Wan2.1 +1 -0
- app.py +25 -0
- requirements.txt +5 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
Wan2.1/checkpoints/* filter=lfs diff=lfs merge=lfs -text
|
Wan2.1
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Subproject commit 9fb884500990c22bf8527ca057010f94b2445fd2
|
app.py
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import torch
|
| 3 |
+
from Wan2.1.wan.pipeline import WanPipeline
|
| 4 |
+
|
| 5 |
+
# Initialize the pipeline
|
| 6 |
+
pipe = WanPipeline(
|
| 7 |
+
model_dir="Wan2.1/checkpoints",
|
| 8 |
+
device="cuda" if torch.cuda.is_available() else "cpu"
|
| 9 |
+
)
|
| 10 |
+
|
| 11 |
+
def generate_video(prompt):
|
| 12 |
+
video_frames = pipe.generate(prompt)
|
| 13 |
+
return video_frames
|
| 14 |
+
|
| 15 |
+
# Gradio interface
|
| 16 |
+
iface = gr.Interface(
|
| 17 |
+
fn=generate_video,
|
| 18 |
+
inputs=gr.Textbox(label="Prompt"),
|
| 19 |
+
outputs=gr.Video(label="Generated Video"),
|
| 20 |
+
title="Wan2.1 Text-to-Video Generation",
|
| 21 |
+
description="Generate videos from text prompts using the Wan2.1 model."
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
if __name__ == "__main__":
|
| 25 |
+
iface.launch()
|
requirements.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
torch>=1.13.0
|
| 2 |
+
transformers
|
| 3 |
+
einops
|
| 4 |
+
accelerate
|
| 5 |
+
gradio
|