Update Forge_classic_Kaggle/forge_classic_install.py
Browse files
Forge_classic_Kaggle/forge_classic_install.py
CHANGED
|
@@ -1,12 +1,11 @@
|
|
| 1 |
#!/usr/bin/env python3
|
| 2 |
"""
|
| 3 |
forge_classic_install.py
|
| 4 |
-
|
| 5 |
"""
|
| 6 |
|
| 7 |
import os
|
| 8 |
import subprocess
|
| 9 |
-
import shutil
|
| 10 |
from pathlib import Path
|
| 11 |
|
| 12 |
WORK_DIR = Path("/kaggle/working").resolve()
|
|
@@ -43,20 +42,14 @@ def wget(url: str, output: str | None = None, quiet: bool = False, show_progress
|
|
| 43 |
def main() -> None:
|
| 44 |
os.chdir(WORK_DIR)
|
| 45 |
|
| 46 |
-
# 1.
|
| 47 |
-
wget("https://huggingface.co/datasets/Mightys/Notebook_Scripts/resolve/main/libmimalloc.so.2.1")
|
| 48 |
-
|
| 49 |
-
# 2. download_magic.py
|
| 50 |
-
wget("https://huggingface.co/datasets/Mightys/SwarmuiColab/resolve/main/scripts/download_magic.py")
|
| 51 |
-
|
| 52 |
-
# 3. clonar forge-classic
|
| 53 |
if not FORGE_DIR.exists():
|
| 54 |
run("git clone https://github.com/MightyCrimsonX/sd-webui-forge-classic.git")
|
| 55 |
|
| 56 |
-
#
|
| 57 |
wget(
|
| 58 |
-
"https://huggingface.co/datasets/WhiteAiZ/sd-webui-forge-classic/resolve/main/config.json",
|
| 59 |
-
output=str(FORGE_DIR / "config.json"),
|
| 60 |
quiet=True,
|
| 61 |
show_progress=True
|
| 62 |
)
|
|
@@ -66,45 +59,58 @@ def main() -> None:
|
|
| 66 |
quiet=True,
|
| 67 |
show_progress=True
|
| 68 |
)
|
| 69 |
-
wget(
|
| 70 |
-
"https://huggingface.co/datasets/WhiteAiZ/sd-webui-forge-classic/resolve/main/ui-config.json",
|
| 71 |
-
output=str(FORGE_DIR / "ui-config.json"),
|
| 72 |
-
quiet=True,
|
| 73 |
-
show_progress=True
|
| 74 |
-
)
|
| 75 |
|
| 76 |
-
#
|
| 77 |
EXT_DIR.mkdir(parents=True, exist_ok=True)
|
| 78 |
|
| 79 |
repos = [
|
| 80 |
-
"https://github.com/
|
| 81 |
-
"https://github.com/gutris1/sd-
|
| 82 |
-
"https://github.com/
|
| 83 |
-
"https://github.com/
|
| 84 |
-
"https://github.com/
|
| 85 |
-
"https://github.com/
|
| 86 |
-
"https://github.com/
|
| 87 |
-
"https://github.com/
|
| 88 |
-
"https://github.com/
|
| 89 |
-
"https://github.com/
|
| 90 |
-
"https://github.com/
|
|
|
|
|
|
|
| 91 |
]
|
| 92 |
|
| 93 |
-
for repo in repos:
|
| 94 |
-
clone(repo, depth=
|
| 95 |
|
| 96 |
-
#
|
| 97 |
run("sudo apt update -qq")
|
| 98 |
run("sudo apt install aria2 -q")
|
| 99 |
|
| 100 |
-
#
|
| 101 |
run("pip install gdown -q")
|
| 102 |
|
| 103 |
-
#
|
| 104 |
os.system("clear" if os.name != "nt" else "cls")
|
| 105 |
print("\n" + "=" * 50)
|
| 106 |
print("🎉 Instalación completada")
|
| 107 |
print("=" * 50 + "\n")
|
| 108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
if __name__ == "__main__":
|
| 110 |
main()
|
|
|
|
| 1 |
#!/usr/bin/env python3
|
| 2 |
"""
|
| 3 |
forge_classic_install.py
|
| 4 |
+
Instala WhiteRF (sd-webui-forge-classic) con extensiones y enlaces simbólicos para Kaggle.
|
| 5 |
"""
|
| 6 |
|
| 7 |
import os
|
| 8 |
import subprocess
|
|
|
|
| 9 |
from pathlib import Path
|
| 10 |
|
| 11 |
WORK_DIR = Path("/kaggle/working").resolve()
|
|
|
|
| 42 |
def main() -> None:
|
| 43 |
os.chdir(WORK_DIR)
|
| 44 |
|
| 45 |
+
# 1. Clonar forge-classic
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
if not FORGE_DIR.exists():
|
| 47 |
run("git clone https://github.com/MightyCrimsonX/sd-webui-forge-classic.git")
|
| 48 |
|
| 49 |
+
# 2. Descargar ui-config.json y styles.csv
|
| 50 |
wget(
|
| 51 |
+
"https://huggingface.co/datasets/WhiteAiZ/sd-webui-forge-classic/resolve/main/ui-config.json",
|
| 52 |
+
output=str(FORGE_DIR / "ui-config.json"),
|
| 53 |
quiet=True,
|
| 54 |
show_progress=True
|
| 55 |
)
|
|
|
|
| 59 |
quiet=True,
|
| 60 |
show_progress=True
|
| 61 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
+
# 3. Extensiones
|
| 64 |
EXT_DIR.mkdir(parents=True, exist_ok=True)
|
| 65 |
|
| 66 |
repos = [
|
| 67 |
+
("https://github.com/pamparamm/sd-perturbed-attention", None),
|
| 68 |
+
("https://github.com/gutris1/sd-image-encryption", None),
|
| 69 |
+
("https://github.com/yankooliveira/sd-webui-photopea-embed.git", None),
|
| 70 |
+
("https://github.com/gutris1/sd-hub", 1),
|
| 71 |
+
("https://github.com/Haoming02/sd-forge-couple", 1),
|
| 72 |
+
("https://github.com/etherealxx/batchlinks-webui", None),
|
| 73 |
+
("https://github.com/gutris1/sd-civitai-browser-plus-plus", None),
|
| 74 |
+
("https://github.com/AlUlkesh/stable-diffusion-webui-images-browser", 1),
|
| 75 |
+
("https://github.com/DominikDoom/a1111-sd-webui-tagcomplete", 1),
|
| 76 |
+
("https://github.com/Bing-su/adetailer", 1),
|
| 77 |
+
("https://github.com/NoCrypt/sd-fast-pnginfo", 1),
|
| 78 |
+
("https://github.com/viyiviyi/stable-diffusion-webui-zoomimage", 1),
|
| 79 |
+
("https://github.com/gutris1/sd-simple-dimension-preset", 1),
|
| 80 |
]
|
| 81 |
|
| 82 |
+
for repo, depth in repos:
|
| 83 |
+
clone(repo, depth=depth)
|
| 84 |
|
| 85 |
+
# 4. Sistema + aria2
|
| 86 |
run("sudo apt update -qq")
|
| 87 |
run("sudo apt install aria2 -q")
|
| 88 |
|
| 89 |
+
# 5. gdown
|
| 90 |
run("pip install gdown -q")
|
| 91 |
|
| 92 |
+
# 6. Limpiar output y mostrar mensaje
|
| 93 |
os.system("clear" if os.name != "nt" else "cls")
|
| 94 |
print("\n" + "=" * 50)
|
| 95 |
print("🎉 Instalación completada")
|
| 96 |
print("=" * 50 + "\n")
|
| 97 |
|
| 98 |
+
# 7. Enlaces simbólicos
|
| 99 |
+
# tmp
|
| 100 |
+
run("rm -rf /kaggle/working/tmp ~/tmp")
|
| 101 |
+
run("ln -vs /tmp ~/tmp")
|
| 102 |
+
|
| 103 |
+
# models
|
| 104 |
+
run("rm -rf /kaggle/working/sd-webui-forge-classic/models/Stable-diffusion/tmp_models")
|
| 105 |
+
run("mkdir -p /tmp/models")
|
| 106 |
+
run("ln -vs /tmp/models /kaggle/working/sd-webui-forge-classic/models/Stable-diffusion/tmp_models")
|
| 107 |
+
|
| 108 |
+
# lora
|
| 109 |
+
run("rm -rf /kaggle/working/sd-webui-forge-classic/models/Lora/tmp_lora")
|
| 110 |
+
run("mkdir -p /tmp/lora")
|
| 111 |
+
run("ln -vs /tmp/lora /kaggle/working/sd-webui-forge-classic/models/Lora/tmp_lora")
|
| 112 |
+
|
| 113 |
+
print("\n✅ Enlaces simbólicos creados.")
|
| 114 |
+
|
| 115 |
if __name__ == "__main__":
|
| 116 |
main()
|