system / dynamic-prompts_colab_private.py
Drditone's picture
Upload dynamic-prompts_colab_private.py
a43475d verified
raw
history blame
1.38 kB
import os
os.environ["HF_AUTH_TOKEN"] = ""
# Hugging Face Hubからダウンロードするための関数
def download_from_huggingface(repo_id, filename, save_path):
from huggingface_hub import hf_hub_download
hf_hub_download(repo_id=repo_id, filename=filename, cache_dir=save_path, token=os.environ["HF_AUTH_TOKEN"])
print(f"File downloaded from Hugging Face: {os.path.join(save_path, filename)}")
# Hugging FaceリポジトリIDとファイル名のリスト
hf_repo_and_files = [
("Drditone/Dynamic_prompt", "Frieren_character.txt"),
("Drditone/Dynamic_prompt", "Frieren_character_female.txt"),
("Drditone/Dynamic_prompt", "order_hair-bangs.txt"),
("Drditone/Dynamic_prompt", "order_natural-hair-color.txt"),
("Drditone/Dynamic_prompt", "order_natural-hair-style.txt"),
("Drditone/Dynamic_prompt", "style_LoRA.txt"),
("Drditone/Dynamic_prompt", "Style_LoRA_b.txt"),
("Drditone/Dynamic_prompt", "style_LoRA_mix.txt"),
("Drditone/Dynamic_prompt", "XL_LoRA.txt"),
("Drditone/Dynamic_prompt", "order_situation.txt")
]
# 保存先ディレクトリ
save_directory = "/content/ReForge/extensions/sd-dynamic-prompts/wildcards"
# Hugging Face Hubからファイルをダウンロード
for repo_id, file_name in hf_repo_and_files:
download_from_huggingface(repo_id, file_name, save_directory)