{ "cells": [ { "cell_type": "markdown", "id": "676114ae", "metadata": {}, "source": [ "## Every Dream trainer\n", "\n", "You will need your data prepared first before starting! Don't waste rental fees if you're not ready to upload your files. Your files should be captioned before you start with either the caption as the filename or in text files for each image alongside the image files. See main README.md for more details. Tools are available to automatically caption your files.\n", "\n", "[Instructions](https://github.com/victorchall/EveryDream-trainer/blob/main/README.md)\n", "\n", "If you can sign up for Runpod here (shameless referral link): [Runpod](https://runpod.io?ref=oko38cd0)\n", "\n", "If you are confused by the wall of text, join the discord here: [EveryDream Discord](https://discord.gg/uheqxU6sXN)\n", "\n", "Make sure you have at least 40GB of Runpod **Volume** storage at a minimum so you don't waste training just 1 ckpt that is overtrained and have to start over. Penny pinching on storage is ultimately a waste of your time and money! This is setup to give you more than one ckpt so you don't overtrain.\n", "\n", "### Starting model\n", "Make sure you have your hugging face token ready to download the 1.5 mode. You can get one here: https://huggingface.co/settings/tokens\n", "If you don't have a User Access Token, create one. Or you can upload a starting checkpoint instead of using the HF download and skip that step, but you'll need to modify the starting model name when you start training (more info below)." ] }, { "cell_type": "code", "execution_count": null, "id": "0902e735", "metadata": {}, "outputs": [], "source": [ "# check system resources, make sure your GPU actually has 24GB\n", "# You should see \"0 MB / 24576 MB\" in the middle of the printout\n", "# if you see 0 MB / 22000 MB find a different instance or provider...\n", "!grep Swap /proc/meminfo\n", "!swapon -s\n", "!nvidia-smi" ] }, { "cell_type": "code", "execution_count": null, "id": "bb6d14b7-3c37-4ec4-8559-16b4e9b8dd18", "metadata": {}, "outputs": [], "source": [ "!git clone https://github.com/victorchall/everydream-trainer\n", "%cd everydream-trainer\n", "\n", "import codecs\n", "finish_msg = codecs.encode('QBAR', 'rot_13')\n", "\n", "print(finish_msg)" ] }, { "cell_type": "markdown", "id": "589bfca0", "metadata": { "tags": [] }, "source": [ "## Install dependencies\n", "\n", "**This will take a couple minutes. Wait until it says \"DONE\" to move on.** \n", "You can ignore \"warnings.\"" ] }, { "cell_type": "code", "execution_count": null, "id": "ab559338", "metadata": {}, "outputs": [], "source": [ "!pip install -q --upgrade jupyterlab\n", "!pip install -q --upgrade ipywidgets\n", "!pip install -q omegaconf\n", "!pip install -q einops\n", "!pip install -q pytorch-lightning==1.6.5\n", "!pip install -q test-tube\n", "!pip install -q transformers==4.19.2\n", "!pip install -q kornia\n", "!pip install -q -e git+https://github.com/CompVis/taming-transformers.git@master#egg=taming-transformers\n", "!pip install -q -e git+https://github.com/openai/CLIP.git@main#egg=clip\n", "!pip install -q setuptools==59.5.0\n", "!pip install -q pillow==9.0.1\n", "!pip install -q torchmetrics==0.6.0\n", "!pip install -e .\n", "!pip install huggingface_hub\n", "!pip install -q -e git+https://github.com/CompVis/taming-transformers.git@master#egg=taming-transformers\n", "!pip install -q -e git+https://github.com/openai/CLIP.git@main#egg=clip\n", "import ipywidgets as widgets\n", "print(finish_msg)" ] }, { "cell_type": "markdown", "id": "c230d91a", "metadata": {}, "source": [ "## Now that dependencies are installed, ready to move on!" ] }, { "cell_type": "markdown", "id": "17affc47", "metadata": {}, "source": [ "## Log into huggingface\n", "Run the cell below and paste your token into the prompt. You can get your token from your [huggingface account page](https://huggingface.co/settings/tokens).\n", "\n", "The token will not show on the screen, just press enter after you paste it.\n", "\n", "Then run the following cell to download the base checkpoint (may take a minute)." ] }, { "cell_type": "code", "execution_count": 17, "id": "02c8583e", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "3b16e2951c6549f589afaadc67e5ac9d", "version_major": 2, "version_minor": 0 }, "text/plain": [ "VBox(children=(HTML(value='