Upload dynamic-prompts_colab_private.py
Browse files
dynamic-prompts_colab_private.py
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
os.environ["HF_AUTH_TOKEN"] = ""
|
3 |
+
|
4 |
+
# Hugging Face Hubからダウンロードするための関数
|
5 |
+
def download_from_huggingface(repo_id, filename, save_path):
|
6 |
+
from huggingface_hub import hf_hub_download
|
7 |
+
hf_hub_download(repo_id=repo_id, filename=filename, cache_dir=save_path, token=os.environ["HF_AUTH_TOKEN"])
|
8 |
+
print(f"File downloaded from Hugging Face: {os.path.join(save_path, filename)}")
|
9 |
+
|
10 |
+
# Hugging FaceリポジトリIDとファイル名のリスト
|
11 |
+
hf_repo_and_files = [
|
12 |
+
("Drditone/Dynamic_prompt", "Frieren_character.txt"),
|
13 |
+
("Drditone/Dynamic_prompt", "Frieren_character_female.txt"),
|
14 |
+
("Drditone/Dynamic_prompt", "order_hair-bangs.txt"),
|
15 |
+
("Drditone/Dynamic_prompt", "order_natural-hair-color.txt"),
|
16 |
+
("Drditone/Dynamic_prompt", "order_natural-hair-style.txt"),
|
17 |
+
("Drditone/Dynamic_prompt", "style_LoRA.txt"),
|
18 |
+
("Drditone/Dynamic_prompt", "Style_LoRA_b.txt"),
|
19 |
+
("Drditone/Dynamic_prompt", "style_LoRA_mix.txt"),
|
20 |
+
("Drditone/Dynamic_prompt", "XL_LoRA.txt"),
|
21 |
+
("Drditone/Dynamic_prompt", "order_situation.txt")
|
22 |
+
]
|
23 |
+
|
24 |
+
# 保存先ディレクトリ
|
25 |
+
save_directory = "/content/ReForge/extensions/sd-dynamic-prompts/wildcards"
|
26 |
+
|
27 |
+
# Hugging Face Hubからファイルをダウンロード
|
28 |
+
for repo_id, file_name in hf_repo_and_files:
|
29 |
+
download_from_huggingface(repo_id, file_name, save_directory)
|