File size: 1,523 Bytes
3e32223
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# download_models.py
import os
import requests

def download_file(url, path):
    if not os.path.exists(path):
        print(f"Downloading {os.path.basename(path)} ...")
        os.makedirs(os.path.dirname(path), exist_ok=True)
        with requests.get(url, stream=True) as r:
            r.raise_for_status()
            with open(path, "wb") as f:
                for chunk in r.iter_content(chunk_size=8192):
                    f.write(chunk)
        print(f"βœ… {os.path.basename(path)} downloaded")
    else:
        print(f"βœ… {os.path.basename(path)} already exists")

# --- SD model (Civitai) ---
download_file(
    "https://civitai.com/api/download/models/143906?type=Model&format=SafeTensor&size=pruned&fp=fp16",
    "stable-diffusion-webui/models/Stable-diffusion/model.safetensors"
)

# --- TemporalNet ControlNet ---
download_file(
    "https://huggingface.co/CiaraRowles/TemporalNet/resolve/main/diff_control_sd15_temporalnet_fp16.safetensors",
    "stable-diffusion-webui/extensions/ControlNet/models/diff_control_sd15_temporalnet_fp16.safetensors"
)

# --- Additional ControlNet v1.1 ---
download_file(
    "https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/main/control_v11f1e_sd15_tile.pth",
    "stable-diffusion-webui/extensions/ControlNet/models/control_v11f1e_sd15_tile.pth"
)

# --- LORA ---
download_file(
    "https://huggingface.co/latent-consistency/lcm-lora-sdv1-5/resolve/main/pytorch_lora_weights.safetensors",
    "stable-diffusion-webui/models/Lora/lcm-lora-sdv1-5.safetensors"
)