Files
2024-11-20 08:18:11 +07:00

35 lines
897 B
Python

from huggingface_hub import hf_hub_download, snapshot_download
import shutil
import os
os.makedirs("../models/instantid", exist_ok=True)
hf_hub_download(
repo_id="InstantX/InstantID", filename="ip-adapter.bin", local_dir="../models/instantid"
)
hf_hub_download(
repo_id="InstantX/InstantID",
filename="ControlNetModel/config.json",
local_dir="../models/controlnet",
)
hf_hub_download(
repo_id="InstantX/InstantID",
filename="ControlNetModel/diffusion_pytorch_model.safetensors",
local_dir="../models/controlnet",
)
os.makedirs("../models/insightface/", exist_ok=True)
os.makedirs("../models/insightface/", exist_ok=True)
snapshot_download(
repo_id="vuongminhkhoi4/antelopev2",
cache_dir ="models",
repo_type ="model",
local_dir="../models/insightface",
)
if os.path.exists("./models") and os.path.isdir("./models"):
shutil.rmtree("./models")