Upload app.py
Browse files
app.py
CHANGED
|
@@ -7,6 +7,7 @@ if("A10G" in gpu_info):
|
|
| 7 |
elif("T4" in gpu_info):
|
| 8 |
os.system(f"pip install -q https://github.com/camenduru/stable-diffusion-webui-colab/releases/download/0.0.16/xformers-0.0.16+814314d.d20230118-cp38-cp38-linux_x86_64.whl")
|
| 9 |
|
|
|
|
| 10 |
os.system(f"git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git /home/user/app/stable-diffusion-webui")
|
| 11 |
|
| 12 |
os.chdir("/home/user/app/stable-diffusion-webui")
|
|
@@ -23,12 +24,18 @@ os.system(f"sed -i -e 's/shared.demo.launch/shared.demo.queue().launch/g' /home/
|
|
| 23 |
os.system(f"sed -i -e 's/inputs=\[component\],/&\\n queue=False,/g' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
| 24 |
os.system(f"sed -i -e 's/outputs=\[token_counter\]/outputs=[token_counter], queue=False/g' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
| 25 |
|
|
|
|
|
|
|
|
|
|
| 26 |
# ----------------------------Please duplicate this space and delete this block if you don't want to see the extra header----------------------------
|
| 27 |
#os.system(f"wget -q https://github.com/camenduru/webui/raw/main/header_patch.py -O /home/user/app/header_patch.py")
|
| 28 |
#os.system(f"sed -i -e '/demo:/r /home/user/app/header_patch.py' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
| 29 |
# ---------------------------------------------------------------------------------------------------------------------------------------------------
|
| 30 |
|
|
|
|
|
|
|
| 31 |
os.system(f"git clone https://github.com/deforum-art/deforum-for-automatic1111-webui /home/user/app/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui")
|
|
|
|
| 32 |
|
| 33 |
os.system(f"wget -q https://huggingface.co/Alsebay/PeachMixs/resolve/main/PeachTachyonMixs/PeachTachyon2.safetensors -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/PeachTachyon2.safetensors")
|
| 34 |
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")
|
|
@@ -69,4 +76,5 @@ else:
|
|
| 69 |
#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")
|
| 70 |
#os.system(f"wget -q https://github.com/camenduru/webui/raw/main/shared-config.json -O /home/user/app/shared-config.json")
|
| 71 |
# os.system(f"wget -q https://github.com/camenduru/webui/raw/main/shared-ui-config.json -O /home/user/app/shared-ui-config.json")
|
| 72 |
-
os.system(f"python launch.py --precision full --no-half --use-cpu all --listen --ui-config-file /home/user/app/ui-config.json --ui-settings-file /home/user/app/config.json --cors-allow-origins huggingface.co,hf.space --no-progressbar-hiding --skip-torch-cuda-test")
|
|
|
|
|
|
| 7 |
elif("T4" in gpu_info):
|
| 8 |
os.system(f"pip install -q https://github.com/camenduru/stable-diffusion-webui-colab/releases/download/0.0.16/xformers-0.0.16+814314d.d20230118-cp38-cp38-linux_x86_64.whl")
|
| 9 |
|
| 10 |
+
os.system(f"git pull")
|
| 11 |
os.system(f"git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git /home/user/app/stable-diffusion-webui")
|
| 12 |
|
| 13 |
os.chdir("/home/user/app/stable-diffusion-webui")
|
|
|
|
| 24 |
os.system(f"sed -i -e 's/inputs=\[component\],/&\\n queue=False,/g' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
| 25 |
os.system(f"sed -i -e 's/outputs=\[token_counter\]/outputs=[token_counter], queue=False/g' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
| 26 |
|
| 27 |
+
os.system(f"pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu116 -U")
|
| 28 |
+
os.system(f"pip install -q xformers==0.0.16")
|
| 29 |
+
os.system(f"pip install -q triton==2.0.0")
|
| 30 |
# ----------------------------Please duplicate this space and delete this block if you don't want to see the extra header----------------------------
|
| 31 |
#os.system(f"wget -q https://github.com/camenduru/webui/raw/main/header_patch.py -O /home/user/app/header_patch.py")
|
| 32 |
#os.system(f"sed -i -e '/demo:/r /home/user/app/header_patch.py' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
| 33 |
# ---------------------------------------------------------------------------------------------------------------------------------------------------
|
| 34 |
|
| 35 |
+
|
| 36 |
+
os.system(f"git clone https://github.com/Mikubill/sd-webui-controlnet.git /home/user/app/stable-diffusion-webui/extensions/sd-webui-controlnet")
|
| 37 |
os.system(f"git clone https://github.com/deforum-art/deforum-for-automatic1111-webui /home/user/app/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui")
|
| 38 |
+
os.system(f"git pull")
|
| 39 |
|
| 40 |
os.system(f"wget -q https://huggingface.co/Alsebay/PeachMixs/resolve/main/PeachTachyonMixs/PeachTachyon2.safetensors -O /home/user/app/stable-diffusion-webui/models/Stable-diffusion/PeachTachyon2.safetensors")
|
| 41 |
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")
|
|
|
|
| 76 |
#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")
|
| 77 |
#os.system(f"wget -q https://github.com/camenduru/webui/raw/main/shared-config.json -O /home/user/app/shared-config.json")
|
| 78 |
# os.system(f"wget -q https://github.com/camenduru/webui/raw/main/shared-ui-config.json -O /home/user/app/shared-ui-config.json")
|
| 79 |
+
#os.system(f"python launch.py --precision full --no-half --use-cpu all --listen --ui-config-file /home/user/app/ui-config.json --ui-settings-file /home/user/app/config.json --cors-allow-origins huggingface.co,hf.space --no-progressbar-hiding --skip-torch-cuda-test")
|
| 80 |
+
os.system(f"python launch.py --precision full --no-half --use-cpu all --listen --cors-allow-origins huggingface.co,hf.space --no-progressbar-hiding --skip-torch-cuda-test")
|