import os os.chdir(f"/home/user/app") os.system(f"git clone -b v3.0 https://github.com/camenduru/stable-diffusion-webui /home/user/app/stable-diffusion-webui") #os.system(f"git clone -b master https://github.com/jaias92/stable-diffusion-webuiwhuggyface /home/user/app/stable-diffusion-webui") os.chdir(f"/home/user/app/stable-diffusion-webui") os.system(f"git lfs install") os.system(f"git reset --hard") os.system(f"sed -i -e '/demo:/r /home/user/app/header_patch_v2.py' /home/user/app/stable-diffusion-webui/modules/ui.py") os.system(f"sed -i -e '253,258d' /home/user/app/stable-diffusion-webui/modules/ui_settings.py") os.system(f"sed -i -e '186,228d' /home/user/app/stable-diffusion-webui/modules/ui_settings.py") os.system(f"sed -i -e '171,178d' /home/user/app/stable-diffusion-webui/modules/ui_settings.py") os.system(f"sed -i -e '108,113d' /home/user/app/stable-diffusion-webui/modules/ui_settings.py") os.system(f"sed -i -e '225,227d' /home/user/app/stable-diffusion-webui/modules/ui_loadsave.py") os.system(f"sed -i -e '214,217d' /home/user/app/stable-diffusion-webui/modules/ui_loadsave.py") #os.system(f"rm -rfv /home/user/app/stable-diffusion-webui/scripts/") #os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/neofake/Juggernaut-Reborn/resolve/main/juggernaut_reborn.safetensors -d /home/user/app/stable-diffusion-webui/models/Stable-diffusion -o 1-5_Juggernaut.safetensors") #os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/jzli/DreamShaper-8/resolve/main/dreamshaper_8.safetensors -d /home/user/app/stable-diffusion-webui/models/Stable-diffusion -o 1-5_Dreamshaper.safetensors") os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/RunDiffusion/Juggernaut-XL-v9/resolve/main/Juggernaut-XL_v9_RunDiffusionPhoto_v2.safetensors -d /home/user/app/stable-diffusion-webui/models/Stable-diffusion -o XL_Juggernaut.safetensors") #os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/misri/epicrealismXL_v5Ultimate/resolve/main/epicrealismXL_v5Ultimate.safetensors -d /home/user/app/stable-diffusion-webui/models/Stable-diffusion -o XL_epicrealism.safetensors") os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/RunDiffusion/Juggernaut-X-v10/resolve/main/Juggernaut-X-RunDiffusion-NSFW.safetensors -d /home/user/app/stable-diffusion-webui/models/Stable-diffusion -o Juggernaut-X.safetensors") os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Lykon/dreamshaper-xl-lightning/resolve/main/DreamShaperXL_Lightning.safetensors -d /home/user/app/stable-diffusion-webui/models/Stable-diffusion -o DreamShaperXL_Lightning.safetensors") #os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/RSPMetaAdmin/RSP_Models/resolve/main/architectureUrbanSdlife_v60.safetensors -d /home/user/app/stable-diffusion-webui/models/Stable-diffusion -o architectureUrbanSdlife_v60.safetensors") #os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/RSPMetaAdmin/RSP_Models/resolve/main/dvarchMultiPrompt_dvarchExterior.safetensors -d /home/user/app/stable-diffusion-webui/models/Stable-diffusion -o dvarchMultiPrompt_dvarchExterior.safetensors") #os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/SG161222/Realistic_Vision_V6.0_B1_noVAE/resolve/main/Realistic_Vision_V6.0_NV_B1_inpainting.safetensors -d /home/user/app/stable-diffusion-webui/models/Stable-diffusion -o Realistic_Vision_V6.0_NV_B1_inpainting.safetensors") #os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/SG161222/RealVisXL_V4.0/resolve/main/RealVisXL_V4.0.safetensors -d /home/user/app/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o RealVisXL_V4_0.safetensors") #os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/RSPMetaAdmin/RSP_Models/resolve/main/FormFinder-XL_v2.safetensors -d /home/user/app/stable-diffusion-webui/models/Lora -o FormFinder-XL_v2.safetensors") # Cloning the sd-webui-controlnet extension os.chdir(f"/home/user/app/stable-diffusion-webui/extensions") os.system(f"git clone https://github.com/Mikubill/sd-webui-controlnet.git") os.system(f"git clone https://github.com/ahgsql/StyleSelectorXL.git") os.system(f"git clone https://github.com/thomasasfk/sd-webui-aspect-ratio-helper.git") os.system(f"git clone https://github.com/Coyote-A/ultimate-upscale-for-automatic1111.git") # Installing required dependencies (if any) os.chdir(f"/home/user/app/stable-diffusion-webui/extensions/sd-webui-controlnet/models") # Download models using aria2c #os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/main/control_v11f1p_sd15_depth.pth -d /home/user/app/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o Depth.pth") #os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/main/control_v11p_sd15_canny.pth -d /home/user/app/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o Canny.pth") #os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/main/control_v11p_sd15_seg.pth -d /home/user/app/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o Seg.pth") #os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/main/control_v11p_sd15_lineart.pth -d /home/user/app/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o Lineart.pth") os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/TencentARC/t2i-adapter-canny-sdxl-1.0/resolve/main/diffusion_pytorch_model.safetensors -d /home/user/app/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o Canny_t2i.safetensors") os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/bdsqlsz/qinglong_controlnet-lllite/resolve/main/bdsqlsz_controlllite_xl_mlsd_V2.safetensors -d /home/user/app/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o xl_mlsd_V2.safetensors") #os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/bdsqlsz/qinglong_controlnet-lllite/resolve/main/bdsqlsz_controlllite_xl_lineart_anime_denoise.safetensors -d /home/user/app/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o xl_lineart_anime_denoise.safetensors") os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/SargeZT/t2i-adapter-sdxl-segmentation/resolve/main/diffusion_pytorch_model.safetensors -d /home/user/app/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o t2i_adapter_sdxl_segmentation") os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/diffusers_xl_canny_full.safetensors -d /home/user/app/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o xl_canny_full.safetensors") #os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/sd_control_collection/resolve/main/diffusers_xl_depth_mid.safetensors -d /home/user/app/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o xl_depth_mid.safetensor") #os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/lllyasviel/ControlNet-v1-1/resolve/main/control_v11f1e_sd15_tile.pth -d /home/user/app/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o sd15_tile.pth") os.chdir(f"/home/user/app/stable-diffusion-webui") # Check the extension's documentation for specific dependencies # Modifying configuration files (if necessary) # Refer to the extension's documentation for specific instructions # Launching the webui os.system(f"python launch.py --cors-allow-origins=* --xformers --theme dark --gradio-queue --ui-settings-file /home/user/app/shared-config_v2.json --ui-config-file /home/user/app/shared-ui-config_v2.json")