Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -10,6 +10,10 @@ import numpy as np
|
|
10 |
from PIL import Image
|
11 |
import random
|
12 |
|
|
|
|
|
|
|
|
|
13 |
MODEL_ID = "Wan-AI/Wan2.1-I2V-14B-480P-Diffusers"
|
14 |
LORA_REPO_ID = "Kijai/WanVideo_comfy"
|
15 |
LORA_FILENAME = "Wan21_CausVid_14B_T2V_lora_rank32.safetensors"
|
@@ -25,6 +29,7 @@ pipe.to("cuda")
|
|
25 |
causvid_path = hf_hub_download(repo_id=LORA_REPO_ID, filename=LORA_FILENAME)
|
26 |
pipe.load_lora_weights(causvid_path, adapter_name="causvid_lora")
|
27 |
pipe.set_adapters(["causvid_lora"], adapter_weights=[0.95])
|
|
|
28 |
|
29 |
MOD_VALUE = 32
|
30 |
DEFAULT_H_SLIDER_VALUE = 512
|
|
|
10 |
from PIL import Image
|
11 |
import random
|
12 |
|
13 |
+
os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'max_split_size_mb:512'
|
14 |
+
os.environ['HF_HUB_CACHE'] = '/tmp/hub' # Use temp directory to avoid filling persistent storage
|
15 |
+
|
16 |
+
|
17 |
MODEL_ID = "Wan-AI/Wan2.1-I2V-14B-480P-Diffusers"
|
18 |
LORA_REPO_ID = "Kijai/WanVideo_comfy"
|
19 |
LORA_FILENAME = "Wan21_CausVid_14B_T2V_lora_rank32.safetensors"
|
|
|
29 |
causvid_path = hf_hub_download(repo_id=LORA_REPO_ID, filename=LORA_FILENAME)
|
30 |
pipe.load_lora_weights(causvid_path, adapter_name="causvid_lora")
|
31 |
pipe.set_adapters(["causvid_lora"], adapter_weights=[0.95])
|
32 |
+
pipe.fuse_lora()
|
33 |
|
34 |
MOD_VALUE = 32
|
35 |
DEFAULT_H_SLIDER_VALUE = 512
|