Add notebook with comments for Lambda deployment

This commit is contained in:
Ruben van de Ven 2022-10-27 16:28:01 +02:00
parent b3deaeb181
commit a26269d7d1
2 changed files with 738 additions and 33 deletions

View File

@ -19,37 +19,5 @@ Makes it easy to fine tune Stable Diffusion on your own dataset. For example gen
> Girl with a pearl earring, Cute Obama creature, Donald Trump, Boris Johnson, Totoro, Hello Kitty
For a step by step guide see the [Lambda Labs examples repo](https://github.com/LambdaLabsML/examples).
For a step by step guide see the [notebook in this repo](./tpde_finetune.ipynb) (adapted from [Lambda Labs examples repo](https://github.com/LambdaLabsML/examples).)
## Image variations
![](assets/im-vars-thin.jpg)
[![Open Demo](https://img.shields.io/badge/%CE%BB-Open%20Demo-blueviolet)](https://47725.gradio.app/)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1JqNbI_kDq_Gth2MIYdsphgNgyGIJxBgB?usp=sharing)
[![Open in Spaces](https://img.shields.io/badge/%F0%9F%A4%97-Open%20in%20Spaces-orange)]()
For more details on the Image Variation model see the [model card](https://huggingface.co/lambdalabs/stable-diffusion-image-conditioned).
- Get access to a Linux machine with a decent NVIDIA GPU (e.g. on [Lambda GPU Cloud](https://lambdalabs.com/service/gpu-cloud))
- Clone this repo
- Make sure PyTorch is installed and then install other requirements: `pip install -r requirements.txt`
- Get model from huggingface hub [lambdalabs/stable-diffusion-image-conditioned](https://huggingface.co/lambdalabs/stable-diffusion-image-conditioned/blob/main/sd-clip-vit-l14-img-embed_ema_only.ckpt)
- Put model in `models/ldm/stable-diffusion-v1/sd-clip-vit-l14-img-embed_ema_only.ckpt`
- Run `scripts/image_variations.py` or `scripts/gradio_variations.py`
All together:
```
git clone https://github.com/justinpinkney/stable-diffusion.git
cd stable-diffusion
mkdir -p models/ldm/stable-diffusion-v1
wget https://huggingface.co/lambdalabs/stable-diffusion-image-conditioned/resolve/main/sd-clip-vit-l14-img-embed_ema_only.ckpt -O models/ldm/stable-diffusion-v1/sd-clip-vit-l14-img-embed_ema_only.ckpt
pip install -r requirements.txt
python scripts/gradio_variations.py
```
Then you should see this:
[![](assets/gradio_variations.jpeg)](https://twitter.com/Buntworthy/status/1565704770056294400)
Trained by [Justin Pinkney](https://www.justinpinkney.com) ([@Buntworthy](https://twitter.com/Buntworthy)) at [Lambda](https://lambdalabs.com/)

737
tpde_finetune.ipynb Normal file
View File

@ -0,0 +1,737 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "ipSgY-L3z8kG"
},
"source": [
"# Fine Tune Stable Diffusion\n",
"\n",
"Fine tuning Stable Diffusion on Pokemon, \n",
"for more details see the [Lambda Labs examples repo](https://github.com/LambdaLabsML/examples). \n",
"\n",
"We recommend using a multi-GPU machine, for example an instance from [Lambda GPU Cloud](https://lambdalabs.com/service/gpu-cloud). If running on Colab this notebook is likely to need a GPU with >16GB of VRAM and a runtime with high RAM, which will almost certainly need Colab Pro or Pro+. (If you get errors suchs as `Killed` or `CUDA out of memory` then one of these is not sufficient)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"id": "bjNGOU6Pz8kH"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Cloning into 'stable-diffusion'...\n",
"remote: Enumerating objects: 1546, done.\u001b[K\n",
"remote: Counting objects: 100% (494/494), done.\u001b[K\n",
"remote: Compressing objects: 100% (69/69), done.\u001b[K\n",
"remote: Total 1546 (delta 458), reused 425 (delta 425), pack-reused 1052\u001b[K\n",
"Receiving objects: 100% (1546/1546), 67.92 MiB | 69.07 MiB/s, done.\n",
"Resolving deltas: 100% (980/980), done.\n",
"/home/ubuntu/stable-diffusion\n",
"Defaulting to user installation because normal site-packages is not writeable\n",
"Requirement already satisfied: pip in /home/ubuntu/.local/lib/python3.8/site-packages (22.2.2)\n",
"Defaulting to user installation because normal site-packages is not writeable\n",
"Obtaining taming-transformers from git+https://github.com/CompVis/taming-transformers.git@master#egg=taming-transformers (from -r requirements.txt (line 20))\n",
" Cloning https://github.com/CompVis/taming-transformers.git (to revision master) to ./src/taming-transformers\n",
" Running command git clone --filter=blob:none --quiet https://github.com/CompVis/taming-transformers.git /home/ubuntu/stable-diffusion/src/taming-transformers\n",
" Resolved https://github.com/CompVis/taming-transformers.git to commit 24268930bf1dce879235a7fddd0b2355b84d7ea6\n",
" Preparing metadata (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25hObtaining clip from git+https://github.com/openai/CLIP.git@main#egg=clip (from -r requirements.txt (line 21))\n",
" Cloning https://github.com/openai/CLIP.git (to revision main) to ./src/clip\n",
" Running command git clone --filter=blob:none --quiet https://github.com/openai/CLIP.git /home/ubuntu/stable-diffusion/src/clip\n",
" Resolved https://github.com/openai/CLIP.git to commit d50d76daa670286dd6cacf3bcd80b5e4823fc8e1\n",
" Preparing metadata (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25hObtaining file:///home/ubuntu/stable-diffusion (from -r requirements.txt (line 22))\n",
" Preparing metadata (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25hCollecting albumentations==0.4.3\n",
" Downloading albumentations-0.4.3.tar.gz (3.2 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.2/3.2 MB\u001b[0m \u001b[31m142.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25hCollecting opencv-python==4.5.5.64\n",
" Downloading opencv_python-4.5.5.64-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (60.5 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m60.5/60.5 MB\u001b[0m \u001b[31m69.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
"\u001b[?25hCollecting pudb==2019.2\n",
" Downloading pudb-2019.2.tar.gz (59 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m59.5/59.5 kB\u001b[0m \u001b[31m21.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25hCollecting imageio==2.9.0\n",
" Downloading imageio-2.9.0-py3-none-any.whl (3.3 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.3/3.3 MB\u001b[0m \u001b[31m150.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting imageio-ffmpeg==0.4.2\n",
" Downloading imageio_ffmpeg-0.4.2-py3-none-manylinux2010_x86_64.whl (26.9 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m26.9/26.9 MB\u001b[0m \u001b[31m112.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
"\u001b[?25hCollecting pytorch-lightning==1.4.2\n",
" Downloading pytorch_lightning-1.4.2-py3-none-any.whl (916 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m916.6/916.6 kB\u001b[0m \u001b[31m129.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting omegaconf==2.1.1\n",
" Downloading omegaconf-2.1.1-py3-none-any.whl (74 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m74.7/74.7 kB\u001b[0m \u001b[31m28.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting test-tube>=0.7.5\n",
" Downloading test_tube-0.7.5.tar.gz (21 kB)\n",
" Preparing metadata (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25hCollecting streamlit>=0.73.1\n",
" Downloading streamlit-1.13.0-py2.py3-none-any.whl (9.2 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m9.2/9.2 MB\u001b[0m \u001b[31m157.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m\n",
"\u001b[?25hCollecting einops==0.3.0\n",
" Downloading einops-0.3.0-py2.py3-none-any.whl (25 kB)\n",
"Collecting torch-fidelity==0.3.0\n",
" Downloading torch_fidelity-0.3.0-py3-none-any.whl (37 kB)\n",
"Collecting transformers\n",
" Downloading transformers-4.22.2-py3-none-any.whl (4.9 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m4.9/4.9 MB\u001b[0m \u001b[31m175.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting kornia==0.6\n",
" Downloading kornia-0.6.0-py2.py3-none-any.whl (367 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m367.1/367.1 kB\u001b[0m \u001b[31m77.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting webdataset==0.2.5\n",
" Downloading webdataset-0.2.5-py3-none-any.whl (46 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m46.9/46.9 kB\u001b[0m \u001b[31m17.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting torchmetrics==0.6.0\n",
" Downloading torchmetrics-0.6.0-py3-none-any.whl (329 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m329.4/329.4 kB\u001b[0m \u001b[31m85.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting fire==0.4.0\n",
" Downloading fire-0.4.0.tar.gz (87 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m87.7/87.7 kB\u001b[0m \u001b[31m33.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25hCollecting gradio==3.1.4\n",
" Downloading gradio-3.1.4-py3-none-any.whl (5.6 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.6/5.6 MB\u001b[0m \u001b[31m153.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m\n",
"\u001b[?25hCollecting diffusers==0.3.0\n",
" Downloading diffusers-0.3.0-py3-none-any.whl (153 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m153.9/153.9 kB\u001b[0m \u001b[31m53.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting datasets[vision]==2.4.0\n",
" Downloading datasets-2.4.0-py3-none-any.whl (365 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m365.7/365.7 kB\u001b[0m \u001b[31m97.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: PyYAML in /usr/lib/python3/dist-packages (from albumentations==0.4.3->-r requirements.txt (line 1)) (5.3.1)\n",
"Collecting imgaug<0.2.7,>=0.2.5\n",
" Downloading imgaug-0.2.6.tar.gz (631 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m631.4/631.4 kB\u001b[0m \u001b[31m116.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25hRequirement already satisfied: numpy>=1.11.1 in /home/ubuntu/.local/lib/python3.8/site-packages (from albumentations==0.4.3->-r requirements.txt (line 1)) (1.23.2)\n",
"Collecting opencv-python-headless>=4.1.1\n",
" Downloading opencv_python_headless-4.6.0.66-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (48.3 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m48.3/48.3 MB\u001b[0m \u001b[31m80.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: scipy in /home/ubuntu/.local/lib/python3.8/site-packages (from albumentations==0.4.3->-r requirements.txt (line 1)) (1.9.1)\n",
"Requirement already satisfied: pygments>=1.0 in /home/ubuntu/.local/lib/python3.8/site-packages (from pudb==2019.2->-r requirements.txt (line 3)) (2.13.0)\n",
"Collecting urwid>=1.1.1\n",
" Downloading urwid-2.1.2.tar.gz (634 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m634.6/634.6 kB\u001b[0m \u001b[31m111.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25hRequirement already satisfied: pillow in /usr/lib/python3/dist-packages (from imageio==2.9.0->-r requirements.txt (line 4)) (7.0.0)\n",
"Requirement already satisfied: tqdm>=4.41.0 in /home/ubuntu/.local/lib/python3.8/site-packages (from pytorch-lightning==1.4.2->-r requirements.txt (line 6)) (4.64.1)\n",
"Requirement already satisfied: future>=0.17.1 in /usr/lib/python3/dist-packages (from pytorch-lightning==1.4.2->-r requirements.txt (line 6)) (0.18.2)\n",
"Requirement already satisfied: tensorboard>=2.2.0 in /usr/lib/python3/dist-packages (from pytorch-lightning==1.4.2->-r requirements.txt (line 6)) (2.9.1)\n",
"Requirement already satisfied: torch>=1.6 in /usr/lib/python3/dist-packages (from pytorch-lightning==1.4.2->-r requirements.txt (line 6)) (1.11.0)\n",
"Collecting fsspec[http]!=2021.06.0,>=2021.05.0\n",
" Downloading fsspec-2022.8.2-py3-none-any.whl (140 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m140.8/140.8 kB\u001b[0m \u001b[31m49.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: typing-extensions in /home/ubuntu/.local/lib/python3.8/site-packages (from pytorch-lightning==1.4.2->-r requirements.txt (line 6)) (4.3.0)\n",
"Collecting pyDeprecate==0.3.1\n",
" Downloading pyDeprecate-0.3.1-py3-none-any.whl (10 kB)\n",
"Requirement already satisfied: packaging>=17.0 in /home/ubuntu/.local/lib/python3.8/site-packages (from pytorch-lightning==1.4.2->-r requirements.txt (line 6)) (21.3)\n",
"Collecting antlr4-python3-runtime==4.8\n",
" Downloading antlr4-python3-runtime-4.8.tar.gz (112 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m112.4/112.4 kB\u001b[0m \u001b[31m42.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25hRequirement already satisfied: torchvision in /usr/lib/python3/dist-packages (from torch-fidelity==0.3.0->-r requirements.txt (line 11)) (0.12.0)\n",
"Collecting braceexpand\n",
" Downloading braceexpand-0.1.7-py2.py3-none-any.whl (5.9 kB)\n",
"Requirement already satisfied: six in /usr/lib/python3/dist-packages (from fire==0.4.0->-r requirements.txt (line 16)) (1.14.0)\n",
"Requirement already satisfied: termcolor in /usr/lib/python3/dist-packages (from fire==0.4.0->-r requirements.txt (line 16)) (1.1.0)\n",
"Collecting uvicorn\n",
" Downloading uvicorn-0.18.3-py3-none-any.whl (57 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m57.4/57.4 kB\u001b[0m \u001b[31m21.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting fastapi\n",
" Downloading fastapi-0.85.0-py3-none-any.whl (55 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m55.3/55.3 kB\u001b[0m \u001b[31m18.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting httpx\n",
" Downloading httpx-0.23.0-py3-none-any.whl (84 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m84.8/84.8 kB\u001b[0m \u001b[31m33.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting python-multipart\n",
" Downloading python-multipart-0.0.5.tar.gz (32 kB)\n",
" Preparing metadata (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25hCollecting pycryptodome\n",
" Downloading pycryptodome-3.15.0-cp35-abi3-manylinux2010_x86_64.whl (2.3 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.3/2.3 MB\u001b[0m \u001b[31m146.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting paramiko\n",
" Downloading paramiko-2.11.0-py2.py3-none-any.whl (212 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m212.9/212.9 kB\u001b[0m \u001b[31m66.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting ffmpy\n",
" Downloading ffmpy-0.3.0.tar.gz (4.8 kB)\n",
" Preparing metadata (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25hCollecting analytics-python\n",
" Downloading analytics_python-1.4.0-py2.py3-none-any.whl (15 kB)\n",
"Collecting markdown-it-py[linkify,plugins]\n",
" Downloading markdown_it_py-2.1.0-py3-none-any.whl (84 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m84.5/84.5 kB\u001b[0m \u001b[31m29.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: pandas in /home/ubuntu/.local/lib/python3.8/site-packages (from gradio==3.1.4->-r requirements.txt (line 17)) (1.4.4)\n",
"Collecting pydub\n",
" Downloading pydub-0.25.1-py2.py3-none-any.whl (32 kB)\n",
"Requirement already satisfied: Jinja2 in /home/ubuntu/.local/lib/python3.8/site-packages (from gradio==3.1.4->-r requirements.txt (line 17)) (3.1.2)\n",
"Requirement already satisfied: fsspec in /usr/lib/python3/dist-packages (from gradio==3.1.4->-r requirements.txt (line 17)) (0.6.1)\n",
"Collecting orjson\n",
" Downloading orjson-3.8.0-cp38-cp38-manylinux_2_28_x86_64.whl (145 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m145.9/145.9 kB\u001b[0m \u001b[31m48.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting aiohttp\n",
" Downloading aiohttp-3.8.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.0/1.0 MB\u001b[0m \u001b[31m126.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: matplotlib in /home/ubuntu/.local/lib/python3.8/site-packages (from gradio==3.1.4->-r requirements.txt (line 17)) (3.5.3)\n",
"Requirement already satisfied: requests in /home/ubuntu/.local/lib/python3.8/site-packages (from gradio==3.1.4->-r requirements.txt (line 17)) (2.28.1)\n",
"Requirement already satisfied: pydantic in /home/ubuntu/.local/lib/python3.8/site-packages (from gradio==3.1.4->-r requirements.txt (line 17)) (1.9.2)\n",
"Collecting h11<0.13,>=0.11\n",
" Downloading h11-0.12.0-py3-none-any.whl (54 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m54.9/54.9 kB\u001b[0m \u001b[31m20.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting huggingface-hub>=0.8.1\n",
" Downloading huggingface_hub-0.10.0-py3-none-any.whl (163 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m163.5/163.5 kB\u001b[0m \u001b[31m53.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: importlib-metadata in /home/ubuntu/.local/lib/python3.8/site-packages (from diffusers==0.3.0->-r requirements.txt (line 18)) (4.12.0)\n",
"Requirement already satisfied: filelock in /usr/lib/python3/dist-packages (from diffusers==0.3.0->-r requirements.txt (line 18)) (3.0.12)\n",
"Collecting regex!=2019.12.17\n",
" Downloading regex-2022.9.13-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (772 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m772.3/772.3 kB\u001b[0m \u001b[31m115.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting dill<0.3.6\n",
" Downloading dill-0.3.5.1-py2.py3-none-any.whl (95 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m95.8/95.8 kB\u001b[0m \u001b[31m36.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting xxhash\n",
" Downloading xxhash-3.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (212 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m212.1/212.1 kB\u001b[0m \u001b[31m64.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting pyarrow>=6.0.0\n",
" Downloading pyarrow-9.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (35.3 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m35.3/35.3 MB\u001b[0m \u001b[31m95.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
"\u001b[?25hCollecting responses<0.19\n",
" Downloading responses-0.18.0-py3-none-any.whl (38 kB)\n",
"Collecting multiprocess\n",
" Downloading multiprocess-0.70.13-py38-none-any.whl (131 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m131.4/131.4 kB\u001b[0m \u001b[31m46.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting semver\n",
" Downloading semver-2.13.0-py2.py3-none-any.whl (12 kB)\n",
"Collecting tzlocal>=1.1\n",
" Downloading tzlocal-4.2-py3-none-any.whl (19 kB)\n",
"Collecting pydeck>=0.1.dev5\n",
" Downloading pydeck-0.8.0b3-py2.py3-none-any.whl (4.7 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m4.7/4.7 MB\u001b[0m \u001b[31m165.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting altair>=3.2.0\n",
" Downloading altair-4.2.0-py3-none-any.whl (812 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m812.8/812.8 kB\u001b[0m \u001b[31m120.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting toml\n",
" Downloading toml-0.10.2-py2.py3-none-any.whl (16 kB)\n",
"Requirement already satisfied: python-dateutil in /home/ubuntu/.local/lib/python3.8/site-packages (from streamlit>=0.73.1->-r requirements.txt (line 9)) (2.8.2)\n",
"Collecting gitpython!=3.1.19\n",
" Downloading GitPython-3.1.28-py3-none-any.whl (182 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m182.5/182.5 kB\u001b[0m \u001b[31m56.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting pympler>=0.9\n",
" Downloading Pympler-1.0.1-py3-none-any.whl (164 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m164.8/164.8 kB\u001b[0m \u001b[31m52.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: tornado>=5.0 in /home/ubuntu/.local/lib/python3.8/site-packages (from streamlit>=0.73.1->-r requirements.txt (line 9)) (6.2)\n",
"Requirement already satisfied: click>=7.0 in /usr/lib/python3/dist-packages (from streamlit>=0.73.1->-r requirements.txt (line 9)) (7.0)\n",
"Collecting watchdog\n",
" Downloading watchdog-2.1.9-py3-none-manylinux2014_x86_64.whl (78 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m78.4/78.4 kB\u001b[0m \u001b[31m30.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: cachetools>=4.0 in /usr/lib/python3/dist-packages (from streamlit>=0.73.1->-r requirements.txt (line 9)) (4.0.0)\n",
"Collecting rich>=10.11.0\n",
" Downloading rich-12.6.0-py3-none-any.whl (237 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m237.5/237.5 kB\u001b[0m \u001b[31m69.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting validators>=0.2\n",
" Downloading validators-0.20.0.tar.gz (30 kB)\n",
" Preparing metadata (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25hRequirement already satisfied: blinker>=1.0.0 in /usr/lib/python3/dist-packages (from streamlit>=0.73.1->-r requirements.txt (line 9)) (1.4)\n",
"Collecting protobuf!=3.20.2,<4,>=3.12\n",
" Downloading protobuf-3.20.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.0/1.0 MB\u001b[0m \u001b[31m127.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting tokenizers!=0.11.3,<0.13,>=0.11.1\n",
" Downloading tokenizers-0.12.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (6.6 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m6.6/6.6 MB\u001b[0m \u001b[31m161.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m\n",
"\u001b[?25hCollecting ftfy\n",
" Downloading ftfy-6.1.1-py3-none-any.whl (53 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m53.1/53.1 kB\u001b[0m \u001b[31m20.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: toolz in /usr/lib/python3/dist-packages (from altair>=3.2.0->streamlit>=0.73.1->-r requirements.txt (line 9)) (0.9.0)\n",
"Requirement already satisfied: jsonschema>=3.0 in /usr/lib/python3/dist-packages (from altair>=3.2.0->streamlit>=0.73.1->-r requirements.txt (line 9)) (3.2.0)\n",
"Requirement already satisfied: entrypoints in /usr/lib/python3/dist-packages (from altair>=3.2.0->streamlit>=0.73.1->-r requirements.txt (line 9)) (0.3)\n",
"Collecting async-timeout<5.0,>=4.0.0a3\n",
" Downloading async_timeout-4.0.2-py3-none-any.whl (5.8 kB)\n",
"Collecting yarl<2.0,>=1.0\n",
" Downloading yarl-1.8.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (262 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m262.1/262.1 kB\u001b[0m \u001b[31m74.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting frozenlist>=1.1.1\n",
" Downloading frozenlist-1.3.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (161 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m161.3/161.3 kB\u001b[0m \u001b[31m57.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: attrs>=17.3.0 in /usr/lib/python3/dist-packages (from aiohttp->gradio==3.1.4->-r requirements.txt (line 17)) (19.3.0)\n",
"Collecting aiosignal>=1.1.2\n",
" Downloading aiosignal-1.2.0-py3-none-any.whl (8.2 kB)\n",
"Collecting multidict<7.0,>=4.5\n",
" Downloading multidict-6.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (121 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m121.3/121.3 kB\u001b[0m \u001b[31m41.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: charset-normalizer<3.0,>=2.0 in /home/ubuntu/.local/lib/python3.8/site-packages (from aiohttp->gradio==3.1.4->-r requirements.txt (line 17)) (2.1.1)\n",
"Collecting gitdb<5,>=4.0.1\n",
" Downloading gitdb-4.0.9-py3-none-any.whl (63 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m63.1/63.1 kB\u001b[0m \u001b[31m25.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: scikit-image>=0.11.0 in /usr/lib/python3/dist-packages (from imgaug<0.2.7,>=0.2.5->albumentations==0.4.3->-r requirements.txt (line 1)) (0.16.2)\n",
"Requirement already satisfied: zipp>=0.5 in /usr/lib/python3/dist-packages (from importlib-metadata->diffusers==0.3.0->-r requirements.txt (line 18)) (1.0.0)\n",
"Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/lib/python3/dist-packages (from packaging>=17.0->pytorch-lightning==1.4.2->-r requirements.txt (line 6)) (2.4.6)\n",
"Requirement already satisfied: pytz>=2020.1 in /home/ubuntu/.local/lib/python3.8/site-packages (from pandas->gradio==3.1.4->-r requirements.txt (line 17)) (2022.2.1)\n",
"Requirement already satisfied: MarkupSafe>=2.0 in /home/ubuntu/.local/lib/python3.8/site-packages (from Jinja2->gradio==3.1.4->-r requirements.txt (line 17)) (2.1.1)\n",
"Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/lib/python3/dist-packages (from requests->gradio==3.1.4->-r requirements.txt (line 17)) (1.25.8)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests->gradio==3.1.4->-r requirements.txt (line 17)) (2019.11.28)\n",
"Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests->gradio==3.1.4->-r requirements.txt (line 17)) (2.8)\n",
"Collecting urllib3<1.27,>=1.21.1\n",
" Downloading urllib3-1.26.12-py2.py3-none-any.whl (140 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m140.4/140.4 kB\u001b[0m \u001b[31m52.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting commonmark<0.10.0,>=0.9.0\n",
" Downloading commonmark-0.9.1-py2.py3-none-any.whl (51 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m51.1/51.1 kB\u001b[0m \u001b[31m20.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting pytz-deprecation-shim\n",
" Downloading pytz_deprecation_shim-0.1.0.post0-py2.py3-none-any.whl (15 kB)\n",
"Collecting backports.zoneinfo\n",
" Downloading backports.zoneinfo-0.2.1-cp38-cp38-manylinux1_x86_64.whl (74 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m74.0/74.0 kB\u001b[0m \u001b[31m29.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: decorator>=3.4.0 in /usr/lib/python3/dist-packages (from validators>=0.2->streamlit>=0.73.1->-r requirements.txt (line 9)) (4.4.2)\n",
"Collecting monotonic>=1.5\n",
" Downloading monotonic-1.6-py2.py3-none-any.whl (8.2 kB)\n",
"Collecting backoff==1.10.0\n",
" Downloading backoff-1.10.0-py2.py3-none-any.whl (31 kB)\n",
"Collecting starlette==0.20.4\n",
" Downloading starlette-0.20.4-py3-none-any.whl (63 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m63.6/63.6 kB\u001b[0m \u001b[31m25.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: anyio<5,>=3.4.0 in /home/ubuntu/.local/lib/python3.8/site-packages (from starlette==0.20.4->fastapi->gradio==3.1.4->-r requirements.txt (line 17)) (3.6.1)\n",
"Collecting wcwidth>=0.2.5\n",
" Downloading wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)\n",
"Requirement already satisfied: sniffio in /home/ubuntu/.local/lib/python3.8/site-packages (from httpx->gradio==3.1.4->-r requirements.txt (line 17)) (1.3.0)\n",
"Collecting httpcore<0.16.0,>=0.15.0\n",
" Downloading httpcore-0.15.0-py3-none-any.whl (68 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m68.4/68.4 kB\u001b[0m \u001b[31m27.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting rfc3986[idna2008]<2,>=1.3\n",
" Downloading rfc3986-1.5.0-py2.py3-none-any.whl (31 kB)\n",
"Collecting mdurl~=0.1\n",
" Downloading mdurl-0.1.2-py3-none-any.whl (10.0 kB)\n",
"Collecting linkify-it-py~=1.0\n",
" Downloading linkify_it_py-1.0.3-py3-none-any.whl (19 kB)\n",
"Collecting mdit-py-plugins\n",
" Downloading mdit_py_plugins-0.3.1-py3-none-any.whl (46 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m46.5/46.5 kB\u001b[0m \u001b[31m21.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: fonttools>=4.22.0 in /home/ubuntu/.local/lib/python3.8/site-packages (from matplotlib->gradio==3.1.4->-r requirements.txt (line 17)) (4.37.1)\n",
"Requirement already satisfied: cycler>=0.10 in /usr/lib/python3/dist-packages (from matplotlib->gradio==3.1.4->-r requirements.txt (line 17)) (0.10.0)\n",
"Requirement already satisfied: kiwisolver>=1.0.1 in /usr/lib/python3/dist-packages (from matplotlib->gradio==3.1.4->-r requirements.txt (line 17)) (1.0.1)\n",
"Requirement already satisfied: pynacl>=1.0.1 in /usr/lib/python3/dist-packages (from paramiko->gradio==3.1.4->-r requirements.txt (line 17)) (1.3.0)\n",
"Requirement already satisfied: cryptography>=2.5 in /usr/lib/python3/dist-packages (from paramiko->gradio==3.1.4->-r requirements.txt (line 17)) (2.8)\n",
"Collecting bcrypt>=3.1.3\n",
" Downloading bcrypt-4.0.0-cp36-abi3-manylinux_2_28_x86_64.whl (594 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m594.4/594.4 kB\u001b[0m \u001b[31m110.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting smmap<6,>=3.0.1\n",
" Downloading smmap-5.0.0-py3-none-any.whl (24 kB)\n",
"Collecting uc-micro-py\n",
" Downloading uc_micro_py-1.0.1-py3-none-any.whl (6.2 kB)\n",
"Collecting tzdata\n",
" Downloading tzdata-2022.4-py2.py3-none-any.whl (336 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m336.7/336.7 kB\u001b[0m \u001b[31m89.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hBuilding wheels for collected packages: albumentations, pudb, fire, antlr4-python3-runtime, test-tube, imgaug, urwid, validators, ffmpy, python-multipart\n",
" Building wheel for albumentations (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25h Created wheel for albumentations: filename=albumentations-0.4.3-py3-none-any.whl size=60766 sha256=05eadca09805575f3074ec44f877ba2879dcd3e6da2704396d8a47032fc14ec8\n",
" Stored in directory: /home/ubuntu/.cache/pip/wheels/a0/37/4e/0bd417ba6a58f73329b825623d8c949e8e4ac2cdbd252b786d\n",
" Building wheel for pudb (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25h Created wheel for pudb: filename=pudb-2019.2-py3-none-any.whl size=63230 sha256=9ca404433ce8115d7d129aa2d81f91488890a78900d6b61012d80c1a45040a10\n",
" Stored in directory: /home/ubuntu/.cache/pip/wheels/48/83/f1/d8a09d401e2512bfda01ac9fc1b334885f9ddf51617c1c49f1\n",
" Building wheel for fire (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25h Created wheel for fire: filename=fire-0.4.0-py2.py3-none-any.whl size=115925 sha256=2d8fe917d7538e2606619c759f146da90a339d4ddae68133d836c34179a99e3f\n",
" Stored in directory: /home/ubuntu/.cache/pip/wheels/1f/10/06/2a990ee4d73a8479fe2922445e8a876d38cfbfed052284c6a1\n",
" Building wheel for antlr4-python3-runtime (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25h Created wheel for antlr4-python3-runtime: filename=antlr4_python3_runtime-4.8-py3-none-any.whl size=141230 sha256=b99f1dfd4d32e815c712ea6aae7b22f9111e3bcd259682fe9af85352c3255528\n",
" Stored in directory: /home/ubuntu/.cache/pip/wheels/c8/d0/ab/d43c02eaddc5b9004db86950802442ad9a26f279c619e28da0\n",
" Building wheel for test-tube (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25h Created wheel for test-tube: filename=test_tube-0.7.5-py3-none-any.whl size=25358 sha256=393e571100e363b2a62ec66009dcb1598e247bbb96e1bec64864272f3f19c4eb\n",
" Stored in directory: /home/ubuntu/.cache/pip/wheels/95/b0/3a/00ea66dbb0d9ce470ce1bdcb854a6fa030c279c316cb27ca9e\n",
" Building wheel for imgaug (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25h Created wheel for imgaug: filename=imgaug-0.2.6-py3-none-any.whl size=654018 sha256=73dea8c357648a92587178629acbbe4fcd8fe896308f878a5f402c5bfde2171b\n",
" Stored in directory: /home/ubuntu/.cache/pip/wheels/41/23/e8/b1016c275f713978d312621da3c4f55920ec4297798aba8a5a\n",
" Building wheel for urwid (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25h Created wheel for urwid: filename=urwid-2.1.2-cp38-cp38-linux_x86_64.whl size=259151 sha256=1dc46a35bdabf9cbaeb34bda8f062e82235b0fb9c9e540f2b9913c5becccb81c\n",
" Stored in directory: /home/ubuntu/.cache/pip/wheels/28/71/e4/38b5d81438105d0e3db5016cf2eea6fa796d89d96a04451d4d\n",
" Building wheel for validators (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25h Created wheel for validators: filename=validators-0.20.0-py3-none-any.whl size=19565 sha256=ce8b7264206c377ed61a5137f9478235b238b5eef59f2d9d3d57f465081c718e\n",
" Stored in directory: /home/ubuntu/.cache/pip/wheels/19/09/72/3eb74d236bb48bd0f3c6c3c83e4e0c5bbfcbcad7c6c3539db8\n",
" Building wheel for ffmpy (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25h Created wheel for ffmpy: filename=ffmpy-0.3.0-py3-none-any.whl size=4709 sha256=9ba5c4d9c1060bdf85262d3b1f0b5f642fee4561b75d8cd791fd81b560e5820b\n",
" Stored in directory: /home/ubuntu/.cache/pip/wheels/ff/5b/59/913b443e7369dc04b61f607a746b6f7d83fb65e2e19fcc958d\n",
" Building wheel for python-multipart (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25h Created wheel for python-multipart: filename=python_multipart-0.0.5-py3-none-any.whl size=31669 sha256=697dd66bbef6fe75521d762322eca5730884ea9ccd9648fef2cd4f83470c2ba9\n",
" Stored in directory: /home/ubuntu/.cache/pip/wheels/9e/fc/1c/cf980e6413d3ee8e70cd8f39e2366b0f487e3e221aeb452eb0\n",
"Successfully built albumentations pudb fire antlr4-python3-runtime test-tube imgaug urwid validators ffmpy python-multipart\n",
"Installing collected packages: wcwidth, urwid, tokenizers, rfc3986, pydub, monotonic, ffmpy, einops, commonmark, braceexpand, antlr4-python3-runtime, xxhash, webdataset, watchdog, validators, urllib3, uc-micro-py, tzdata, toml, taming-transformers, smmap, semver, rich, regex, python-multipart, pympler, pyDeprecate, pycryptodome, pyarrow, pudb, protobuf, orjson, opencv-python-headless, opencv-python, omegaconf, multidict, mdurl, latent-diffusion, imageio-ffmpeg, imageio, h11, ftfy, fsspec, frozenlist, fire, dill, bcrypt, backports.zoneinfo, backoff, async-timeout, yarl, uvicorn, torchmetrics, torch-fidelity, starlette, pytz-deprecation-shim, pydeck, paramiko, multiprocess, markdown-it-py, linkify-it-py, kornia, imgaug, httpcore, gitdb, clip, aiosignal, tzlocal, test-tube, responses, mdit-py-plugins, huggingface-hub, httpx, gitpython, fastapi, analytics-python, altair, albumentations, aiohttp, transformers, streamlit, diffusers, pytorch-lightning, gradio, datasets\n",
" Running setup.py develop for taming-transformers\n",
" Running setup.py develop for latent-diffusion\n",
" Running setup.py develop for clip\n",
"Successfully installed aiohttp-3.8.3 aiosignal-1.2.0 albumentations-0.4.3 altair-4.2.0 analytics-python-1.4.0 antlr4-python3-runtime-4.8 async-timeout-4.0.2 backoff-1.10.0 backports.zoneinfo-0.2.1 bcrypt-4.0.0 braceexpand-0.1.7 clip commonmark-0.9.1 datasets-2.4.0 diffusers-0.3.0 dill-0.3.5.1 einops-0.3.0 fastapi-0.85.0 ffmpy-0.3.0 fire-0.4.0 frozenlist-1.3.1 fsspec-2022.8.2 ftfy-6.1.1 gitdb-4.0.9 gitpython-3.1.28 gradio-3.1.4 h11-0.12.0 httpcore-0.15.0 httpx-0.23.0 huggingface-hub-0.10.0 imageio-2.9.0 imageio-ffmpeg-0.4.2 imgaug-0.2.6 kornia-0.6.0 latent-diffusion linkify-it-py-1.0.3 markdown-it-py-2.1.0 mdit-py-plugins-0.3.1 mdurl-0.1.2 monotonic-1.6 multidict-6.0.2 multiprocess-0.70.13 omegaconf-2.1.1 opencv-python-4.5.5.64 opencv-python-headless-4.6.0.66 orjson-3.8.0 paramiko-2.11.0 protobuf-3.20.3 pudb-2019.2 pyDeprecate-0.3.1 pyarrow-9.0.0 pycryptodome-3.15.0 pydeck-0.8.0b3 pydub-0.25.1 pympler-1.0.1 python-multipart-0.0.5 pytorch-lightning-1.4.2 pytz-deprecation-shim-0.1.0.post0 regex-2022.9.13 responses-0.18.0 rfc3986-1.5.0 rich-12.6.0 semver-2.13.0 smmap-5.0.0 starlette-0.20.4 streamlit-1.13.0 taming-transformers test-tube-0.7.5 tokenizers-0.12.1 toml-0.10.2 torch-fidelity-0.3.0 torchmetrics-0.6.0 transformers-4.22.2 tzdata-2022.4 tzlocal-4.2 uc-micro-py-1.0.1 urllib3-1.26.12 urwid-2.1.2 uvicorn-0.18.3 validators-0.20.0 watchdog-2.1.9 wcwidth-0.2.5 webdataset-0.2.5 xxhash-3.0.0 yarl-1.8.1\n",
"Defaulting to user installation because normal site-packages is not writeable\n",
"Requirement already satisfied: keras in /usr/lib/python3/dist-packages (2.9.0)\n",
"Collecting keras\n",
" Downloading keras-2.10.0-py2.py3-none-any.whl (1.7 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.7/1.7 MB\u001b[0m \u001b[31m113.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hInstalling collected packages: keras\n",
"Successfully installed keras-2.10.0\n"
]
}
],
"source": [
"!git clone https://github.com/justinpinkney/stable-diffusion.git\n",
"%cd stable-diffusion\n",
"!pip install --upgrade pip\n",
"!pip install -r requirements.txt\n",
"\n",
"!pip install --upgrade keras # on lambda stack we need to upgrade keras\n",
"#!pip uninstall -y torchtext # on colab we need to remove torchtext"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"id": "m1AkWL270DSE"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Fri Oct 7 07:47:59 2022 \n",
"+-----------------------------------------------------------------------------+\n",
"| NVIDIA-SMI 510.47.03 Driver Version: 510.47.03 CUDA Version: 11.6 |\n",
"|-------------------------------+----------------------+----------------------+\n",
"| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |\n",
"| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |\n",
"| | | MIG M. |\n",
"|===============================+======================+======================|\n",
"| 0 NVIDIA A100-SXM... On | 00000000:06:00.0 Off | 0 |\n",
"| N/A 33C P0 46W / 400W | 0MiB / 40960MiB | 0% Default |\n",
"| | | Disabled |\n",
"+-------------------------------+----------------------+----------------------+\n",
" \n",
"+-----------------------------------------------------------------------------+\n",
"| Processes: |\n",
"| GPU GI CI PID Type Process name GPU Memory |\n",
"| ID ID Usage |\n",
"|=============================================================================|\n",
"| No running processes found |\n",
"+-----------------------------------------------------------------------------+\n"
]
}
],
"source": [
"!nvidia-smi"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"id": "FTf_OdfEz8kI"
},
"outputs": [
{
"ename": "NotImplementedError",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mNotImplementedError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-8-df3cd5287312>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0mds\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mParisDataset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"../VLoD/\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m512\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m512\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 10\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 11\u001b[0;31m \u001b[0msample\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mds\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m/usr/lib/python3/dist-packages/torch/utils/data/dataset.py\u001b[0m in \u001b[0;36m__getitem__\u001b[0;34m(self, index)\u001b[0m\n\u001b[1;32m 66\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 67\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__getitem__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mindex\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mT_co\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 68\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mNotImplementedError\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 69\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 70\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__add__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mother\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'Dataset[T_co]'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0;34m'ConcatDataset[T_co]'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mNotImplementedError\u001b[0m: "
]
}
],
"source": [
"# Check the dataset\n",
"# from datasets import load_dataset\n",
"# ds = load_dataset(\"lambdalabs/pokemon-blip-captions\", split=\"train\")\n",
"# sample = ds[0]\n",
"# display(sample[\"image\"].resize((256, 256)))\n",
"# print(sample[\"text\"])\n",
"from paris_dataloader import ParisDataset\n",
"\n",
"ds = ParisDataset(\"../VLoD/\", 512, 512, None, [])\n",
"\n",
"# sample = ds[0]"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "5V1uUVjQz8kI"
},
"source": [
"To get the weights you need to you'll need to [go to the model card](https://huggingface.co/CompVis/stable-diffusion-v1-4-original), read the license and tick the checkbox if you agree."
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"id": "PbMtzkytz8kI"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Defaulting to user installation because normal site-packages is not writeable\n",
"Requirement already satisfied: huggingface_hub in /home/ubuntu/.local/lib/python3.8/site-packages (0.10.0)\n",
"Requirement already satisfied: packaging>=20.9 in /home/ubuntu/.local/lib/python3.8/site-packages (from huggingface_hub) (21.3)\n",
"Requirement already satisfied: typing-extensions>=3.7.4.3 in /home/ubuntu/.local/lib/python3.8/site-packages (from huggingface_hub) (4.3.0)\n",
"Requirement already satisfied: requests in /home/ubuntu/.local/lib/python3.8/site-packages (from huggingface_hub) (2.28.1)\n",
"Requirement already satisfied: pyyaml>=5.1 in /usr/lib/python3/dist-packages (from huggingface_hub) (5.3.1)\n",
"Requirement already satisfied: tqdm in /home/ubuntu/.local/lib/python3.8/site-packages (from huggingface_hub) (4.64.1)\n",
"Requirement already satisfied: filelock in /usr/lib/python3/dist-packages (from huggingface_hub) (3.0.12)\n",
"Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/lib/python3/dist-packages (from packaging>=20.9->huggingface_hub) (2.4.6)\n",
"Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/ubuntu/.local/lib/python3.8/site-packages (from requests->huggingface_hub) (1.26.12)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests->huggingface_hub) (2019.11.28)\n",
"Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests->huggingface_hub) (2.8)\n",
"Requirement already satisfied: charset-normalizer<3,>=2 in /home/ubuntu/.local/lib/python3.8/site-packages (from requests->huggingface_hub) (2.1.1)\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d9f0de6955b64459b64cd3a1dc9e6c0b",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"VBox(children=(HTML(value='<center> <img\\nsrc=https://huggingface.co/front/assets/huggingface_logo-noborder.sv…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"!pip install huggingface_hub\n",
"from huggingface_hub import notebook_login\n",
"\n",
"notebook_login()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"id": "vnnbNNycz8kI"
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "a817e5f3ef0d40eeb9c919870e2d26c4",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Downloading: 0%| | 0.00/7.70G [00:00<?, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from huggingface_hub import hf_hub_download\n",
"ckpt_path = hf_hub_download(repo_id=\"CompVis/stable-diffusion-v-1-4-original\", filename=\"sd-v1-4-full-ema.ckpt\", use_auth_token=True)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'/home/ubuntu/.cache/huggingface/hub/models--CompVis--stable-diffusion-v-1-4-original/snapshots/0834a76f88354683d3f7ef271cadd28f4757a8cc/sd-v1-4-full-ema.ckpt'"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ckpt_path"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "y8VDyuQxz8kJ"
},
"source": [
"Set your parameters below depending on your GPU setup, the settings below were used for training on a 2xA6000 machine, (the A6000 has 48GB of VRAM). On this set up good results are achieved in around 6 hours.\n",
"\n",
"You can make up for using smaller batches or fewer gpus by accumulating batches:\n",
"\n",
"`total batch size = batach size * n gpus * accumulate batches`"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {
"id": "WVssEQJfz8kJ"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Using GPUs: 0,\n"
]
}
],
"source": [
"# 2xA6000:\n",
"BATCH_SIZE = 2\n",
"N_GPUS = 1\n",
"ACCUMULATE_BATCHES = 1\n",
"\n",
"gpu_list = \",\".join((str(x) for x in range(N_GPUS))) + \",\"\n",
"print(f\"Using GPUs: {gpu_list}\")"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"id": "w7sLO53fz8kJ"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The cache for model files in Transformers v4.22.0 has been updated. Migrating your old cache. This is a one-time only operation. You can interrupt this and resume the migration later on by calling `transformers.utils.move_cache()`.\n",
"Moving 0 files to the new cache system\n",
"0it [00:00, ?it/s]\n",
"usage: main.py [-h] [--finetune_from [FINETUNE_FROM]] [-n [NAME]]\n",
" [-r [RESUME]] [-b [base_config.yaml [base_config.yaml ...]]]\n",
" [-t [TRAIN]] [--no-test [NO_TEST]] [-p PROJECT] [-d [DEBUG]]\n",
" [-s SEED] [-f POSTFIX] [-l LOGDIR] [--scale_lr [SCALE_LR]]\n",
" [--logger [LOGGER]]\n",
" [--checkpoint_callback [CHECKPOINT_CALLBACK]]\n",
" [--default_root_dir DEFAULT_ROOT_DIR]\n",
" [--gradient_clip_val GRADIENT_CLIP_VAL]\n",
" [--gradient_clip_algorithm GRADIENT_CLIP_ALGORITHM]\n",
" [--process_position PROCESS_POSITION] [--num_nodes NUM_NODES]\n",
" [--num_processes NUM_PROCESSES] [--devices DEVICES]\n",
" [--gpus GPUS] [--auto_select_gpus [AUTO_SELECT_GPUS]]\n",
" [--tpu_cores TPU_CORES] [--ipus IPUS]\n",
" [--log_gpu_memory LOG_GPU_MEMORY]\n",
" [--progress_bar_refresh_rate PROGRESS_BAR_REFRESH_RATE]\n",
" [--overfit_batches OVERFIT_BATCHES]\n",
" [--track_grad_norm TRACK_GRAD_NORM]\n",
" [--check_val_every_n_epoch CHECK_VAL_EVERY_N_EPOCH]\n",
" [--fast_dev_run [FAST_DEV_RUN]]\n",
" [--accumulate_grad_batches ACCUMULATE_GRAD_BATCHES]\n",
" [--max_epochs MAX_EPOCHS] [--min_epochs MIN_EPOCHS]\n",
" [--max_steps MAX_STEPS] [--min_steps MIN_STEPS]\n",
" [--max_time MAX_TIME]\n",
" [--limit_train_batches LIMIT_TRAIN_BATCHES]\n",
" [--limit_val_batches LIMIT_VAL_BATCHES]\n",
" [--limit_test_batches LIMIT_TEST_BATCHES]\n",
" [--limit_predict_batches LIMIT_PREDICT_BATCHES]\n",
" [--val_check_interval VAL_CHECK_INTERVAL]\n",
" [--flush_logs_every_n_steps FLUSH_LOGS_EVERY_N_STEPS]\n",
" [--log_every_n_steps LOG_EVERY_N_STEPS]\n",
" [--accelerator ACCELERATOR] [--sync_batchnorm [SYNC_BATCHNORM]]\n",
" [--precision PRECISION] [--weights_summary WEIGHTS_SUMMARY]\n",
" [--weights_save_path WEIGHTS_SAVE_PATH]\n",
" [--num_sanity_val_steps NUM_SANITY_VAL_STEPS]\n",
" [--truncated_bptt_steps TRUNCATED_BPTT_STEPS]\n",
" [--resume_from_checkpoint RESUME_FROM_CHECKPOINT]\n",
" [--profiler PROFILER] [--benchmark [BENCHMARK]]\n",
" [--deterministic [DETERMINISTIC]]\n",
" [--reload_dataloaders_every_n_epochs RELOAD_DATALOADERS_EVERY_N_EPOCHS]\n",
" [--reload_dataloaders_every_epoch [RELOAD_DATALOADERS_EVERY_EPOCH]]\n",
" [--auto_lr_find [AUTO_LR_FIND]]\n",
" [--replace_sampler_ddp [REPLACE_SAMPLER_DDP]]\n",
" [--terminate_on_nan [TERMINATE_ON_NAN]]\n",
" [--auto_scale_batch_size [AUTO_SCALE_BATCH_SIZE]]\n",
" [--prepare_data_per_node [PREPARE_DATA_PER_NODE]]\n",
" [--plugins PLUGINS] [--amp_backend AMP_BACKEND]\n",
" [--amp_level AMP_LEVEL]\n",
" [--distributed_backend DISTRIBUTED_BACKEND]\n",
" [--move_metrics_to_cpu [MOVE_METRICS_TO_CPU]]\n",
" [--multiple_trainloader_mode MULTIPLE_TRAINLOADER_MODE]\n",
" [--stochastic_weight_avg [STOCHASTIC_WEIGHT_AVG]]\n",
"main.py: error: argument --gpus: invalid _gpus_allowed_type value: ''\n"
]
}
],
"source": [
"# Run training\n",
"!(python main.py \\\n",
" -t \\\n",
" --base configs/stable-diffusion/paris.yaml \\\n",
" --gpus \"$gpu_list\" \\\n",
" --scale_lr False \\\n",
" --num_nodes 1 \\\n",
" --check_val_every_n_epoch 10 \\\n",
" --finetune_from \"$ckpt_path\" \\\n",
" data.params.batch_size=\"$BATCH_SIZE\" \\\n",
" lightning.trainer.accumulate_grad_batches=\"$ACCUMULATE_BATCHES\" \\\n",
" data.params.validation.params.n_gpus=\"$NUM_GPUS\" \\\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "sk9wHFKgz8kJ"
},
"outputs": [],
"source": [
"# Run the model\n",
"!(python scripts/txt2img.py \\\n",
" --prompt 'robotic cat with wings' \\\n",
" --outdir 'outputs/generated_pokemon' \\\n",
" --H 512 --W 512 \\\n",
" --n_samples 4 \\\n",
" --config 'configs/stable-diffusion/pokemon.yaml' \\\n",
" --ckpt 'path/to/your/checkpoint')"
]
}
],
"metadata": {
"accelerator": "GPU",
"colab": {
"background_execution": "on",
"machine_shape": "hm",
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"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.8.10"
},
"vscode": {
"interpreter": {
"hash": "e7370f93d1d0cde622a1f8e1c04877d8463912d04d973331ad4851f04de6915a"
}
}
},
"nbformat": 4,
"nbformat_minor": 4
}