import os, sys, time, shlex, subprocess from pathlib import Path xxx = Path("/kaggle/working") zzz = Path("/kaggle/working/asd") tmp = Path("/kaggle/temp") os.system(f"curl -sLo {xxx}/pantat88.py https://raw.githubusercontent.com/gutris1/segsmaker/main/kaggle/script/pantat88.py") sys.path.append(str(xxx)) from pantat88 import pull, say, download def nenen(): os.chdir(zzz) say("【 {red} Installing Stable Diffusion {d} 】 {red}") time.sleep(2) pull(f"https://github.com/gutris1/segsmaker asd {zzz}") req_list = [ f"https://huggingface.co/pantat88/ui/resolve/main/embeddings.zip {zzz}", f"https://civitai.com/api/download/models/150491 {zzz}/embeddings edgQuality.pt", f"https://huggingface.co/pantat88/ui/resolve/main/4x-UltraSharp.pth {zzz}/models/ESRGAN", f"https://huggingface.co/pantat88/ui/resolve/main/4x-AnimeSharp.pth {zzz}/models/ESRGAN", f"https://huggingface.co/pantat88/ui/resolve/main/4x_NMKD-Superscale-SP_178000_G.pth {zzz}/models/ESRGAN", f"https://huggingface.co/pantat88/ui/resolve/main/4x_RealisticRescaler_100000_G.pth {zzz}/models/ESRGAN", f"https://huggingface.co/pantat88/ui/resolve/main/8x_RealESRGAN.pth {zzz}/models/ESRGAN", f"https://huggingface.co/pantat88/ui/resolve/main/4x_foolhardy_Remacri.pth {zzz}/models/ESRGAN", f"https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors {zzz}/models/VAE"] for lines in req_list: download(lines) unzip = f"unzip -qo {zzz}/embeddings.zip -d {zzz}/embeddings && rm {zzz}/embeddings.zip" os.system(unzip) cmd = [ f"rm -rf {tmp}/* {zzz}/models/Stable-diffusion/tmp_ckpt {zzz}/models/Lora {zzz}/outputs", f"ln -vs {tmp}/ckpt {zzz}/models/Stable-diffusion/tmp_ckpt", f"ln -vs {tmp}/lora {zzz}/models/Lora", f"ln -vs {tmp}/outputs {zzz}/outputs", f"mkdir -p {tmp}/ckpt {tmp}/lora {tmp}/outputs {tmp}/svd {tmp}/z123"] for lines in cmd: subprocess.run(shlex.split(lines)) nenen() susu = xxx / 'nenen88.py' os.remove(susu) os.chdir(xxx)