Spaces:
Runtime error
Runtime error
Upload anythingv3_mobile.ipynb
Browse files- anythingv3_mobile.ipynb +191 -0
anythingv3_mobile.ipynb
ADDED
@@ -0,0 +1,191 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"nbformat": 4,
|
3 |
+
"nbformat_minor": 0,
|
4 |
+
"metadata": {
|
5 |
+
"colab": {
|
6 |
+
"provenance": []
|
7 |
+
},
|
8 |
+
"kernelspec": {
|
9 |
+
"name": "python3",
|
10 |
+
"display_name": "Python 3"
|
11 |
+
},
|
12 |
+
"language_info": {
|
13 |
+
"name": "python"
|
14 |
+
},
|
15 |
+
"accelerator": "GPU",
|
16 |
+
"gpuClass": "standard"
|
17 |
+
},
|
18 |
+
"cells": [
|
19 |
+
{
|
20 |
+
"cell_type": "markdown",
|
21 |
+
"source": [
|
22 |
+
"# 1. Run the cell below and play the music player to keep the Colab's tab alive"
|
23 |
+
],
|
24 |
+
"metadata": {
|
25 |
+
"id": "cl_vAnC1ULpF"
|
26 |
+
}
|
27 |
+
},
|
28 |
+
{
|
29 |
+
"cell_type": "code",
|
30 |
+
"source": [
|
31 |
+
"%%html\n",
|
32 |
+
"<b>Press play on the music player(Uses only 13MB of data)</b><br/>\n",
|
33 |
+
"<audio src=\"https://henk.tech/colabkobold/silence.m4a\" controls>"
|
34 |
+
],
|
35 |
+
"metadata": {
|
36 |
+
"id": "XAYaLRprRiOD"
|
37 |
+
},
|
38 |
+
"execution_count": null,
|
39 |
+
"outputs": []
|
40 |
+
},
|
41 |
+
{
|
42 |
+
"cell_type": "markdown",
|
43 |
+
"source": [
|
44 |
+
"# 2. While the music player playing, run the setup"
|
45 |
+
],
|
46 |
+
"metadata": {
|
47 |
+
"id": "rM7pqlq1UUus"
|
48 |
+
}
|
49 |
+
},
|
50 |
+
{
|
51 |
+
"cell_type": "code",
|
52 |
+
"source": [
|
53 |
+
"!curl -Lo memfix.zip https://github.com/nolanaatama/sd-webui/raw/main/memfix.zip\n",
|
54 |
+
"!unzip /content/memfix.zip\n",
|
55 |
+
"!apt install -qq libunwind8-dev\n",
|
56 |
+
"!apt install -qq libcairo2-dev pkg-config python3-dev\n",
|
57 |
+
"!dpkg -i *.deb\n",
|
58 |
+
"%env LD_PRELOAD=libtcmalloc.so\n",
|
59 |
+
"!rm *\n",
|
60 |
+
"!pip install --upgrade fastapi==0.90.1\n",
|
61 |
+
"!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\n",
|
62 |
+
"!curl -Lo sd-webui.zip https://huggingface.co/nolanaatama/webui/resolve/main/sd-webui.zip\n",
|
63 |
+
"!unzip /content/sd-webui.zip\n",
|
64 |
+
"!git clone https://github.com/nolanaatama/sd-webui-tunnels /content/sd-webui/extensions/sd-webui-tunnels\n",
|
65 |
+
"!git clone https://github.com/Mikubill/sd-webui-controlnet /content/sd-webui/extensions/sd-webui-controlnet\n",
|
66 |
+
"!git clone https://github.com/fkunn1326/openpose-editor /content/sd-webui/extensions/openpose-editor\n",
|
67 |
+
"!git clone https://github.com/hnmr293/posex /content/sd-webui/extensions/posex\n",
|
68 |
+
"!git clone https://github.com/DominikDoom/a1111-sd-webui-tagcomplete /content/sd-webui/extensions/a1111-sd-webui-tagcomplete\n",
|
69 |
+
"!git clone https://github.com/hako-mikan/sd-webui-supermerger /content/sd-webui/extensions/sd-webui-supermerger\n",
|
70 |
+
"!curl -Lo /content/sd-webui/extensions/sd-webui-images-browser.zip https://huggingface.co/nolanaatama/webui/resolve/main/sd-webui-images-browser.zip\n",
|
71 |
+
"%cd /content/sd-webui/extensions\n",
|
72 |
+
"!unzip /content/sd-webui/extensions/sd-webui-images-browser.zip\n",
|
73 |
+
"%cd /content\n",
|
74 |
+
"# Model Code\n",
|
75 |
+
"!curl -Lo /content/sd-webui/models/Stable-diffusion/anythingv3.ckpt https://huggingface.co/nolanaatama/av3/resolve/main/av3.ckpt\n",
|
76 |
+
"!curl -Lo /content/sd-webui/models/Stable-diffusion/anythingv3.vae.pt https://huggingface.co/nolanaatama/av3/resolve/main/av3.vae.pt\n",
|
77 |
+
"# ControlNet\n",
|
78 |
+
"# Remove '#' from the beginning of the line(s) below to download the selected ControlNet model(s)\n",
|
79 |
+
"#!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\n",
|
80 |
+
"#!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\n",
|
81 |
+
"#!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\n",
|
82 |
+
"#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/control_v11f1p_sd15_depth.safetensors https://huggingface.co/nolanaatama/models/resolve/main/control_v11p_sd15_depth_fp16.safetensors\n",
|
83 |
+
"#!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\n",
|
84 |
+
"#!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\n",
|
85 |
+
"#!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\n",
|
86 |
+
"#!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\n",
|
87 |
+
"#!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\n",
|
88 |
+
"#!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\n",
|
89 |
+
"#!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\n",
|
90 |
+
"#!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\n",
|
91 |
+
"#!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\n",
|
92 |
+
"#!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\n",
|
93 |
+
"#!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\n",
|
94 |
+
"#!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\n",
|
95 |
+
"#!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\n",
|
96 |
+
"#!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\n",
|
97 |
+
"#!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\n",
|
98 |
+
"#!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\n",
|
99 |
+
"#!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\n",
|
100 |
+
"#!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\n",
|
101 |
+
"import shutil\n",
|
102 |
+
"shutil.rmtree('/content/sd-webui/embeddings')\n",
|
103 |
+
"!rm sd-webui.zip\n",
|
104 |
+
"!rm sd-webui-images-browser.zip\n",
|
105 |
+
"%cd /content/sd-webui\n",
|
106 |
+
"!git clone https://huggingface.co/nolanaatama/embeddings\n",
|
107 |
+
"%cd /content/sd-webui/models\n",
|
108 |
+
"!git clone https://huggingface.co/nolanaatama/ESRGAN\n",
|
109 |
+
"%cd /content/sd-webui/extensions/a1111-sd-webui-tagcomplete\n",
|
110 |
+
"!git checkout f9f7732\n",
|
111 |
+
"%cd /content/sd-webui\n",
|
112 |
+
"# Web UI tunnel\n",
|
113 |
+
"!COMMANDLINE_ARGS=\"--share --disable-safe-unpickle --no-half-vae --xformers --reinstall-xformers --enable-insecure-extension --gradio-queue --cloudflared\" REQS_FILE=\"requirements.txt\" python launch.py\n",
|
114 |
+
"# If remotemoe failed to start, change '--remotemoe' to '--cloudflared' on the COMMANDLINE_ARGS line above to use cloudflare tunnel"
|
115 |
+
],
|
116 |
+
"metadata": {
|
117 |
+
"id": "sBbcB4vwj_jm"
|
118 |
+
},
|
119 |
+
"execution_count": null,
|
120 |
+
"outputs": []
|
121 |
+
},
|
122 |
+
{
|
123 |
+
"cell_type": "markdown",
|
124 |
+
"source": [
|
125 |
+
"## (OPTIONAL) LoRAs"
|
126 |
+
],
|
127 |
+
"metadata": {
|
128 |
+
"id": "0DwYF_aLUXKy"
|
129 |
+
}
|
130 |
+
},
|
131 |
+
{
|
132 |
+
"cell_type": "markdown",
|
133 |
+
"source": [
|
134 |
+
"### 1. After the gradio link show up, stop the first cell & clear the code output👆"
|
135 |
+
],
|
136 |
+
"metadata": {
|
137 |
+
"id": "JUtPlg328avv"
|
138 |
+
}
|
139 |
+
},
|
140 |
+
{
|
141 |
+
"cell_type": "markdown",
|
142 |
+
"source": [
|
143 |
+
"### 2. Load the LoRA & launch the web ui"
|
144 |
+
],
|
145 |
+
"metadata": {
|
146 |
+
"id": "xy_WyDzNUgd2"
|
147 |
+
}
|
148 |
+
},
|
149 |
+
{
|
150 |
+
"cell_type": "code",
|
151 |
+
"source": [
|
152 |
+
"# Copy the LoRA code from other LoRA setup (download the setup file after editing the LoRA code cell to avoid repeat input for next session)\n",
|
153 |
+
"# How-to download the setup file: Click 'File' menu -> 'Download' -> 'Download .ipynb'\n",
|
154 |
+
"# Load LoRA from Google Drive: https://youtu.be/G1QZfAPUMaM\n",
|
155 |
+
"\n",
|
156 |
+
"# LoRA 1\n",
|
157 |
+
"#!curl ...\n",
|
158 |
+
"#!mv ...\n",
|
159 |
+
"\n",
|
160 |
+
"# LoRA 2\n",
|
161 |
+
"#!curl ...\n",
|
162 |
+
"#!mv ...\n",
|
163 |
+
"\n",
|
164 |
+
"# LoRA 3\n",
|
165 |
+
"#!curl ...\n",
|
166 |
+
"#!mv ...\n",
|
167 |
+
"\n",
|
168 |
+
"# ...\n",
|
169 |
+
"\n",
|
170 |
+
"# Web UI tunnel\n",
|
171 |
+
"!COMMANDLINE_ARGS=\"--share --disable-safe-unpickle --no-half-vae --xformers --reinstall-xformers --enable-insecure-extension- --gradio-queue --cloudflared\" REQS_FILE=\"requirements.txt\" python launch.py\n",
|
172 |
+
"# If remotemoe failed to start, change '--remotemoe' to '--cloudflared' on the COMMANDLINE_ARGS line above to use cloudflare tunnel"
|
173 |
+
],
|
174 |
+
"metadata": {
|
175 |
+
"id": "3EOPSiOgUs4z"
|
176 |
+
},
|
177 |
+
"execution_count": null,
|
178 |
+
"outputs": []
|
179 |
+
},
|
180 |
+
{
|
181 |
+
"cell_type": "markdown",
|
182 |
+
"metadata": {
|
183 |
+
"id": "RCKXEyqdIslR"
|
184 |
+
},
|
185 |
+
"source": [
|
186 |
+
"# 📚 GitHub for more: [_@nolanaatama_](https://github.com/nolanaatama)\n",
|
187 |
+
"# 📦 Repo: [Github](https://github.com/nolanaatama/sd-1click-colab)"
|
188 |
+
]
|
189 |
+
}
|
190 |
+
]
|
191 |
+
}
|