Upload download_wanholocine_models.py
Browse files
download_wanholocine_models.py
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import subprocess
|
| 3 |
+
|
| 4 |
+
# Optional Hugging Face token
|
| 5 |
+
HF_TOKEN = "hf_TOLKEIN" # leave empty if not needed
|
| 6 |
+
|
| 7 |
+
# Target folders
|
| 8 |
+
base_dirs = {
|
| 9 |
+
"Wan2.2-Fun": "models/loras/Wan2.2-Fun-Reward-LoRAs",
|
| 10 |
+
"Wan2_2-T2V": "models/diffusion_models/T2V/HoloCine"
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
# Model URLs
|
| 14 |
+
urls = [
|
| 15 |
+
"https://huggingface.co/alibaba-pai/Wan2.2-Fun-Reward-LoRAs/resolve/main/Wan2.2-Fun-A14B-InP-high-noise-MPS.safetensors",
|
| 16 |
+
"https://huggingface.co/alibaba-pai/Wan2.2-Fun-Reward-LoRAs/resolve/main/Wan2.2-Fun-A14B-InP-low-noise-MPS.safetensors",
|
| 17 |
+
"https://huggingface.co/alibaba-pai/Wan2.2-Fun-Reward-LoRAs/resolve/main/Wan2.2-Fun-A14B-InP-low-noise-HPS2.1.safetensors",
|
| 18 |
+
"https://huggingface.co/alibaba-pai/Wan2.2-Fun-Reward-LoRAs/resolve/main/Wan2.2-Fun-A14B-InP-high-noise-HPS2.1.safetensors",
|
| 19 |
+
"https://huggingface.co/Kijai/WanVideo_comfy_fp8_scaled/resolve/main/T2V/HoloCine/Wan2_2-T2V-A14B-LOW-HoloCine-full_fp8_e4m3fn_scaled_KJ.safetensors",
|
| 20 |
+
"https://huggingface.co/Kijai/WanVideo_comfy_fp8_scaled/resolve/main/T2V/HoloCine/Wan2_2-T2V-A14B-HIGH-HoloCine-full_fp8_e4m3fn_scaled_KJ.safetensors",
|
| 21 |
+
"https://huggingface.co/QuantStack/HoloCine-GGUF/resolve/main/Full/HighNoise/HoloCine-Full-HighNoise-Q8_0.gguf",
|
| 22 |
+
"https://huggingface.co/QuantStack/HoloCine-GGUF/resolve/main/Full/LowNoise/HoloCine-Full-LowNoise-Q8_0.gguf",
|
| 23 |
+
"https://huggingface.co/RicketsRandom/Wan_2_2_Lora/resolve/main/Light/Wan22_A14B_T2V_LOW_Lightning_4steps_lora_250928_rank64_fp16.safetensors",
|
| 24 |
+
"https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/main/split_files/loras/wan2.2_t2v_lightx2v_4steps_lora_v1.1_low_noise.safetensors",
|
| 25 |
+
"https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged/resolve/main/split_files/loras/wan2.2_t2v_lightx2v_4steps_lora_v1.1_high_noise.safetensors",
|
| 26 |
+
]
|
| 27 |
+
|
| 28 |
+
def download_model(url):
|
| 29 |
+
filename = url.split("/")[-1]
|
| 30 |
+
target_dir = None
|
| 31 |
+
|
| 32 |
+
# Match destination folder
|
| 33 |
+
for key, path in base_dirs.items():
|
| 34 |
+
if key in filename:
|
| 35 |
+
target_dir = path
|
| 36 |
+
break
|
| 37 |
+
if not target_dir:
|
| 38 |
+
target_dir = "models/others"
|
| 39 |
+
|
| 40 |
+
os.makedirs(target_dir, exist_ok=True)
|
| 41 |
+
output_path = os.path.join(target_dir, filename)
|
| 42 |
+
|
| 43 |
+
# Skip if file already exists *and* is not empty
|
| 44 |
+
if os.path.exists(output_path) and os.path.getsize(output_path) > 1024:
|
| 45 |
+
print(f"⏭️ Skipping {filename} — file already exists ({os.path.getsize(output_path)/1_000_000:.2f} MB).")
|
| 46 |
+
return
|
| 47 |
+
|
| 48 |
+
print(f"⬇️ Downloading {filename} → {target_dir}")
|
| 49 |
+
|
| 50 |
+
cmd = [
|
| 51 |
+
"wget",
|
| 52 |
+
"--continue",
|
| 53 |
+
"--no-check-certificate",
|
| 54 |
+
"-O", output_path,
|
| 55 |
+
]
|
| 56 |
+
|
| 57 |
+
if HF_TOKEN:
|
| 58 |
+
cmd += ["--header", f"Authorization: Bearer {HF_TOKEN}"]
|
| 59 |
+
|
| 60 |
+
cmd.append(url)
|
| 61 |
+
|
| 62 |
+
try:
|
| 63 |
+
subprocess.run(cmd, check=True)
|
| 64 |
+
size = os.path.getsize(output_path) / 1_000_000
|
| 65 |
+
print(f"✅ Finished {filename} ({size:.2f} MB)\n")
|
| 66 |
+
except subprocess.CalledProcessError as e:
|
| 67 |
+
print(f"❌ Failed {filename}: {e}\n")
|
| 68 |
+
if os.path.exists(output_path) and os.path.getsize(output_path) == 0:
|
| 69 |
+
os.remove(output_path)
|
| 70 |
+
|
| 71 |
+
if __name__ == "__main__":
|
| 72 |
+
for link in urls:
|
| 73 |
+
download_model(link)
|
| 74 |
+
print("✅ All downloads attempted (skipping complete files only).")
|