Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import os
|
|
|
|
| 2 |
import sys
|
| 3 |
import subprocess
|
| 4 |
import asyncio
|
|
@@ -33,17 +34,25 @@ def get_value_at_index(obj: Union[Sequence, Mapping], index: int) -> Any:
|
|
| 33 |
except KeyError:
|
| 34 |
return obj["result"][index]
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
|
| 37 |
# --- Model Downloads ---
|
| 38 |
print("Downloading models from Hugging Face Hub...")
|
| 39 |
-
text_encooder_repo =
|
| 40 |
print(text_encooder_repo)
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
print("Downloads complete.")
|
| 48 |
|
| 49 |
|
|
|
|
| 1 |
import os
|
| 2 |
+
import shutil
|
| 3 |
import sys
|
| 4 |
import subprocess
|
| 5 |
import asyncio
|
|
|
|
| 34 |
except KeyError:
|
| 35 |
return obj["result"][index]
|
| 36 |
|
| 37 |
+
def hf_hub_download_local(repo_id, filename, local_dir, **kwargs):
|
| 38 |
+
downloaded_path = hf_hub_download(repo_id=repo_id, filename=filename, **kwargs)
|
| 39 |
+
os.makedirs(local_dir, exist_ok=True)
|
| 40 |
+
base_filename = os.path.basename(filename)
|
| 41 |
+
target_path = os.path.join(local_dir, base_filename)
|
| 42 |
+
shutil.move(downloaded_path, target_path)
|
| 43 |
+
return target_path
|
| 44 |
+
|
| 45 |
|
| 46 |
# --- Model Downloads ---
|
| 47 |
print("Downloading models from Hugging Face Hub...")
|
| 48 |
+
text_encooder_repo = hf_hub_download_local(repo_id="Comfy-Org/Wan_2.1_ComfyUI_repackaged", filename="split_files/text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors", local_dir="models/text_encoders")
|
| 49 |
print(text_encooder_repo)
|
| 50 |
+
hf_hub_download_local(repo_id="Comfy-Org/Wan_2.2_ComfyUI_Repackaged", filename="split_files/diffusion_models/wan2.2_i2v_low_noise_14B_fp8_scaled.safetensors", local_dir="models/unet")
|
| 51 |
+
hf_hub_download_local(repo_id="Comfy-Org/Wan_2.2_ComfyUI_Repackaged", filename="split_files/diffusion_models/wan2.2_i2v_high_noise_14B_fp8_scaled.safetensors", local_dir="models/unet")
|
| 52 |
+
hf_hub_download_local(repo_id="Comfy-Org/Wan_2.1_ComfyUI_repackaged", filename="split_files/vae/wan_2.1_vae.safetensors", local_dir="models/vae")
|
| 53 |
+
hf_hub_download_local(repo_id="Comfy-Org/Wan_2.1_ComfyUI_repackaged", filename="split_files/clip_vision/clip_vision_h.safetensors", local_dir="models/clip_vision")
|
| 54 |
+
hf_hub_download_local(repo_id="Kijai/WanVideo_comfy", filename="Wan22-Lightning/Wan2.2-Lightning_I2V-A14B-4steps-lora_HIGH_fp16.safetensors", local_dir="models/loras")
|
| 55 |
+
hf_hub_download_local(repo_id="Kijai/WanVideo_comfy", filename="Wan22-Lightning/Wan2.2-Lightning_I2V-A14B-4steps-lora_LOW_fp16.safetensors", local_dir="models/loras")
|
| 56 |
print("Downloads complete.")
|
| 57 |
|
| 58 |
|