stable-diffusion-paperspace/StableDiffusionUI_Voldemort...

626 lines
19 KiB
Plaintext
Raw Normal View History

2022-09-08 13:02:54 -06:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
2022-09-11 16:35:36 -06:00
"id": "gfKvWAVnz8OB",
"tags": []
2022-09-08 13:02:54 -06:00
},
"source": [
"# Voldemort's Stable Diffusion WebUI\n",
"\n",
2022-09-11 16:35:36 -06:00
"Adapted from: https://colab.research.google.com/drive/1Iy-xW9t1-OQWhb0hNxueGij8phCyluOh\n",
"\n",
"**Updating the Notebook**\n",
"\n",
"In the Tools section at the bottom of the notebook there is a block to download the latest version from Github.\n",
2022-09-11 16:35:36 -06:00
"\n",
"**Guides**\n",
"- [Getting started on Paperspace](https://github.com/Engineer-of-Stuff/stable-diffusion-paperspace/blob/main/Docs/Paperspace%20Guide%20for%20Retards.md)\n",
"- [Using the WebUI](https://rentry.org/voldy)\n",
"- [Using the Inpainter](https://rentry.org/drfar)\n",
"- [Textual Inversion](https://rentry.org/aikgx)\n",
"- [Crowd-Sourced Prompts](https://lexica.art/)\n",
2022-09-28 22:32:59 -06:00
"- [Artist Name Prompts](https://sgreens.notion.site/sgreens/4ca6f4e229e24da6845b6d49e6b08ae7?v=fdf861d1c65d456e98904fe3f3670bd3)\n",
"- [Stable Diffusion Models](https://cyberes.github.io/stable-diffusion-models)\n",
"- [Textual Inversion Models](https://cyberes.github.io/stable-diffusion-textual-inversion-models/)\n",
"- [Have I Been Trained?](https://haveibeentrained.com/)"
2022-09-08 13:02:54 -06:00
]
},
{
"cell_type": "markdown",
"metadata": {
"tags": []
},
"source": [
"## Installation and Setup\n",
"\n",
2022-09-28 22:32:59 -06:00
"You must reinstall everything each time you restart the machine. If already downloaded, dependencies will be auto-updated."
2022-09-08 13:02:54 -06:00
]
},
2022-09-10 14:24:12 -06:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Where to store the models**\n",
"\n",
2022-09-16 13:12:14 -06:00
"`/storage/` is persistent storage shared across all machines on your account.\n",
2022-09-10 14:24:12 -06:00
"\n",
2022-09-16 13:12:14 -06:00
"`/notebooks/` is storage for this notebook only.\n",
2022-09-10 14:24:12 -06:00
"\n",
2022-09-18 00:25:08 -06:00
"We're going to store models in `/storage/models` and create a symlink.\n",
2022-09-16 13:14:05 -06:00
"\n",
"_You must run the block below or else the variable won't be accessable in the notebook._"
2022-09-10 14:24:12 -06:00
]
},
2022-09-08 13:02:54 -06:00
{
"cell_type": "code",
"execution_count": null,
2022-09-10 14:24:12 -06:00
"metadata": {},
2022-09-08 13:02:54 -06:00
"outputs": [],
"source": [
2022-09-10 14:24:12 -06:00
"model_storage_dir = '/storage/models' # no trailing slash\n",
"\n",
"# ===============================================================\n",
"# Save the variable to Jupiter's temp storage to access it when the kernel restarts.\n",
"# To reset your storage directory, rerun this cell.\n",
2022-09-18 00:25:08 -06:00
"%store model_storage_dir"
2022-09-08 13:02:54 -06:00
]
},
{
"cell_type": "markdown",
"metadata": {
"tags": []
},
"source": [
"### Clone the central repository"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "sBbcB4vwj_jm",
"tags": []
2022-09-08 13:02:54 -06:00
},
"outputs": [],
"source": [
"import os.path\n",
2022-09-10 14:24:12 -06:00
"%store -r model_storage_dir\n",
2022-09-08 13:02:54 -06:00
"if not os.path.exists('/notebooks/stable-diffusion-webui'):\n",
2022-09-08 15:49:49 -06:00
" %cd /notebooks/\n",
2022-09-08 13:02:54 -06:00
" !git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui\n",
"else: # update repo if already exists\n",
" print('stable-diffusion-webui already downloaded, updating...')\n",
2022-09-08 13:02:54 -06:00
" %cd /notebooks/stable-diffusion-webui\n",
" !git pull"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "C68TUpkq0nj_",
"tags": []
},
"source": [
2022-09-18 14:39:19 -06:00
"### Install requirements and download repositories"
2022-09-08 13:02:54 -06:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "SaAJk33ppFw1",
"scrolled": true,
"tags": []
},
"outputs": [],
"source": [
"%cd /notebooks/stable-diffusion-webui\n",
2022-09-10 14:24:12 -06:00
"%store -r model_storage_dir\n",
2022-09-08 13:02:54 -06:00
"\n",
"# Import launch.py which will automatically run the install script but not launch the WebUI.\n",
"# They require a few specific external git repo commits so we have to do it their way. \n",
"import launch\n",
"\n",
"# Download the GFPGAN face restorer.\n",
2022-09-08 13:02:54 -06:00
"if not os.path.exists('/notebooks/stable-diffusion-webui/GFPGANv1.3.pth'):\n",
" !wget https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth -O /notebooks/stable-diffusion-webui/GFPGANv1.3.pth\n",
2022-09-08 13:02:54 -06:00
"else:\n",
2022-09-08 16:40:35 -06:00
" print('GFPGANv1.3.pth already downloaded')\n",
" \n",
"# Make sure your models storage directory exists\n",
2022-09-28 22:32:59 -06:00
"!mkdir -p $model_storage_dir\n",
"\n",
"# Link the output folder to /notebooks/outputs\n",
"!mkdir -p /notebooks/stable-diffusion-webui/outputs\n",
"!ln -s /notebooks/stable-diffusion-webui/outputs /notebooks/outputs"
2022-09-08 13:02:54 -06:00
]
},
{
"cell_type": "markdown",
"metadata": {
2022-09-08 15:49:49 -06:00
"id": "F0EINk5M0s-w",
2022-09-18 14:39:19 -06:00
"jp-MarkdownHeadingCollapsed": true,
2022-09-08 15:49:49 -06:00
"tags": []
2022-09-08 13:02:54 -06:00
},
"source": [
2022-09-16 13:07:57 -06:00
"### Download the Model"
2022-09-08 13:02:54 -06:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2022-09-28 22:32:59 -06:00
"I've provided a few different ways of aquiring the models. Try the torrent option first. You don't need to repeat this step if you've already downloaded the models.\n",
"\n",
2022-09-28 22:32:59 -06:00
"There are a few additional models available here: https://cyberes.github.io/stable-diffusion-models\n",
"\n",
2022-09-28 22:32:59 -06:00
"If you're interested in textual inversion, here's the database: https://cyberes.github.io/stable-diffusion-textual-inversion-models\n",
2022-09-09 12:15:51 -06:00
"\n",
2022-09-28 22:32:59 -06:00
"**Filesize and Storage Disclaimer**\n",
2022-09-10 14:24:12 -06:00
"\n",
2022-09-28 22:51:29 -06:00
"Paperspace free tier has only 5GB of storage space. There's really not a way to get around this limitation, but here's a few suggestions.\n",
2022-09-09 12:25:40 -06:00
"1. Add a payment method to your account. Storage overages are billed at \\$0.29/GB and billing occurs monthly and runs at midnight on the first of each month. With a payment method on file, Paperspace will let you use more storage and if you time it right you shouldn't actually be charged for it.\n",
"2. Upgrade to a Pro account. They'll give you 15GB and you'll get longer runtimes and more powerful free GPUs.\n",
2022-09-14 10:16:23 -06:00
"3. Use my referral code `KQLRH37` You'll get \\$10 credit that you should be able to put towards the storage overage charges. Redeem the code at the bottom of the Billing page.\n",
"\n",
2022-09-28 22:51:29 -06:00
"If you're on free tier, only download one model.\n",
"\n",
2022-09-14 10:16:23 -06:00
"**Torrent Instructions**\n",
"\n",
"Aria2 may show some errors/warnings while downloading. Those are fine, when it eventually says \"Download Complete\" that means everything worked as it should."
2022-09-08 13:02:54 -06:00
]
},
{
"cell_type": "markdown",
"metadata": {
"tags": []
},
"source": [
"#### Standard Model"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Torrent**"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
2022-09-10 14:24:12 -06:00
"%store -r model_storage_dir\n",
"!apt update\n",
"!apt install -y aria2\n",
2022-09-10 14:24:12 -06:00
"%cd $model_storage_dir\n",
2022-09-16 13:07:57 -06:00
"!aria2c --seed-time=0 --max-overall-upload-limit=1K \"magnet:?xt=urn:btih:3A4A612D75ED088EA542ACAC52F9F45987488D1C&tr=udp://tracker.opentrackr.org:1337/announce\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Web Download**\n",
"\n",
2022-09-08 13:02:54 -06:00
"Voldy provided an alternative download if you don't want to use HuggingFace.\n",
"\n",
"[https://drive.google.com/file/d/1wHFgl0ivCmIZv88hVZXkb8oy9qCuaBGA/view](https://drive.google.com/file/d/1wHFgl0ivCmIZv88hVZXkb8oy9qCuaBGA/view)\n",
"\n",
2022-09-10 14:24:12 -06:00
"Download it to your computer then upload it to your model storage directory (make sure it's named `sd-v1-4.ckpt`).\n",
2022-09-08 13:02:54 -06:00
"\n",
"HuggingFace is much faster and reliable but you need to get access to the repo and provide your user token."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "CT_J9L7oqLxG"
},
"outputs": [],
"source": [
2022-09-10 14:24:12 -06:00
"user_token = \"<enter your user token here>\"\n",
2022-09-08 13:02:54 -06:00
"\n",
"# ===============================================================================================\n",
2022-09-10 14:24:12 -06:00
"%store -r model_storage_dir\n",
"!wget --header=\"'Authorization: Bearer {user_token}'\" https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt -O $model_storage_dir/sd-v1-4.ckpt"
2022-09-08 13:02:54 -06:00
]
},
{
"cell_type": "markdown",
"metadata": {
"tags": []
},
"source": [
2022-09-18 13:16:32 -06:00
"#### Waifu Diffusion\n",
"\n",
"The original Stable Diffusion anime finetune."
2022-09-08 13:02:54 -06:00
]
},
2022-09-08 15:49:49 -06:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
2022-09-09 12:40:33 -06:00
"!apt update\n",
"!apt install -y aria2\n",
2022-09-10 14:24:12 -06:00
"%cd $model_storage_dir\n",
2022-09-14 10:16:23 -06:00
"!aria2c --seed-time=0 --max-overall-upload-limit=1K \"magnet:?xt=urn:btih:153590FD7E93EE11D8DB951451056C362E3A9150&dn=wd-v1-2-full-ema-pruned.ckpt&tr=udp://tracker.opentrackr.org:1337/announce\""
2022-09-09 12:40:33 -06:00
]
},
2022-09-11 17:44:13 -06:00
{
"cell_type": "markdown",
"metadata": {
"tags": []
},
"source": [
"#### trinart_stable_diffusion_v2"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2022-09-11 18:07:05 -06:00
"Anime finetune.\n",
"\n",
2022-09-18 13:16:32 -06:00
"The 60000 steps version is the original, the 115000 steps is the 60000 with additional training. Use the 60000 step version if the style nudging is too much.\n",
"\n",
2022-09-28 22:51:29 -06:00
"[See the comparison here.](https://cyberes.github.io/stable-diffusion-models/#model-comparison)"
2022-09-11 18:07:05 -06:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2022-09-18 00:25:08 -06:00
"**60000**"
2022-09-11 17:44:13 -06:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%store -r model_storage_dir\n",
2022-09-18 00:25:08 -06:00
"!wget https://huggingface.co/naclbit/trinart_stable_diffusion_v2/resolve/main/trinart2_step60000.ckpt -O $model_storage_dir/trinart2_step60000.ckpt"
2022-09-11 17:44:13 -06:00
]
},
2022-09-11 18:07:05 -06:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
2022-09-18 00:25:08 -06:00
"**95000**"
2022-09-11 18:07:05 -06:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%store -r model_storage_dir\n",
2022-09-18 00:25:08 -06:00
"!wget https://huggingface.co/naclbit/trinart_stable_diffusion_v2/resolve/main/trinart2_step95000.ckpt -O $model_storage_dir/trinart2_step95000.ckpt"
2022-09-08 15:49:49 -06:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2022-09-18 00:25:08 -06:00
"**115000**"
2022-09-08 13:02:54 -06:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
2022-09-10 14:24:12 -06:00
"%store -r model_storage_dir\n",
2022-09-18 00:25:08 -06:00
"!wget https://huggingface.co/naclbit/trinart_stable_diffusion_v2/resolve/main/trinart2_step115000.ckpt -O $model_storage_dir/trinart2_step115000.ckpt"
2022-09-08 13:02:54 -06:00
]
},
2022-09-09 10:19:44 -06:00
{
"cell_type": "markdown",
2022-09-10 14:24:12 -06:00
"metadata": {
"tags": []
},
2022-09-09 10:19:44 -06:00
"source": [
2022-09-09 12:49:42 -06:00
"### Clean up and restart the kernel"
2022-09-09 10:19:44 -06:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
2022-09-10 14:24:12 -06:00
"%store -r model_storage_dir\n",
2022-09-16 13:07:57 -06:00
"\n",
"# Get some storage back\n",
"!pip cache purge\n",
2022-09-10 14:24:12 -06:00
"!rm $model_storage_dir/*.aria2\n",
2022-09-28 22:32:59 -06:00
"!apt remove --purge -y aria2 p7zip-full\n",
"!apt autoremove --purge -y\n",
2022-09-21 12:57:16 -06:00
"!apt clean\n",
2022-09-16 13:07:57 -06:00
"\n",
"# Restart the kernel\n",
2022-09-09 10:19:44 -06:00
"import os\n",
"os.kill(os.getpid(), 9)"
]
},
2022-09-08 13:02:54 -06:00
{
"cell_type": "markdown",
2022-09-18 00:25:08 -06:00
"metadata": {},
2022-09-08 13:02:54 -06:00
"source": [
2022-09-18 00:25:08 -06:00
"### Link the models directory\n",
"\n",
"Create symlinks. The file will be stored in the models storage directory and linked to where the WebUI expects the files to be."
2022-09-08 13:02:54 -06:00
]
},
{
2022-09-18 00:25:08 -06:00
"cell_type": "code",
"execution_count": null,
2022-09-08 13:02:54 -06:00
"metadata": {},
2022-09-18 00:25:08 -06:00
"outputs": [],
2022-09-08 13:02:54 -06:00
"source": [
2022-09-18 00:25:08 -06:00
"%store -r model_storage_dir\n",
"import os\n",
2022-09-18 17:28:01 -06:00
"\n",
"# Check for broken symlinks and remove them\n",
2022-09-30 13:13:17 -06:00
"for file in os.listdir('/notebooks/stable-diffusion-webui/models/Stable-diffusion/'):\n",
" path = f'/notebooks/stable-diffusion-webui/models/Stable-diffusion/{file}'\n",
2022-09-18 17:28:01 -06:00
" if os.path.islink(path) and not os.path.exists(os.readlink(path)):\n",
" print(f'Symlink broken, removing: {file}')\n",
" os.unlink(path)\n",
"\n",
"# Make symlinks for new files\n",
2022-09-18 00:25:08 -06:00
"for file in os.listdir(model_storage_dir):\n",
" if file.endswith(\"ckpt\"):\n",
2022-09-30 13:13:17 -06:00
" path = f'/notebooks/stable-diffusion-webui/models/Stable-diffusion/{file}'\n",
2022-09-18 17:28:01 -06:00
" if not os.path.exists(path):\n",
" print(f'New model: {file}')\n",
2022-09-30 13:13:17 -06:00
" !ln -s $model_storage_dir/$file /notebooks/stable-diffusion-webui/models/Stable-diffusion/$file\n",
" !ls -la --block-size=GB /notebooks/stable-diffusion-webui/models/Stable-diffusion/$file"
2022-09-08 13:02:54 -06:00
]
},
2022-09-10 14:24:12 -06:00
{
"cell_type": "markdown",
2022-09-18 00:25:08 -06:00
"metadata": {
"id": "xt8lbdmC04ox"
},
2022-09-10 14:24:12 -06:00
"source": [
2022-09-18 00:25:08 -06:00
"# Launch the WebUI"
2022-09-10 14:24:12 -06:00
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2022-09-18 00:25:08 -06:00
"Run this block to launch the WebUI. You will get a link to nnn.gradio.app, that's your WebUI. Follow it.\n",
"\n",
2022-09-28 22:32:59 -06:00
"If you have a lot of VRAM and aren't generating large images you can add the flag `--disable-opt-split-attention` to disable VRAM optimizations for a speed boost.\n",
"\n",
2022-09-28 22:32:59 -06:00
"**Troubleshooting**\n",
"\n",
"- If you have any issues, try restarting the kernel.\n",
"- `EOFError: Ran out of input` probably means you ran out of storage space and the model `.ckpt` file wasn't downloaded completely. Try cleaning up your files or you can reset your storage with the _Reset Storage_ block in the Tools section below.\n",
"- If you're having issues with your results not loading, try running an ngrok proxy. More details in the Tools section below."
2022-09-10 14:24:12 -06:00
]
},
2022-09-08 13:02:54 -06:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {
2022-09-08 15:49:49 -06:00
"id": "R-xAdMA5wxXd",
"tags": []
2022-09-08 13:02:54 -06:00
},
"outputs": [],
"source": [
2022-09-10 14:24:12 -06:00
"%store -r model_storage_dir\n",
"%cd /notebooks/stable-diffusion-webui\n",
"!python /notebooks/stable-diffusion-webui/webui.py --share # --disable-opt-split-attention"
2022-09-09 15:48:47 -06:00
]
},
{
"cell_type": "markdown",
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
"# Export Generations"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2022-09-28 22:32:59 -06:00
"This block will rename and compress the outputs with 7zip max compression. It expects you to have `log/` and `outputs/` in `/notebooks/stable-diffusion-webui/`."
2022-09-09 15:48:47 -06:00
]
},
{
"cell_type": "code",
"execution_count": null,
2022-09-10 14:24:12 -06:00
"metadata": {
"scrolled": true,
"tags": []
},
2022-09-09 15:48:47 -06:00
"outputs": [],
"source": [
2022-09-10 06:21:31 -06:00
"!apt update\n",
2022-09-09 15:48:47 -06:00
"!apt install -y p7zip-full\n",
"from datetime import datetime\n",
"datetime_str = datetime.now().strftime('%m-%d-%Y_%H:%M:%S')\n",
"%cd /notebooks/\n",
"!mkdir $datetime_str\n",
2022-09-28 22:32:59 -06:00
"!mv /notebooks/stable-diffusion-webui/log $datetime_str\n",
"!mv /notebooks/stable-diffusion-webui/outputs/* $datetime_str\n",
"!7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on {datetime_str}.7z {datetime_str}/"
2022-09-09 15:48:47 -06:00
]
},
{
"cell_type": "markdown",
"metadata": {
"tags": []
},
"source": [
"### Delete old output folder\n",
"\n",
"This block will delete the folder you just compressed."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!rm -rf /notebooks/$datetime_str/\n",
"!echo Deleted /notebooks/$datetime_str/"
2022-09-08 15:49:49 -06:00
]
2022-09-10 14:24:12 -06:00
},
{
"cell_type": "markdown",
"metadata": {
2022-09-18 17:28:01 -06:00
"jp-MarkdownHeadingCollapsed": true,
2022-09-10 14:24:12 -06:00
"tags": []
},
"source": [
"# Tools"
]
},
2022-09-11 16:42:53 -06:00
{
"cell_type": "markdown",
"metadata": {},
"source": [
2022-09-28 22:32:59 -06:00
"### Show graphics card info"
2022-09-11 16:42:53 -06:00
]
},
2022-09-10 14:24:12 -06:00
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!nvidia-smi"
]
2022-09-11 16:42:53 -06:00
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
2022-09-28 22:32:59 -06:00
"### Download the latest version of this notebook from Github\n",
2022-09-11 16:42:53 -06:00
"\n",
2022-09-18 13:17:48 -06:00
"Run this and refresh the page (press F5). Don't save anything or you will overwrite the downloaded file."
2022-09-11 16:42:53 -06:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
2022-09-28 22:32:59 -06:00
"!mv /notebooks/StableDiffusionUI_Voldemort_paperspace.ipynb /notebooks/StableDiffusionUI_Voldemort_paperspace.ipynb.backup # save your old notebook to a backup\n",
2022-09-11 16:42:53 -06:00
"!wget https://raw.githubusercontent.com/Engineer-of-Stuff/stable-diffusion-paperspace/main/StableDiffusionUI_Voldemort_paperspace.ipynb -O /notebooks/StableDiffusionUI_Voldemort_paperspace.ipynb"
]
2022-09-28 22:32:59 -06:00
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Reset Repository\n",
"\n",
"Sometimes AUTOMATIC1111 breaks something. Go to https://github.com/AUTOMATIC1111/stable-diffusion-webui/commits/master and choose a commit to revert to."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!git reset --hard <commit>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Delete all files and reset storage\n",
"\n",
"This will delete ALL your files in `/notebooks/` and `/storage/`. Use if you're having issues with zero storage space and you don't want to delete your notebook."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Uncomment the lines below to run this block. You can highlight the lines and do ctrl + /\n",
"# !rm -rf /storage/*\n",
"# !mv /notebooks/StableDiffusionUI_Voldemort_paperspace.ipynb / # move the notebook out of the directory before we nuke it\n",
"# !rm -rf /notebooks/*\n",
"# !mv /StableDiffusionUI_Voldemort_paperspace.ipynb /notebooks/ # move it back"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### ngrok Proxy\n",
"\n",
"There's an issue with Gradio's infrastructure where you can't load an image larger than 2MB. We can get around this by running our own proxy with ngrok. Here's how to do it:\n",
"\n",
"1. Add `--port 7860` to the `!python ... webui.py` line in the Launch WebUI section above.\n",
"2. Launch the WebUI.\n",
"3. Go to [ngrok.com](https://ngrok.com/) in a new tab and sign up. Don't close that tab yet.\n",
"4. Open the terminal by clicking on the terminal button in the left sidebar menu. If you're not sure which one that is, hover over the items and a little tooltip will appear.\n",
"5. Run this in the terminal. Make sure to replace `<your authtoken>` with your auth token.\n",
"\n",
"```bash\n",
"pip install pyngrok\n",
"ngrok authtoken <your authtoken>\n",
"ngrok http 7860\n",
"```\n",
"\n",
"ngrok will assign you a subdomain and display a link to it. That's the link to your WebUI instance. If you want, create a new file named `start-ngrok.sh` and copy those lines into it so you can quickly connect."
]
2022-09-08 13:02:54 -06:00
}
],
"metadata": {
"accelerator": "GPU",
"colab": {
"collapsed_sections": [],
"private_outputs": true,
"provenance": []
},
"gpuClass": "standard",
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
}
},
"nbformat": 4,
"nbformat_minor": 4
}