|
import os |
|
from subprocess import getoutput |
|
|
|
os.system(f"git clone https://github.com/AdamOswald/stable-diffusion-webui /home/user/app/stable-diffusion-webui") |
|
os.chdir("/home/user/app/stable-diffusion-webui") |
|
|
|
os.system(f"wget -q https://github.com/AdamOswald/webui/raw/main/env_patch.py -O /home/user/app/env_patch.py") |
|
os.system(f"sed -i '$a fastapi==0.90.1' /home/user/app/stable-diffusion-webui/requirements_versions.txt") |
|
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") |
|
os.system(f"sed -i -e '/(modelmerger_interface, \"Checkpoint Merger\", \"modelmerger\"),/d' /home/user/app/stable-diffusion-webui/modules/ui.py") |
|
os.system(f"sed -i -e '/(train_interface, \"Train\", \"ti\"),/d' /home/user/app/stable-diffusion-webui/modules/ui.py") |
|
os.system(f"sed -i -e '/extensions_interface, \"Extensions\", \"extensions\"/d' /home/user/app/stable-diffusion-webui/modules/ui.py") |
|
os.system(f"sed -i -e '/settings_interface, \"Settings\", \"settings\"/d' /home/user/app/stable-diffusion-webui/modules/ui.py") |
|
os.system(f'''sed -i -e "s/document.getElementsByTagName('gradio-app')\[0\].shadowRoot/!!document.getElementsByTagName('gradio-app')[0].shadowRoot ? document.getElementsByTagName('gradio-app')[0].shadowRoot : document/g" /home/user/app/stable-diffusion-webui/script.js''') |
|
os.system(f"sed -i -e 's/ show_progress=False,/ show_progress=True,/g' /home/user/app/stable-diffusion-webui/modules/ui.py") |
|
os.system(f"sed -i -e 's/shared.demo.launch/shared.demo.queue().launch/g' /home/user/app/stable-diffusion-webui/webui.py") |
|
os.system(f"sed -i -e 's/ outputs=\[/queue=False, &/g' /home/user/app/stable-diffusion-webui/modules/ui.py") |
|
os.system(f"sed -i -e 's/ queue=False, / /g' /home/user/app/stable-diffusion-webui/modules/ui.py") |
|
|
|
|
|
os.system(f"wget -q https://github.com/AdamOswald/webui/raw/main/header_patch.py -O /home/user/app/header_patch.py") |
|
os.system(f"sed -i -e '/demo:/r /home/user/app/header_patch.py' /home/user/app/stable-diffusion-webui/modules/ui.py") |
|
|
|
|
|
if "IS_SHARED_UI" in os.environ: |
|
os.system(f"rm -rfv /home/user/app/stable-diffusion-webui/scripts/") |
|
|
|
os.system(f"wget -q https://github.com/AdamOswald/webui/raw/main/shared-config.json -O /home/user/app/shared-config.json") |
|
os.system(f"wget -q https://github.com/AdamOswald/webui/raw/main/shared-ui-config.json -O /home/user/app/shared-ui-config.json") |
|
|
|
os.system(f"wget -q https://huggingface.co./ckpt/anything-v3-vae-swapped/resolve/main/anything-v3-vae-swapped.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/anything-v3-vae-swapped.ckpt") |
|
|
|
|
|
os.system(f"wget -q https://huggingface.co./hakurei/waifu-diffusion-v1-3/resolve/main/wd-v1-3-float32.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/wd-v1-3-float32.ckpt") |
|
|
|
os.system(f"wget -q https://huggingface.co./runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.ckpt") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
os.system(f"python launch.py --skip-torch-cuda-test --disable-safe-unpickle --enable-insecure-extension-access --precision full --no-half --all --disable-console-progressbars --enable-console-prompts --ui-config-file /home/user/app/shared-ui-config.json --ui-settings-file /home/user/app/shared-config.json --cors-allow-origins huggingface.co,hf.space --no-progressbar-hiding") |
|
else: |
|
os.system(f"wget -q https://gist.github.com/camenduru/9ec5f8141db9902e375967e93250860f/raw/d0bcf01786f20107c329c03f8968584ee67be12a/run_n_times.py -O /home/user/app/stable-diffusion-webui/scripts/run_n_times.py") |
|
|
|
|
|
|
|
os.system(f"git clone https://github.com/yfszzx/stable-diffusion-webui-images-browser /home/user/app/stable-diffusion-webui/extensions/stable-diffusion-webui-images-browser") |
|
os.system(f"git clone https://github.com/camenduru/deforum-for-automatic1111-webui /home/user/app/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui") |
|
os.system(f"git clone https://github.com/bbc-mc/merge-percentage-visualize /home/user/app/stable-diffusion-webui/extensions/merge-percentage-visualize") |
|
os.system(f"git clone https://github.com/bbc-mc/sdweb-merge-board /home/user/app/stable-diffusion-webui/extensions/sdweb-merge-board") |
|
os.system(f"git clone https://github.com/bbc-mc/sdweb-merge-block-weighted-gui /home/user/app/stable-diffusion-webui/extensions/sdweb-merge-block-weighted-gui") |
|
os.system(f"git clone https://github.com/arenatemp/stable-diffusion-webui-model-toolkit /home/user/app/stable-diffusion-webui/extensions/stable-diffusion-webui-model-toolkit") |
|
os.system(f"git clone https://github.com/lodimasq/batch-checkpoint-merger /home/user/app/stable-diffusion-webui/extensions/batch-checkpoint-merger") |
|
os.system(f"git clone https://github.com/eyriewow/merge-models /home/user/app/stable-diffusion-webui/extensions/merge-models") |
|
os.system(f"git clone https://github.com/OedoSoldier/enhanced-img2img /home/user/app/stable-diffusion-webui/extensions/enhanced-img2img") |
|
os.system(f"git clone https://https://github.com/Maurdekye/model-kitchen /home/user/app/stable-diffusion-webui/extensions/model-kitchen") |
|
os.system(f"git clone https://github.com/hako-mikan/sd-webui-supermerger /home/user/app/stable-diffusion-webui/extensions/sd-webui-supermerger") |
|
os.system(f"git clone https://github.com/j4ded/sdweb-merge-block-weighted-gui /home/user/app/stable-diffusion-webui/extensions/sdweb-merge-block-weighted-gui-alt") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
os.system(f"wget -q https://huggingface.co./hakurei/waifu-diffusion-v1-3/resolve/main/wd-v1-3-float32.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/wd-v1-3-float32.ckpt") |
|
os.system(f"wget -q https://huggingface.co./CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/sd-v1-4.ckpt") |
|
|
|
|
|
|
|
|
|
|
|
|
|
os.system(f"wget -q https://huggingface.co./Eppinette/Cyberware/blob/main/cyberware_V3_m_cyberware_token_style_class_word.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/cyberware_V3_m_cyberware_token_style_class_word.ckpt") |
|
os.system(f"wget -q https://huggingface.co./Eppinette/Cyberware/blob/main/cyberware_trinart_cyberware_token_style_class_word.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/cyberware_trinart_cyberware_token_style_class_word.ckpt") |
|
|
|
|
|
|
|
os.system(f"wget -q {os.getenv('MODEL_LINK')} -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/{os.getenv('MODEL_NAME')}") |
|
os.system(f"wget -q {os.getenv('VAE_LINK')} -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/{os.getenv('VAE_NAME')}") |
|
os.system(f"wget -q https://raw.githubusercontent.com/Stability-AI/stablediffusion/main/configs/stable-diffusion/v2-inference-v.yaml -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/768-v-ema.yaml") |
|
|
|
os.system(f"wget -q https://huggingface.co./stabilityai/stable-diffusion-2-1/resolve/main/v2-1_768-ema-pruned.ckpt -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/v2-1_768-ema-pruned.ckpt") |
|
os.system(f"wget -q https://raw.githubusercontent.com/Stability-AI/stablediffusion/main/configs/stable-diffusion/v2-inference-v.yaml -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/v2-1_768-ema-pruned.yaml") |
|
|
|
os.system(f"python launch.py --precision full --no-half --all --ui-config-file /home/user/app/ui-config.json --ui-settings-file /home/user/app/config.json --disable-console-progressbars --enable-console-prompts --cors-allow-origins huggingface.co,hf.space --no-progressbar-hiding --api --skip-torch-cuda-test --disable-safe-unpickle --enable-insecure-extension-access") |
|
|