File size: 14,405 Bytes
79d1fb7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"accelerator": "GPU",
"gpuClass": "standard"
},
"cells": [
{
"cell_type": "markdown",
"source": [
"### Setup/Troubleshooting\n",
"Click thingy below to keep colab tab alive while running SD"
],
"metadata": {
"id": "DBRMp3KyeXQm"
}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 91
},
"id": "7tv-3cGvQiQm",
"outputId": "f429240b-4daf-4456-dfb6-82492fefffc3"
},
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"<IPython.core.display.HTML object>"
],
"text/html": [
"<b>Press play on the music player(Uses only 13MB of data)</b><br/>\n",
"<audio src=\"https://henk.tech/colabkobold/silence.m4a\" controls>\n"
]
},
"metadata": {}
}
],
"source": [
"%%html\n",
"<b>Press play on the music player(Uses only 13MB of data)</b><br/>\n",
"<audio src=\"https://henk.tech/colabkobold/silence.m4a\" controls>"
]
},
{
"cell_type": "markdown",
"source": [
"<b>Pytorch/Torchvision fix</b><br>\n",
"If running the WebUI tunnel and it promots a torchvision error on versions, run this."
],
"metadata": {
"id": "ME6TR7D6L3ua"
}
},
{
"cell_type": "code",
"source": [
"%pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchtext==0.14.1 torchaudio==0.13.1 torchdata==0.5.1 --extra-index-url https://download.pytorch.org/whl/cu117"
],
"metadata": {
"id": "iEqBEJHvRCFs"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"**Drive Mount** \n",
"<br> Mounts Google Drive onto the colab."
],
"metadata": {
"id": "iwUkS06KWEHJ"
}
},
{
"cell_type": "code",
"source": [
"from google.colab import drive\n",
"drive.mount('/content/drive')"
],
"metadata": {
"id": "vx7U5dg2QmzH"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"<b>Stable Diffusion Download</b><br>\n",
"Downloads stable diffusion onto the colab. Comes with some plugins already."
],
"metadata": {
"id": "baj9ryDKMzMq"
}
},
{
"cell_type": "code",
"source": [
"!curl -Lo memfix.zip https://github.com/nolanaatama/sd-webui/raw/main/memfix.zip\n",
"!unzip /content/memfix.zip\n",
"!apt install -qq libunwind8-dev\n",
"!dpkg -i *.deb\n",
"%env LD_PRELOAD=libtcmalloc.so\n",
"!rm *\n",
"!pip install --upgrade fastapi==0.90.1\n",
"!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui\n",
"!git clone https://github.com/nolanaatama/sd-webui-tunnels /content/stable-diffusion-webui/extensions/sd-webui-tunnels\n",
"!git clone https://github.com/Mikubill/sd-webui-controlnet /content/stable-diffusion-webui/extensions/sd-webui-controlnet\n",
"!git clone https://github.com/fkunn1326/openpose-editor /content/stable-diffusion-webui/extensions/openpose-editor\n",
"!git clone https://github.com/yfszzx/stable-diffusion-webui-images-browser /content/stable-diffusion-webui/extensions/stable-diffusion-webui-images-browser\n",
"!git clone https://github.com/DominikDoom/a1111-sd-webui-tagcomplete /content/stable-diffusion-webui/extensions/a1111-sd-webui-tagcomplete\n",
"!git clone https://github.com/KohakuBlueleaf/a1111-sd-webui-locon /contrnt/stable-diffusion-webui/extensions/a1111-sd-webui-locon\n",
"# Model(s) setup\n",
"# Below are model code for ChilloutMix, we always could change it to our desired model (how-to: https://youtu.be/vj-QrS_mWQI or https://youtu.be/MwyfwPFezvY)\n",
"!curl -Lo /content/stable-diffusion-webui/models/Stable-diffusion/chilloutmixni.safetensors https://huggingface.co/nolanaatama/chomni/resolve/main/chomni.safetensors\n",
"\n",
"# ControlNet\n",
"!curl -Lo /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models/control_canny.safetensors https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_canny-fp16.safetensors\n",
"!curl -Lo /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models/control_depth.safetensors https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_depth-fp16.safetensors\n",
"!curl -Lo /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models/control_hed-fp16.safetensors https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_hed-fp16.safetensors\n",
"!curl -Lo /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models/control_mlsd-fp16.safetensors https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_mlsd-fp16.safetensors\n",
"!curl -Lo /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models/control_normal-fp16.safetensors https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_normal-fp16.safetensors\n",
"!curl -Lo /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models/control_openpose-fp16.safetensors https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_openpose-fp16.safetensors\n",
"!curl -Lo /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models/control_scribble-fp16.safetensors https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_scribble-fp16.safetensors\n",
"!curl -Lo /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models/control_seg-fp16.safetensors https://huggingface.co/webui/ControlNet-modules-safetensors/resolve/main/control_seg-fp16.safetensors\n",
"!curl -Lo /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models/t2iadapter_canny_sd14v1.pth https://huggingface.co/TencentARC/T2I-Adapter/resolve/main/models/t2iadapter_canny_sd14v1.pth\n",
"!curl -Lo /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models/t2iadapter_color_sd14v1.pth https://huggingface.co/TencentARC/T2I-Adapter/resolve/main/models/t2iadapter_color_sd14v1.pth\n",
"!curl -Lo /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models/t2iadapter_depth_sd14v1.pth https://huggingface.co/TencentARC/T2I-Adapter/resolve/main/models/t2iadapter_depth_sd14v1.pth\n",
"!curl -Lo /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models/t2iadapter_keypose_sd14v1.pth https://huggingface.co/TencentARC/T2I-Adapter/resolve/main/models/t2iadapter_keypose_sd14v1.pth\n",
"!curl -Lo /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models/t2iadapter_openpose_sd14v1.pth https://huggingface.co/TencentARC/T2I-Adapter/resolve/main/models/t2iadapter_openpose_sd14v1.pth\n",
"!curl -Lo /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models/t2iadapter_seg_sd14v1.pth https://huggingface.co/TencentARC/T2I-Adapter/resolve/main/models/t2iadapter_seg_sd14v1.pth\n",
"!curl -Lo /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models/t2iadapter_sketch_sd14v1.pth https://huggingface.co/TencentARC/T2I-Adapter/resolve/main/models/t2iadapter_sketch_sd14v1.pth\n",
"!curl -Lo /content/stable-diffusion-webui/extensions/sd-webui-controlnet/models/t2iadapter_style_sd14v1.pth https://huggingface.co/TencentARC/T2I-Adapter/resolve/main/models/t2iadapter_style_sd14v1.pth\n",
"import shutil\n",
"shutil.rmtree('/content/stable-diffusion-webui/embeddings')\n",
"%cd /content/stable-diffusion-webui\n",
"!git checkout 0cc0ee1\n",
"!git clone https://huggingface.co/nolanaatama/embeddings\n",
"# Web UI tunnel\n",
"!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\n",
"# If remotemoe failed to start, change '--remotemoe' to '--cloudflared' on the COMMANDLINE_ARGS line above to use cloudflare tunnel"
],
"metadata": {
"id": "dqA3z5bwQkvq"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"**Web UI Startup**\n",
"<br>Click start on this note to begin stable diffusion. \n",
"<br>Make sure all wanted models are loaded on the models folder."
],
"metadata": {
"id": "ESVbs6GeVtyp"
}
},
{
"cell_type": "code",
"source": [
"# Web UI tunnel\n",
"!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"
],
"metadata": {
"id": "XIjrjhmFVGxq"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"###Installing Models\n",
"Methods of installing models such as LoRA into SD web-ui."
],
"metadata": {
"id": "dVYNKa2bNUAq"
}
},
{
"cell_type": "markdown",
"source": [
"**Hugging Face Download**\n",
"<br> Downloads the huggingface repo.\n",
"\n",
"Login possibly required, use a read API token."
],
"metadata": {
"id": "TicK8AEjWaSk"
}
},
{
"cell_type": "code",
"source": [
"!pip install huggingface_hub\n",
"import huggingface_hub\n",
"huggingface_hub.login(\"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\")\n",
"!git clone https://huggingface.co/Solarium/personal-lora.git /content/huggingface\n",
"%cd personal-lora\n",
"!git-lfs install\n",
"!git lfs pull"
],
"metadata": {
"id": "5LBEaujTQnLh"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"**LoRA sets**\n",
"\n",
"Downloads specific sets of models from the huggingface repo."
],
"metadata": {
"id": "7W6yfgk0WtDq"
}
},
{
"cell_type": "code",
"source": [
"\n",
"# Azur Lane characters\n",
"!cp -r '/content/huggingface/Anime/azur-lane/.' '/content/stable-diffusion-webui/models/Lora'\n",
"\n",
"# Blue Archive Characters\n",
"!cp -r '/content/huggingface/Anime/blue-archive/.' '/content/stable-diffusion-webui/models/Lora'\n",
"\n",
"# Genshin Impact Models\n",
"!cp -r '/content/huggingface/Anime/Genshin/.' '/content/stable-diffusion-webui/models/Lora'\n",
"\n",
"# Characters from other stuff\n",
"!cp -r '/content/huggingface/Anime/other/.' '/content/stable-diffusion-webui/models/Lora'"
],
"metadata": {
"id": "66nYE2NCQoaW"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"**Doll Likenesses**\n",
"\n",
"Will be mounted on the huggingface repo eventually."
],
"metadata": {
"id": "ypHUF_LYXZSK"
}
},
{
"cell_type": "code",
"source": [
"# Japanese Doll Likeness\n",
"!curl -Lo /content/stable-diffusion-webui/models/Lora/japaneseDollLikeness_v10.safetensors https://huggingface.co/nolanaatama/jdllora/resolve/main/jdllora.safetensors\n",
"\n",
"# Korean Doll Likeness\n",
"!curl -Lo /content/stable-diffusion-webui/models/Lora/koreanDollLikeness_v15.safetensors https://huggingface.co/nolanaatama/kdllora/resolve/main/kdllorav15.safetensors\n",
"\n",
"# Taiwan Doll Likeness\n",
"!curl -Lo /content/stable-diffusion-webui/models/Lora/taiwanDollLikeness_v10.safetensors https://huggingface.co/nolanaatama/tdllora/resolve/main/tdllora.safetensors\n",
"\n",
"#!cp -r '/content/drive/MyDrive/AI/Models/.' '/content/stable-diffusion-webui/models/Loras' to '--cloudflared' on the COMMANDLINE_ARGS line above to use cloudflare tunnel"
],
"metadata": {
"id": "bw3ke8PKQpDk",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "ba854a89-71cf-44c8-d81f-028108315321"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
" % Total % Received % Xferd Average Speed Time Time Time Current\n",
" Dload Upload Total Spent Left Speed\n",
"100 1129 100 1129 0 0 8007 0 --:--:-- --:--:-- --:--:-- 8007\n",
"100 144M 100 144M 0 0 176M 0 --:--:-- --:--:-- --:--:-- 176M\n",
" % Total % Received % Xferd Average Speed Time Time Time Current\n",
" Dload Upload Total Spent Left Speed\n",
"100 1139 100 1139 0 0 8761 0 --:--:-- --:--:-- --:--:-- 8694\n",
"100 144M 100 144M 0 0 174M 0 --:--:-- --:--:-- --:--:-- 174M\n",
" % Total % Received % Xferd Average Speed Time Time Time Current\n",
" Dload Upload Total Spent Left Speed\n",
"100 1137 100 1137 0 0 8548 0 --:--:-- --:--:-- --:--:-- 8485\n",
"100 144M 100 144M 0 0 161M 0 --:--:-- --:--:-- --:--:-- 161M\n"
]
}
]
}
]
} |