Upload realisticvisionv2.ipynb
Browse files- realisticvisionv2.ipynb +160 -61
realisticvisionv2.ipynb
CHANGED
|
@@ -1,61 +1,160 @@
|
|
| 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 |
-
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/
|
| 37 |
-
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/
|
| 38 |
-
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/
|
| 39 |
-
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/
|
| 40 |
-
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/
|
| 41 |
-
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/
|
| 42 |
-
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/
|
| 43 |
-
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/
|
| 44 |
-
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/
|
| 45 |
-
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/
|
| 46 |
-
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/
|
| 47 |
-
#!curl -Lo /content/sd-webui/extensions/sd-webui-controlnet/models/
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
!
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cells": [
|
| 3 |
+
{
|
| 4 |
+
"cell_type": "code",
|
| 5 |
+
"execution_count": null,
|
| 6 |
+
"metadata": {
|
| 7 |
+
"id": "sBbcB4vwj_jm"
|
| 8 |
+
},
|
| 9 |
+
"outputs": [],
|
| 10 |
+
"source": [
|
| 11 |
+
"!curl -Lo memfix.zip https://github.com/nolanaatama/sd-webui/raw/main/memfix.zip\n",
|
| 12 |
+
"!unzip /content/memfix.zip\n",
|
| 13 |
+
"!apt install -qq libunwind8-dev\n",
|
| 14 |
+
"!apt install -qq libcairo2-dev pkg-config python3-dev\n",
|
| 15 |
+
"!dpkg -i *.deb\n",
|
| 16 |
+
"%env LD_PRELOAD=libtcmalloc.so\n",
|
| 17 |
+
"!rm *\n",
|
| 18 |
+
"!pip install --upgrade fastapi==0.90.1\n",
|
| 19 |
+
"!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",
|
| 20 |
+
"!curl -Lo sd-webui.zip https://huggingface.co/nolanaatama/webui/resolve/main/sd-webui.zip\n",
|
| 21 |
+
"!unzip /content/sd-webui.zip\n",
|
| 22 |
+
"!git clone https://github.com/nolanaatama/sd-webui-tunnels /content/sd-webui/extensions/sd-webui-tunnels\n",
|
| 23 |
+
"!git clone https://github.com/Mikubill/sd-webui-controlnet /content/sd-webui/extensions/sd-webui-controlnet\n",
|
| 24 |
+
"!git clone https://github.com/fkunn1326/openpose-editor /content/sd-webui/extensions/openpose-editor\n",
|
| 25 |
+
"!git clone https://github.com/hnmr293/posex /content/sd-webui/extensions/posex\n",
|
| 26 |
+
"!git clone https://github.com/DominikDoom/a1111-sd-webui-tagcomplete /content/sd-webui/extensions/a1111-sd-webui-tagcomplete\n",
|
| 27 |
+
"!git clone https://github.com/hako-mikan/sd-webui-supermerger /content/sd-webui/extensions/sd-webui-supermerger\n",
|
| 28 |
+
"!curl -Lo /content/sd-webui/extensions/sd-webui-images-browser.zip https://huggingface.co/nolanaatama/webui/resolve/main/sd-webui-images-browser.zip\n",
|
| 29 |
+
"%cd /content/sd-webui/extensions\n",
|
| 30 |
+
"!unzip /content/sd-webui/extensions/sd-webui-images-browser.zip\n",
|
| 31 |
+
"%cd /content\n",
|
| 32 |
+
"# Model Code\n",
|
| 33 |
+
"!curl -Lo /content/sd-webui/models/Stable-diffusion/realisticVisionV20_v20.safetensors https://civitai.com/api/download/models/29460\\n,\n",
|
| 34 |
+
"# ControlNet\n",
|
| 35 |
+
"# Remove '#' from the beginning of the line(s) below to download the selected ControlNet model(s)\n",
|
| 36 |
+
"#!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",
|
| 37 |
+
"#!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",
|
| 38 |
+
"#!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",
|
| 39 |
+
"#!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",
|
| 40 |
+
"#!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",
|
| 41 |
+
"#!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",
|
| 42 |
+
"#!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",
|
| 43 |
+
"#!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",
|
| 44 |
+
"#!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",
|
| 45 |
+
"#!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",
|
| 46 |
+
"#!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",
|
| 47 |
+
"#!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",
|
| 48 |
+
"#!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",
|
| 49 |
+
"#!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",
|
| 50 |
+
"#!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",
|
| 51 |
+
"#!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",
|
| 52 |
+
"#!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",
|
| 53 |
+
"#!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",
|
| 54 |
+
"#!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",
|
| 55 |
+
"#!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",
|
| 56 |
+
"#!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",
|
| 57 |
+
"#!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",
|
| 58 |
+
"import shutil\n",
|
| 59 |
+
"shutil.rmtree('/content/sd-webui/embeddings')\n",
|
| 60 |
+
"!rm sd-webui.zip\n",
|
| 61 |
+
"!rm sd-webui-images-browser.zip\n",
|
| 62 |
+
"%cd /content/sd-webui\n",
|
| 63 |
+
"!git clone https://huggingface.co/nolanaatama/embeddings\n",
|
| 64 |
+
"%cd /content/sd-webui/models\n",
|
| 65 |
+
"!git clone https://huggingface.co/nolanaatama/ESRGAN\n",
|
| 66 |
+
"%cd /content/sd-webui/extensions/a1111-sd-webui-tagcomplete\n",
|
| 67 |
+
"!git checkout f9f7732\n",
|
| 68 |
+
"%cd /content/sd-webui\n",
|
| 69 |
+
"# Web UI tunnel\n",
|
| 70 |
+
"!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",
|
| 71 |
+
"# If remotemoe failed to start, change '--remotemoe' to '--cloudflared' on the COMMANDLINE_ARGS line above to use cloudflare tunnel"
|
| 72 |
+
]
|
| 73 |
+
},
|
| 74 |
+
{
|
| 75 |
+
"attachments": {},
|
| 76 |
+
"cell_type": "markdown",
|
| 77 |
+
"metadata": {
|
| 78 |
+
"id": "0DwYF_aLUXKy"
|
| 79 |
+
},
|
| 80 |
+
"source": [
|
| 81 |
+
"## (OPTIONAL) LoRAs"
|
| 82 |
+
]
|
| 83 |
+
},
|
| 84 |
+
{
|
| 85 |
+
"attachments": {},
|
| 86 |
+
"cell_type": "markdown",
|
| 87 |
+
"metadata": {
|
| 88 |
+
"id": "JUtPlg328avv"
|
| 89 |
+
},
|
| 90 |
+
"source": [
|
| 91 |
+
"### 1. After the gradio link show up, stop the first cell & clear the code output👆"
|
| 92 |
+
]
|
| 93 |
+
},
|
| 94 |
+
{
|
| 95 |
+
"attachments": {},
|
| 96 |
+
"cell_type": "markdown",
|
| 97 |
+
"metadata": {
|
| 98 |
+
"id": "xy_WyDzNUgd2"
|
| 99 |
+
},
|
| 100 |
+
"source": [
|
| 101 |
+
"### 2. Load the LoRA & launch the web ui"
|
| 102 |
+
]
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
"cell_type": "code",
|
| 106 |
+
"execution_count": null,
|
| 107 |
+
"metadata": {
|
| 108 |
+
"id": "3EOPSiOgUs4z"
|
| 109 |
+
},
|
| 110 |
+
"outputs": [],
|
| 111 |
+
"source": [
|
| 112 |
+
"# 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",
|
| 113 |
+
"# How-to download the setup file: Click 'File' menu -> 'Download' -> 'Download .ipynb'\n",
|
| 114 |
+
"# Load LoRA from Google Drive: https://youtu.be/G1QZfAPUMaM\n",
|
| 115 |
+
"\n",
|
| 116 |
+
"# LoRA 1\n",
|
| 117 |
+
"#!curl ...\n",
|
| 118 |
+
"\n",
|
| 119 |
+
"# LoRA 2\n",
|
| 120 |
+
"#!curl ...\n",
|
| 121 |
+
"\n",
|
| 122 |
+
"# LoRA 3\n",
|
| 123 |
+
"#!curl ...\n",
|
| 124 |
+
"\n",
|
| 125 |
+
"# ...\n",
|
| 126 |
+
"\n",
|
| 127 |
+
"# Web UI tunnel\n",
|
| 128 |
+
"!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",
|
| 129 |
+
"# If remotemoe failed to start, change '--remotemoe' to '--cloudflared' on the COMMANDLINE_ARGS line above to use cloudflare tunnel"
|
| 130 |
+
]
|
| 131 |
+
},
|
| 132 |
+
{
|
| 133 |
+
"attachments": {},
|
| 134 |
+
"cell_type": "markdown",
|
| 135 |
+
"metadata": {
|
| 136 |
+
"id": "fhwIXzcgfkoR"
|
| 137 |
+
},
|
| 138 |
+
"source": [
|
| 139 |
+
"# 📚 GitHub for more: [_@nolanaatama_](https://github.com/nolanaatama)\n",
|
| 140 |
+
"# 📦 Repo: [Github](https://github.com/nolanaatama/sd-1click-colab)"
|
| 141 |
+
]
|
| 142 |
+
}
|
| 143 |
+
],
|
| 144 |
+
"metadata": {
|
| 145 |
+
"accelerator": "GPU",
|
| 146 |
+
"colab": {
|
| 147 |
+
"provenance": []
|
| 148 |
+
},
|
| 149 |
+
"gpuClass": "standard",
|
| 150 |
+
"kernelspec": {
|
| 151 |
+
"display_name": "Python 3",
|
| 152 |
+
"name": "python3"
|
| 153 |
+
},
|
| 154 |
+
"language_info": {
|
| 155 |
+
"name": "python"
|
| 156 |
+
}
|
| 157 |
+
},
|
| 158 |
+
"nbformat": 4,
|
| 159 |
+
"nbformat_minor": 0
|
| 160 |
+
}
|