Spaces:
Running on Zero
Running on Zero
Commit ·
1a9df5b
1
Parent(s): 0d0c9d9
fix the zero cluster's torch version
Browse files- .gitignore +1 -0
- README.md +3 -1
- app.py +12 -0
- requirements.txt +2 -1
.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
*.pyc
|
README.md
CHANGED
|
@@ -5,7 +5,7 @@ colorFrom: green
|
|
| 5 |
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 6.14.0
|
| 8 |
-
python_version: "3.10"
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
---
|
|
@@ -21,3 +21,5 @@ This Space:
|
|
| 21 |
|
| 22 |
The RefDecoder checkpoint is downloaded at runtime from:
|
| 23 |
`Arrokothwhi/RefDecoder` -> `I2V_Wan2.1/model.pt`
|
|
|
|
|
|
|
|
|
| 5 |
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 6.14.0
|
| 8 |
+
python_version: "3.10.13"
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
---
|
|
|
|
| 21 |
|
| 22 |
The RefDecoder checkpoint is downloaded at runtime from:
|
| 23 |
`Arrokothwhi/RefDecoder` -> `I2V_Wan2.1/model.pt`
|
| 24 |
+
|
| 25 |
+
This Space is intended for Gradio + ZeroGPU deployment.
|
app.py
CHANGED
|
@@ -7,6 +7,17 @@ from pathlib import Path
|
|
| 7 |
import gradio as gr
|
| 8 |
import imageio
|
| 9 |
import numpy as np
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
import torch
|
| 11 |
from diffusers import AutoencoderKLWan as DiffusersWanVAE
|
| 12 |
from diffusers import WanImageToVideoPipeline
|
|
@@ -188,6 +199,7 @@ def decode_with_refdecoder(latents, reference_frame):
|
|
| 188 |
return video
|
| 189 |
|
| 190 |
|
|
|
|
| 191 |
def generate_and_decode(image, prompt, seed, progress=gr.Progress(track_tqdm=False)):
|
| 192 |
if image is None:
|
| 193 |
raise gr.Error("Please upload an input image.")
|
|
|
|
| 7 |
import gradio as gr
|
| 8 |
import imageio
|
| 9 |
import numpy as np
|
| 10 |
+
try:
|
| 11 |
+
import spaces
|
| 12 |
+
except ImportError:
|
| 13 |
+
class _SpacesShim:
|
| 14 |
+
@staticmethod
|
| 15 |
+
def GPU(*args, **kwargs):
|
| 16 |
+
def decorator(fn):
|
| 17 |
+
return fn
|
| 18 |
+
return decorator
|
| 19 |
+
|
| 20 |
+
spaces = _SpacesShim()
|
| 21 |
import torch
|
| 22 |
from diffusers import AutoencoderKLWan as DiffusersWanVAE
|
| 23 |
from diffusers import WanImageToVideoPipeline
|
|
|
|
| 199 |
return video
|
| 200 |
|
| 201 |
|
| 202 |
+
@spaces.GPU(duration=240)
|
| 203 |
def generate_and_decode(image, prompt, seed, progress=gr.Progress(track_tqdm=False)):
|
| 204 |
if image is None:
|
| 205 |
raise gr.Error("Please upload an input image.")
|
requirements.txt
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
gradio==6.14.0
|
| 2 |
imageio==2.37.0
|
| 3 |
numpy==1.26.4
|
| 4 |
-
torch==2.7.
|
| 5 |
transformers==4.56.2
|
| 6 |
diffusers==0.36.0
|
| 7 |
accelerate==1.10.1
|
|
@@ -10,3 +10,4 @@ sentencepiece==0.2.1
|
|
| 10 |
safetensors==0.6.2
|
| 11 |
peft==0.18.0
|
| 12 |
huggingface-hub==0.34.4
|
|
|
|
|
|
| 1 |
gradio==6.14.0
|
| 2 |
imageio==2.37.0
|
| 3 |
numpy==1.26.4
|
| 4 |
+
torch==2.7.1
|
| 5 |
transformers==4.56.2
|
| 6 |
diffusers==0.36.0
|
| 7 |
accelerate==1.10.1
|
|
|
|
| 10 |
safetensors==0.6.2
|
| 11 |
peft==0.18.0
|
| 12 |
huggingface-hub==0.34.4
|
| 13 |
+
spaces
|