Spaces:
Runtime error
Runtime error
sousukeaizen14
commited on
Commit
•
588d31f
1
Parent(s):
cf88e2e
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
!curl -Lo memfix.zip https://github.com/nolanaatama/sd-webui/raw/main/memfix.zip
|
2 |
+
!unzip /content/memfix.zip
|
3 |
+
!apt install -qq libunwind8-dev
|
4 |
+
!dpkg -i *.deb
|
5 |
+
%env LD_PRELOAD=libtcmalloc.so
|
6 |
+
!rm *
|
7 |
+
!pip install --upgrade fastapi==0.90.1
|
8 |
+
!pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1 torchtext==0.14.1 torchdata==0.5.1 --extra-index-url https://download.pytorch.org/whl/cu116 -U
|
9 |
+
!curl -Lo sd-webui.zip https://huggingface.co/nolanaatama/webui/resolve/main/sd-webui.zip
|
10 |
+
!unzip /content/sd-webui.zip
|
11 |
+
!git clone https://github.com/nolanaatama/sd-webui-tunnels /content/sd-webui/extensions/sd-webui-tunnels
|
12 |
+
!git clone https://github.com/Mikubill/sd-webui-controlnet /content/sd-webui/extensions/sd-webui-controlnet
|
13 |
+
!git clone https://github.com/fkunn1326/openpose-editor /content/sd-webui/extensions/openpose-editor
|
14 |
+
!git clone https://github.com/hnmr293/posex /content/sd-webui/extensions/posex
|
15 |
+
!git clone https://github.com/DominikDoom/a1111-sd-webui-tagcomplete /content/sd-webui/extensions/a1111-sd-webui-tagcomplete
|
16 |
+
!git clone https://github.com/hako-mikan/sd-webui-supermerger /content/sd-webui/extensions/sd-webui-supermerger
|
17 |
+
!curl -Lo /content/sd-webui/extensions/sd-webui-images-browser.zip https://huggingface.co/nolanaatama/webui/resolve/main/sd-webui-images-browser.zip
|
18 |
+
%cd /content/sd-webui/extensions
|
19 |
+
!unzip /content/sd-webui/extensions/sd-webui-images-browser.zip
|
20 |
+
%cd /content
|
21 |
+
# Model Code
|
22 |
+
!curl -Lo /content/sd-webui/models/Stable-diffusion/lofi.safetensors https://huggingface.co/nolanaatama/lf/resolve/main/lf.safetensors
|
23 |
+
# ControlNet
|
24 |
+
# Remove '#' from the beginning of the line(s) below to download the selected ControlNet model(s)
|
25 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/control_v11e_sd15_ip2p.safetensors https://huggingface.co/nolanaatama/models/resolve/main/control_v11e_sd15_ip2p_fp16.safetensors
|
26 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/control_v11e_sd15_shuffle.safetensors https://huggingface.co/nolanaatama/models/resolve/main/control_v11e_sd15_shuffle_fp16.safetensors
|
27 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/control_v11p_sd15_canny.safetensors https://huggingface.co/nolanaatama/models/resolve/main/control_v11p_sd15_canny_fp16.safetensors
|
28 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/control_v11p_sd15_depth.safetensors https://huggingface.co/nolanaatama/models/resolve/main/control_v11p_sd15_depth_fp16.safetensors
|
29 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/control_v11p_sd15_inpaint.safetensors https://huggingface.co/nolanaatama/models/resolve/main/control_v11p_sd15_inpaint_fp16.safetensors
|
30 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/control_v11p_sd15_lineart.safetensors https://huggingface.co/nolanaatama/models/resolve/main/control_v11p_sd15_lineart_fp16.safetensors
|
31 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/control_v11p_sd15_mlsd.safetensors https://huggingface.co/nolanaatama/models/resolve/main/control_v11p_sd15_mlsd_fp16.safetensors
|
32 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/control_v11p_sd15_normalbae.safetensors https://huggingface.co/nolanaatama/models/resolve/main/control_v11p_sd15_normalbae_fp16.safetensors
|
33 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/control_v11p_sd15_openpose.safetensors https://huggingface.co/nolanaatama/models/resolve/main/control_v11p_sd15_openpose_fp16.safetensors
|
34 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/control_v11p_sd15_scribble.safetensors https://huggingface.co/nolanaatama/models/resolve/main/control_v11p_sd15_scribble_fp16.safetensors
|
35 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/control_v11p_sd15_seg.safetensors https://huggingface.co/nolanaatama/models/resolve/main/control_v11p_sd15_seg_fp16.safetensors
|
36 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/control_v11p_sd15_softedge.safetensors https://huggingface.co/nolanaatama/models/resolve/main/control_v11p_sd15_softedge_fp16.safetensors
|
37 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/control_v11p_sd15s2_lineart_anime.safetensors https://huggingface.co/nolanaatama/models/resolve/main/control_v11p_sd15s2_lineart_anime_fp16.safetensors
|
38 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/control_v11u_sd15_tile.safetensors https://huggingface.co/nolanaatama/models/resolve/main/control_v11u_sd15_tile_fp16.safetensors
|
39 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/t2iadapter_canny_sd14v1.pth https://huggingface.co/nolanaatama/models/resolve/main/t2iadapter_canny_sd14v1.pth
|
40 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/t2iadapter_color_sd14v1.pth https://huggingface.co/nolanaatama/models/resolve/main/t2iadapter_color_sd14v1.pth
|
41 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/t2iadapter_depth_sd14v1.pth https://huggingface.co/nolanaatama/models/resolve/main/t2iadapter_depth_sd14v1.pth
|
42 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/t2iadapter_keypose_sd14v1.pth https://huggingface.co/nolanaatama/models/resolve/main/t2iadapter_keypose_sd14v1.pth
|
43 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/t2iadapter_openpose_sd14v1.pth https://huggingface.co/nolanaatama/models/resolve/main/t2iadapter_openpose_sd14v1.pth
|
44 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/t2iadapter_seg_sd14v1.pth https://huggingface.co/nolanaatama/models/resolve/main/t2iadapter_seg_sd14v1.pth
|
45 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/t2iadapter_sketch_sd14v1.pth https://huggingface.co/nolanaatama/models/resolve/main/t2iadapter_sketch_sd14v1.pth
|
46 |
+
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/t2iadapter_style_sd14v1.pth https://huggingface.co/nolanaatama/models/resolve/main/t2iadapter_style_sd14v1.pth
|
47 |
+
import shutil
|
48 |
+
shutil.rmtree('/content/sd-webui/embeddings')
|
49 |
+
!rm sd-webui.zip
|
50 |
+
!rm sd-webui-images-browser.zip
|
51 |
+
%cd /content/sd-webui
|
52 |
+
!git clone https://huggingface.co/nolanaatama/embeddings
|
53 |
+
%cd /content/sd-webui/models
|
54 |
+
!git clone https://huggingface.co/nolanaatama/ESRGAN
|
55 |
+
%cd /content/sd-webui
|
56 |
+
# Web UI tunnel
|
57 |
+
!COMMANDLINE_ARGS="--share --disable-safe-unpickle --no-half-vae --xformers --reinstall-xformers --enable-insecure-extension --gradio-queue --remotemoe" REQS_FILE="requirements.txt" python launch.py
|
58 |
+
# If remotemoe failed to start, change '--remotemoe' to '--cloudflared' on the COMMANDLINE_ARGS line above to use cloudflare tunnel
|