Update app.py
Browse files
app.py
CHANGED
|
@@ -12,18 +12,6 @@ elif("T4" in gpu_info):
|
|
| 12 |
os.system(f"git clone https://github.com/camenduru/stable-diffusion-webui /home/user/app/stable-diffusion-webui")
|
| 13 |
os.chdir("/home/user/app/stable-diffusion-webui")
|
| 14 |
|
| 15 |
-
def DownLoad(URI:str,DownloadPath:pathlib.Path,DownLoadFileName:str ) -> int:
|
| 16 |
-
if (DownloadPath / DownLoadFileName).is_file(): return 0
|
| 17 |
-
for z in range(10):
|
| 18 |
-
i=subprocess.run([r"aria2c",r"-c",r"-x" ,r"16", r"-s",r"16", r"-k" ,r"1M" ,r"-m",r"0",r"--enable-mmap=false",r"--console-log-level=error",r"-d",str(DownloadPath),r"-o",DownLoadFileName,URI]);
|
| 19 |
-
if(i.returncode == 0 ):
|
| 20 |
-
del i
|
| 21 |
-
gc.collect()
|
| 22 |
-
return 0
|
| 23 |
-
else :
|
| 24 |
-
del i
|
| 25 |
-
raise Exception(str.format("download \'{0}\' failed",URI))
|
| 26 |
-
|
| 27 |
os.system(f"wget -q https://github.com/camenduru/webui/raw/main/env_patch.py -O /home/user/app/env_patch.py")
|
| 28 |
os.system(f"sed -i -e '/import image_from_url_text/r /home/user/app/env_patch.py' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
| 29 |
os.system(f"sed -i -e '/(modelmerger_interface, \"Checkpoint Merger\", \"modelmerger\"),/d' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
|
@@ -73,50 +61,7 @@ else:
|
|
| 73 |
os.system(f"wget https://huggingface.co/Xenos14/TestBed/resolve/main/2024-Real/XenoREALITY-V3.safetensors --content-disposition -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/XenoREALITY-V3.safetensors")
|
| 74 |
#os.system(f"wget https://huggingface.co/Xenos14/TestBed/resolve/main/2024-Gen9/XenoENGINE-ArtStyle-v5.safetensors --content-disposition -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/XenoENGINE-ArtStyle-v5.safetensors")
|
| 75 |
|
| 76 |
-
|
| 77 |
-
#download ControlNet models
|
| 78 |
-
print("extensions dolwnload done .\ndownloading ControlNet models")
|
| 79 |
-
dList =[r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11e_sd15_ip2p_fp16.safetensors",
|
| 80 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11e_sd15_shuffle_fp16.safetensors",
|
| 81 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_canny_fp16.safetensors",
|
| 82 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11f1p_sd15_depth_fp16.safetensors",
|
| 83 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_inpaint_fp16.safetensors",
|
| 84 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_lineart_fp16.safetensors",
|
| 85 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_mlsd_fp16.safetensors",
|
| 86 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_normalbae_fp16.safetensors",
|
| 87 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_openpose_fp16.safetensors",
|
| 88 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_scribble_fp16.safetensors",
|
| 89 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_seg_fp16.safetensors",
|
| 90 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_softedge_fp16.safetensors",
|
| 91 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15s2_lineart_anime_fp16.safetensors",
|
| 92 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11f1e_sd15_tile_fp16.safetensors",
|
| 93 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11e_sd15_ip2p_fp16.yaml",
|
| 94 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11e_sd15_shuffle_fp16.yaml",
|
| 95 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_canny_fp16.yaml",
|
| 96 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11f1p_sd15_depth_fp16.yaml",
|
| 97 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_inpaint_fp16.yaml",
|
| 98 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_lineart_fp16.yaml",
|
| 99 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_mlsd_fp16.yaml",
|
| 100 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_normalbae_fp16.yaml",
|
| 101 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_openpose_fp16.yaml",
|
| 102 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_scribble_fp16.yaml",
|
| 103 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_seg_fp16.yaml",
|
| 104 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_softedge_fp16.yaml",
|
| 105 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15s2_lineart_anime_fp16.yaml",
|
| 106 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11f1e_sd15_tile_fp16.yaml",
|
| 107 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_style_sd14v1.pth",
|
| 108 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_sketch_sd14v1.pth",
|
| 109 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_seg_sd14v1.pth",
|
| 110 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_openpose_sd14v1.pth",
|
| 111 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_keypose_sd14v1.pth",
|
| 112 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_depth_sd14v1.pth",
|
| 113 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_canny_sd14v1.pth",
|
| 114 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_canny_sd15v2.pth",
|
| 115 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_depth_sd15v2.pth",
|
| 116 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_sketch_sd15v2.pth",
|
| 117 |
-
r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_zoedepth_sd15v1.pth"]
|
| 118 |
-
for i in range(0,len(dList)): DownLoad(dList[i],user_home / r"stable-diffusion-webui" / r"extensions" / "sd-webui-controlnet" / r"models",pathlib.Path(dList[i]).name)
|
| 119 |
-
del dList
|
| 120 |
|
| 121 |
|
| 122 |
os.system(f"wget -q https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.ckpt -O /home/user/app/stable-diffusion-webui/models/VAE/vae-ft-mse-840000-ema-pruned.ckpt")
|
|
|
|
| 12 |
os.system(f"git clone https://github.com/camenduru/stable-diffusion-webui /home/user/app/stable-diffusion-webui")
|
| 13 |
os.chdir("/home/user/app/stable-diffusion-webui")
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
os.system(f"wget -q https://github.com/camenduru/webui/raw/main/env_patch.py -O /home/user/app/env_patch.py")
|
| 16 |
os.system(f"sed -i -e '/import image_from_url_text/r /home/user/app/env_patch.py' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
| 17 |
os.system(f"sed -i -e '/(modelmerger_interface, \"Checkpoint Merger\", \"modelmerger\"),/d' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
|
|
|
| 61 |
os.system(f"wget https://huggingface.co/Xenos14/TestBed/resolve/main/2024-Real/XenoREALITY-V3.safetensors --content-disposition -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/XenoREALITY-V3.safetensors")
|
| 62 |
#os.system(f"wget https://huggingface.co/Xenos14/TestBed/resolve/main/2024-Gen9/XenoENGINE-ArtStyle-v5.safetensors --content-disposition -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/XenoENGINE-ArtStyle-v5.safetensors")
|
| 63 |
|
| 64 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
|
| 67 |
os.system(f"wget -q https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.ckpt -O /home/user/app/stable-diffusion-webui/models/VAE/vae-ft-mse-840000-ema-pruned.ckpt")
|