Spaces:
Runtime error
Runtime error
Commit
·
20c8163
1
Parent(s):
501e46f
Delete app.py
Browse files
app.py
DELETED
@@ -1,107 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
import os, subprocess, time, glob
|
3 |
-
# - Dependencies - #
|
4 |
-
%env TF_CPP_MIN_LOG_LEVEL=1
|
5 |
-
!apt -y update -qq
|
6 |
-
!apt -y install -qq aria2
|
7 |
-
!wget http://launchpadlibrarian.net/367274644/libgoogle-perftools-dev_2.5-2.2ubuntu3_amd64.deb
|
8 |
-
!wget https://launchpad.net/ubuntu/+source/google-perftools/2.5-2.2ubuntu3/+build/14795286/+files/google-perftools_2.5-2.2ubuntu3_all.deb
|
9 |
-
!wget https://launchpad.net/ubuntu/+source/google-perftools/2.5-2.2ubuntu3/+build/14795286/+files/libtcmalloc-minimal4_2.5-2.2ubuntu3_amd64.deb
|
10 |
-
!wget https://launchpad.net/ubuntu/+source/google-perftools/2.5-2.2ubuntu3/+build/14795286/+files/libgoogle-perftools4_2.5-2.2ubuntu3_amd64.deb
|
11 |
-
!apt -y install -qq libunwind8-dev
|
12 |
-
!dpkg -i *.deb
|
13 |
-
%env LD_PRELOAD=libtcmalloc.so
|
14 |
-
!rm *.deb
|
15 |
-
!pip install --upgrade pip setuptools
|
16 |
-
!python -m pip cache purge
|
17 |
-
|
18 |
-
# !pip install torch==2.0.0+cu118 torchvision==0.15.1+cu118 --extra-index-url https://download.pytorch.org/whl/cu118
|
19 |
-
# !pip install -q huggingface-hub -U
|
20 |
-
|
21 |
-
!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
|
22 |
-
|
23 |
-
!from google.colab import drive
|
24 |
-
!drive.mount('/content/drive')
|
25 |
-
!output_path = '/content/drive/MyDrive/' + output_path
|
26 |
-
!gMode == GDriveSaveMode.Everything:
|
27 |
-
|
28 |
-
# --- MODELS, LORAS, VAE --- #
|
29 |
-
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://civitai.com/api/download/models/86437 -d /content/stable-diffusion-webui/models/Stable-diffusion -o absolutereality_v1.safetensors
|
30 |
-
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors -d /content/stable-diffusion-webui/models/VAE -o vae-ft-mse-840000-ema-pruned.safetensors
|
31 |
-
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/hakurei/waifu-diffusion-v1-4/resolve/main/vae/kl-f8-anime2.ckpt -d /content/stable-diffusion-webui/models/VAE -o kl-f8-anime2.ckpt
|
32 |
-
|
33 |
-
# --- UPSCALERS --- #
|
34 |
-
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Zabin/Resizers/resolve/main/4x-UltraSharp.pth -d /content/stable-diffusion-webui/models/ESRGAN -o 4x-UltraSharp.pth
|
35 |
-
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/Zabin/Resizers/resolve/main/4x_foolhardy_Remacri.pth -d /content/stable-diffusion-webui/models/ESRGAN -o 4x_foolhardy_Remacri.pth
|
36 |
-
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/gemasai/4x_NMKD-Superscale-SP_178000_G/resolve/main/4x_NMKD-Superscale-SP_178000_G.pth -d /content/stable-diffusion-webui/models/ESRGAN -o 4x_NMKD-Superscale-SP_178000_G.pth
|
37 |
-
|
38 |
-
# --- EMBEDDINGS --- #
|
39 |
-
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/embed/negative/resolve/main/EasyNegative.pt -d /content/stable-diffusion-webui/embeddings/Negative -o EasyNegative.pt
|
40 |
-
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/gsdf/Counterfeit-V3.0/resolve/main/embedding/EasyNegativeV2.safetensors -d /content/stable-diffusion-webui/embeddings/Negative -o EasyNegativeV2.safetensors
|
41 |
-
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/embed/negative/resolve/main/bad-hands-5.pt -d /content/stable-diffusion-webui/embeddings/Negative -o bad-hands-5.pt
|
42 |
-
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/embed/negative/resolve/main/bad_prompt_version2.pt -d /content/stable-diffusion-webui/embeddings/Negative -o bad_prompt_version2.pt
|
43 |
-
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/embed/negative/resolve/main/ng_deepnegative_v1_75t.pt -d /content/stable-diffusion-webui/embeddings/Negative -o ng_deepnegative_v1_75t.pt
|
44 |
-
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ffxvs/negative-prompts-pack/resolve/main/bad-artist.pt -d /content/stable-diffusion-webui/embeddings/Negative -o bad-artist.pt
|
45 |
-
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ffxvs/negative-prompts-pack/resolve/main/badhandv4.pt -d /content/stable-diffusion-webui/embeddings/Negative -o badhandv4.pt
|
46 |
-
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ffxvs/negative-prompts-pack/resolve/main/verybadimagenegative_v1.3.pt -d /content/stable-diffusion-webui/embeddings/Negative -o verybadimagenegative_v1.3.pt
|
47 |
-
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://civitai.com/api/download/models/60938 -d /content/stable-diffusion-webui/embeddings/Negative -o negative_hand-neg.pt
|
48 |
-
|
49 |
-
# --- EXTENSIONS --- #
|
50 |
-
!git clone https://github.com/zanllp/sd-webui-infinite-image-browsing /content/stable-diffusion-webui/extensions/sd-webui-infinite-image-browsing
|
51 |
-
!git clone https://github.com/KohakuBlueleaf/a1111-sd-webui-lycoris /content/stable-diffusion-webui/extensions/a1111-sd-webui-lycoris
|
52 |
-
!git clone https://github.com/etherealxx/batchlinks-webui /content/stable-diffusion-webui/extensions/batchlinks-webui
|
53 |
-
!git clone https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111 /content/stable-diffusion-webui/extensions/multidiffusion-upscaler-for-automatic1111
|
54 |
-
!git clone https://github.com/mcmonkeyprojects/sd-dynamic-thresholding /content/stable-diffusion-webui/extensions/sd-dynamic-thresholding
|
55 |
-
!git clone https://github.com/DominikDoom/a1111-sd-webui-tagcomplete /content/stable-diffusion-webui/extensions/a1111-sd-webui-tagcomplete
|
56 |
-
!git clone https://github.com/aka7774/sd_filer /content/stable-diffusion-webui/extensions/sd_filer
|
57 |
-
!git clone https://github.com/hako-mikan/sd-webui-supermerger /content/stable-diffusion-webui/extensions/sd-webui-supermerger
|
58 |
-
!git clone https://github.com/Bing-su/adetailer /content/stable-diffusion-webui/extensions/adetailer
|
59 |
-
!git clone https://github.com/deforum-art/deforum-for-automatic1111-webui /content/stable-diffusion-webui/extensions/deforum-for-automatic1111-webui
|
60 |
-
!git clone https://github.com/thomasasfk/sd-webui-aspect-ratio-helper /content/stable-diffusion-webui/extensions/sd-webui-aspect-ratio-helper
|
61 |
-
|
62 |
-
# ControlNet, if you need it → ( ↓ Sellect commented lines below and press "Ctrl + /" to uncomment all at once ↓ )
|
63 |
-
|
64 |
-
# !git clone https://github.com/Mikubill/sd-webui-controlnet /content/stable-diffusion-webui/extensions/sd-webui-controlnet
|
65 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11e_sd15_ip2p_fp16.safetensors -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o control_v11e_sd15_ip2p_fp16.safetensors
|
66 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11e_sd15_shuffle_fp16.safetensors -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o control_v11e_sd15_shuffle_fp16.safetensors
|
67 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_canny_fp16.safetensors -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o control_v11p_sd15_canny_fp16.safetensors
|
68 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_depth_fp16.safetensors -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o control_v11p_sd15_depth_fp16.safetensors
|
69 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_inpaint_fp16.safetensors -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o control_v11p_sd15_inpaint_fp16.safetensors
|
70 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_lineart_fp16.safetensors -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o control_v11p_sd15_lineart_fp16.safetensors
|
71 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_mlsd_fp16.safetensors -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o control_v11p_sd15_mlsd_fp16.safetensors
|
72 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_normalbae_fp16.safetensors -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o control_v11p_sd15_normalbae_fp16.safetensors
|
73 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_openpose_fp16.safetensors -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o control_v11p_sd15_openpose_fp16.safetensors
|
74 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_scribble_fp16.safetensors -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o control_v11p_sd15_scribble_fp16.safetensors
|
75 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_seg_fp16.safetensors -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o control_v11p_sd15_seg_fp16.safetensors
|
76 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_softedge_fp16.safetensors -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o control_v11p_sd15_softedge_fp16.safetensors
|
77 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15s2_lineart_anime_fp16.safetensors -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o control_v11p_sd15s2_lineart_anime_fp16.safetensors
|
78 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11u_sd15_tile_fp16.safetensors -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o control_v11u_sd15_tile_fp16.safetensors
|
79 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_style_sd14v1.pth -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o t2iadapter_style_sd14v1.pth
|
80 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_sketch_sd14v1.pth -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o t2iadapter_sketch_sd14v1.pth
|
81 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_seg_sd14v1.pth -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o t2iadapter_seg_sd14v1.pth
|
82 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_openpose_sd14v1.pth -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o t2iadapter_openpose_sd14v1.pth
|
83 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_keypose_sd14v1.pth -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o t2iadapter_keypose_sd14v1.pth
|
84 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_color_sd14v1.pth -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o t2iadapter_color_sd14v1.pth
|
85 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_canny_sd15v2.pth -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o t2iadapter_canny_sd15v2.pth
|
86 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_depth_sd15v2.pth -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o t2iadapter_depth_sd15v2.pth
|
87 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_sketch_sd15v2.pth -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o t2iadapter_sketch_sd15v2.pth
|
88 |
-
# !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_zoedepth_sd15v1.pth -d /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models -o t2iadapter_zoedepth_sd15v1.pth
|
89 |
-
|
90 |
-
%cd /content/stable-diffusion-webui
|
91 |
-
|
92 |
-
# - UI Config - #
|
93 |
-
!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/TNitro/ui-config/resolve/main/ui-config.json -d /content/stable-diffusion-webui -o ui-config.json
|
94 |
-
!sed -i -e 's/\["sd_model_checkpoint"\],/\["sd_model_checkpoint","sd_vae","CLIP_stop_at_last_layers"\],/g' /content/stable-diffusion-webui/modules/shared.py
|
95 |
-
!sed -i -e 's/"\[seed\]"/"\[model_name\],\[seed\]"/g' /content/stable-diffusion-webui/modules/images.py
|
96 |
-
!sed -i -e 's/"CLIP_stop_at_last_layers": OptionInfo(1,/"CLIP_stop_at_last_layers": OptionInfo(2,/g' /content/stable-diffusion-webui/modules/shared.py
|
97 |
-
!sed -i -e 's/"txt2img\/Negative prompt\/value": "",/"txt2img\/Negative prompt\/value": "(low quality, worst quality), EasyNegativeV2,",/g' /content/stable-diffusion-webui/ui-config.json
|
98 |
-
!sed -i -e 's/"txt2img\/Sampling method\/value": "Euler a",/"txt2img\/Sampling method\/value": "DPM++ 2M SDE Karras",/g' /content/stable-diffusion-webui/ui-config.json
|
99 |
-
!sed -i -e 's/"txt2img\/Upscaler\/value": "Latent",/"txt2img\/Upscaler\/value": "R-ESRGAN 4x+",/g' /content/stable-diffusion-webui/ui-config.json
|
100 |
-
!sed -i -e 's/"gdown"/"aria2"/g' /content/stable-diffusion-webui/extensions/batchlinks-webui/scripts/batchlinks-downloader.py
|
101 |
-
# - Kitchen Theme - #
|
102 |
-
# !git clone https://github.com/canisminor1990/sd-webui-kitchen-theme /content/stable-diffusion-webui/extensions/sd-webui-kitchen-theme
|
103 |
-
|
104 |
-
# - Command Line Arguments - #
|
105 |
-
!python set IGNORE_CMD_ARGS_ERRORS=anything
|
106 |
-
!python launch.py --share --gradio-queue --opt-sdp-attention --theme dark --enable-insecure-extension-access --no-hashing --opt-split-attention --no-half-vae --xformers --administrator --force-enable-xformers --xformers-flash-attention --disable-nan-check --upcast-sampling --disable-safe-unpickle --reinstall-xformers --reinstall-torch --update-all-extensions --disable-nan-check
|
107 |
-
iface.launch(share=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|