2022-06-28 00:58:17 +00:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/kuprel/min-dalle/blob/main/min_dalle.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "3WL-G_f2_ld8"
},
"source": [
"# min(DALL·E)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Zl_ZFisFApeh"
},
"source": [
"### Setup"
]
},
{
"cell_type": "code",
2022-06-28 15:01:31 +00:00
"execution_count": 1,
2022-06-28 00:58:17 +00:00
"metadata": {
"id": "ix_xt4X1_6F4",
2022-06-28 15:01:31 +00:00
"colab": {
"base_uri": "https://localhost:8080/"
2022-06-28 15:05:59 +00:00
},
"outputId": "59ad2c80-4782-4ce3-ba9e-44b5afaa7e48"
2022-06-28 00:58:17 +00:00
},
2022-06-28 15:01:31 +00:00
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Cloning into 'min-dalle'...\n",
2022-06-28 15:05:59 +00:00
"remote: Enumerating objects: 123, done.\u001b[K\n",
"remote: Counting objects: 100% (123/123), done.\u001b[K\n",
"remote: Compressing objects: 100% (68/68), done.\u001b[K\n",
"remote: Total 123 (delta 64), reused 99 (delta 49), pack-reused 0\u001b[K\n",
"Receiving objects: 100% (123/123), 392.57 KiB | 9.57 MiB/s, done.\n",
"Resolving deltas: 100% (64/64), done.\n",
2022-06-28 15:01:31 +00:00
"Error: Failed to call git rev-parse --git-dir --show-toplevel: \"fatal: not a git repository (or any of the parent directories): .git\\n\"\n",
"Git LFS initialized.\n",
"Cloning into '/content/min-dalle/pretrained/vqgan'...\n",
"remote: Enumerating objects: 20, done.\u001b[K\n",
"remote: Counting objects: 100% (20/20), done.\u001b[K\n",
"remote: Compressing objects: 100% (19/19), done.\u001b[K\n",
"remote: Total 20 (delta 6), reused 0 (delta 0), pack-reused 0\u001b[K\n",
"Unpacking objects: 100% (20/20), done.\n",
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
"Requirement already satisfied: torch in /usr/local/lib/python3.7/dist-packages (1.11.0+cu113)\n",
"Collecting flax==0.4.2\n",
" Downloading flax-0.4.2-py3-none-any.whl (186 kB)\n",
2022-06-28 15:05:59 +00:00
"\u001b[K |████████████████████████████████| 186 kB 7.3 MB/s \n",
2022-06-28 15:01:31 +00:00
"\u001b[?25hCollecting wandb\n",
" Downloading wandb-0.12.19-py2.py3-none-any.whl (1.8 MB)\n",
2022-06-28 15:05:59 +00:00
"\u001b[K |████████████████████████████████| 1.8 MB 65.2 MB/s \n",
"\u001b[?25hCollecting optax\n",
" Downloading optax-0.1.2-py3-none-any.whl (140 kB)\n",
"\u001b[K |████████████████████████████████| 140 kB 73.5 MB/s \n",
2022-06-28 15:01:31 +00:00
"\u001b[?25hRequirement already satisfied: numpy>=1.12 in /usr/local/lib/python3.7/dist-packages (from flax==0.4.2) (1.21.6)\n",
"Requirement already satisfied: jax>=0.3 in /usr/local/lib/python3.7/dist-packages (from flax==0.4.2) (0.3.8)\n",
"Requirement already satisfied: matplotlib in /usr/local/lib/python3.7/dist-packages (from flax==0.4.2) (3.2.2)\n",
"Requirement already satisfied: typing-extensions>=4.1.1 in /usr/local/lib/python3.7/dist-packages (from flax==0.4.2) (4.1.1)\n",
"Requirement already satisfied: msgpack in /usr/local/lib/python3.7/dist-packages (from flax==0.4.2) (1.0.4)\n",
"Requirement already satisfied: absl-py in /usr/local/lib/python3.7/dist-packages (from jax>=0.3->flax==0.4.2) (1.1.0)\n",
2022-06-28 15:05:59 +00:00
"Requirement already satisfied: opt-einsum in /usr/local/lib/python3.7/dist-packages (from jax>=0.3->flax==0.4.2) (3.3.0)\n",
2022-06-28 15:01:31 +00:00
"Requirement already satisfied: scipy>=1.2.1 in /usr/local/lib/python3.7/dist-packages (from jax>=0.3->flax==0.4.2) (1.4.1)\n",
2022-06-28 15:05:59 +00:00
"Collecting docker-pycreds>=0.4.0\n",
" Downloading docker_pycreds-0.4.0-py2.py3-none-any.whl (9.0 kB)\n",
"Collecting sentry-sdk>=1.0.0\n",
" Downloading sentry_sdk-1.6.0-py2.py3-none-any.whl (145 kB)\n",
"\u001b[K |████████████████████████████████| 145 kB 66.1 MB/s \n",
2022-06-28 15:01:31 +00:00
"\u001b[?25hCollecting pathtools\n",
" Downloading pathtools-0.1.2.tar.gz (11 kB)\n",
2022-06-28 15:05:59 +00:00
"Requirement already satisfied: psutil>=5.0.0 in /usr/local/lib/python3.7/dist-packages (from wandb) (5.4.8)\n",
"Collecting shortuuid>=0.5.0\n",
" Downloading shortuuid-1.0.9-py3-none-any.whl (9.4 kB)\n",
"Requirement already satisfied: six>=1.13.0 in /usr/local/lib/python3.7/dist-packages (from wandb) (1.15.0)\n",
"Collecting GitPython>=1.0.0\n",
" Downloading GitPython-3.1.27-py3-none-any.whl (181 kB)\n",
"\u001b[K |████████████████████████████████| 181 kB 61.8 MB/s \n",
"\u001b[?25hRequirement already satisfied: requests<3,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from wandb) (2.23.0)\n",
"Requirement already satisfied: promise<3,>=2.0 in /usr/local/lib/python3.7/dist-packages (from wandb) (2.3)\n",
2022-06-28 15:01:31 +00:00
"Collecting setproctitle\n",
" Downloading setproctitle-1.2.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (29 kB)\n",
2022-06-28 15:05:59 +00:00
"Requirement already satisfied: Click!=8.0.0,>=7.0 in /usr/local/lib/python3.7/dist-packages (from wandb) (7.1.2)\n",
2022-06-28 15:01:31 +00:00
"Requirement already satisfied: setuptools in /usr/local/lib/python3.7/dist-packages (from wandb) (57.4.0)\n",
2022-06-28 15:05:59 +00:00
"Requirement already satisfied: PyYAML in /usr/local/lib/python3.7/dist-packages (from wandb) (3.13)\n",
2022-06-28 15:01:31 +00:00
"Requirement already satisfied: protobuf<4.0dev,>=3.12.0 in /usr/local/lib/python3.7/dist-packages (from wandb) (3.17.3)\n",
"Collecting gitdb<5,>=4.0.1\n",
" Downloading gitdb-4.0.9-py3-none-any.whl (63 kB)\n",
2022-06-28 15:05:59 +00:00
"\u001b[K |████████████████████████████████| 63 kB 2.0 MB/s \n",
2022-06-28 15:01:31 +00:00
"\u001b[?25hCollecting smmap<6,>=3.0.1\n",
" Downloading smmap-5.0.0-py3-none-any.whl (24 kB)\n",
"Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.0.0->wandb) (1.24.3)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.0.0->wandb) (2022.6.15)\n",
"Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.0.0->wandb) (3.0.4)\n",
2022-06-28 15:05:59 +00:00
"Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.0.0->wandb) (2.10)\n",
2022-06-28 15:01:31 +00:00
"Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib->flax==0.4.2) (0.11.0)\n",
"Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->flax==0.4.2) (3.0.9)\n",
"Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->flax==0.4.2) (1.4.3)\n",
2022-06-28 15:05:59 +00:00
"Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->flax==0.4.2) (2.8.2)\n",
2022-06-28 15:01:31 +00:00
"Collecting chex>=0.0.4\n",
" Downloading chex-0.1.3-py3-none-any.whl (72 kB)\n",
2022-06-28 15:05:59 +00:00
"\u001b[K |████████████████████████████████| 72 kB 673 kB/s \n",
2022-06-28 15:01:31 +00:00
"\u001b[?25hRequirement already satisfied: jaxlib>=0.1.37 in /usr/local/lib/python3.7/dist-packages (from optax->flax==0.4.2) (0.3.7+cuda11.cudnn805)\n",
"Requirement already satisfied: dm-tree>=0.1.5 in /usr/local/lib/python3.7/dist-packages (from chex>=0.0.4->optax->flax==0.4.2) (0.1.7)\n",
"Requirement already satisfied: toolz>=0.9.0 in /usr/local/lib/python3.7/dist-packages (from chex>=0.0.4->optax->flax==0.4.2) (0.11.2)\n",
"Requirement already satisfied: flatbuffers<3.0,>=1.12 in /usr/local/lib/python3.7/dist-packages (from jaxlib>=0.1.37->optax->flax==0.4.2) (2.0)\n",
"Building wheels for collected packages: pathtools\n",
" Building wheel for pathtools (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
2022-06-28 15:05:59 +00:00
" Created wheel for pathtools: filename=pathtools-0.1.2-py3-none-any.whl size=8806 sha256=ffc66d1506109748619c254f954379adfd8590df97fef89970d7c165205b7a64\n",
2022-06-28 15:01:31 +00:00
" Stored in directory: /root/.cache/pip/wheels/3e/31/09/fa59cef12cdcfecc627b3d24273699f390e71828921b2cbba2\n",
"Successfully built pathtools\n",
"Installing collected packages: smmap, gitdb, chex, shortuuid, setproctitle, sentry-sdk, pathtools, optax, GitPython, docker-pycreds, wandb, flax\n",
"Successfully installed GitPython-3.1.27 chex-0.1.3 docker-pycreds-0.4.0 flax-0.4.2 gitdb-4.0.9 optax-0.1.2 pathtools-0.1.2 sentry-sdk-1.6.0 setproctitle-1.2.3 shortuuid-1.0.9 smmap-5.0.0 wandb-0.12.19\n",
"\u001b[34m\u001b[1mwandb\u001b[0m: Appending key for api.wandb.ai to your netrc file: /root/.netrc\n",
"\u001b[34m\u001b[1mwandb\u001b[0m: Downloading dataset artifact dalle-mini/dalle-mini/mini-1:v0\n",
2022-06-28 15:05:59 +00:00
"\u001b[34m\u001b[1mwandb\u001b[0m: Downloading large artifact mini-1:v0, 1673.43MB. 7 files... Done. 0:0:15.2\n",
2022-06-28 15:01:31 +00:00
"\u001b[34m\u001b[1mwandb\u001b[0m: Artifact downloaded to /content/min-dalle/pretrained/dalle_bart_mini\n"
]
}
],
2022-06-28 00:58:17 +00:00
"source": [
"#@title Setup\n",
"! git clone https://github.com/kuprel/min-dalle\n",
2022-06-28 10:09:52 +00:00
"! git lfs install\n",
2022-06-28 15:01:31 +00:00
"! git clone https://huggingface.co/dalle-mini/vqgan_imagenet_f16_16384 /content/min-dalle/pretrained/vqgan\n",
"! pip install torch flax==0.4.2 wandb\n",
2022-06-28 13:19:52 +00:00
"! wandb login --anonymously\n",
2022-06-28 15:01:31 +00:00
"! wandb artifact get --root=/content/min-dalle/pretrained/dalle_bart_mini dalle-mini/dalle-mini/mini-1:v0"
2022-06-28 00:58:17 +00:00
]
},
{
"cell_type": "markdown",
2022-06-28 15:01:31 +00:00
"metadata": {
2022-06-28 15:05:59 +00:00
"id": "c52TV1GbBNgS"
},
"source": [
"### Generate an Image"
]
2022-06-28 00:58:17 +00:00
},
{
"cell_type": "code",
2022-06-28 15:05:59 +00:00
"execution_count": 2,
2022-06-28 00:58:17 +00:00
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 480
2022-06-28 15:05:59 +00:00
},
"id": "nQ0UG05dA4p2",
"outputId": "2da437dc-9e62-448a-8398-73f87a2e313a"
2022-06-28 00:58:17 +00:00
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"parsing metadata from ./pretrained/dalle_bart_mini\n",
"tokenizing text\n",
"['Ġalien']\n",
"['Ġlife']\n",
"text tokens [0, 8925, 742, 2]\n",
"loading flax encoder\n",
"encoding text tokens\n",
"loading flax decoder\n",
"sampling image tokens\n",
"image tokens [6965, 6172, 1052, 14447, 6172, 12062, 15771, 2193, 10710, 4147, 1052, 6172, 2528, 14447, 5772, 8447, 6965, 14447, 14447, 14447, 11665, 6879, 15798, 9479, 910, 15303, 5605, 7542, 1052, 14447, 14447, 2528, 6965, 1052, 14447, 6078, 3386, 2519, 12838, 16017, 867, 8447, 11993, 12426, 11196, 14447, 14447, 2528, 6965, 14447, 14447, 7491, 16147, 13512, 8269, 271, 10397, 15945, 15945, 4903, 12892, 14447, 14447, 2528, 6965, 14447, 14447, 351, 358, 10362, 6001, 8612, 14037, 7864, 14246, 5201, 2810, 14447, 14447, 2528, 6965, 14447, 14447, 10549, 15618, 11792, 13401, 16223, 1464, 12861, 6992, 572, 601, 14447, 14447, 2528, 6965, 14447, 14447, 14447, 13183, 194, 14633, 1994, 10912, 2778, 5495, 12187, 2528, 14447, 14447, 2528, 6965, 14447, 14447, 14447, 2528, 14068, 4054, 5071, 1948, 5286, 7771, 12062, 12016, 14447, 14447, 2528, 6965, 14447, 14447, 14447, 7504, 15433, 7781, 4816, 12062, 663, 3812, 8447, 8173, 14447, 14447, 2528, 6965, 14447, 14447, 6078, 13401, 6790, 2813, 10121, 4301, 4811, 5984, 3851, 8493, 14447, 14447, 2528, 6965, 14447, 14447, 4465, 12509, 4238, 12290, 10543, 8222, 11348, 13909, 5919, 6965, 14447, 14447, 2528, 11591, 14447, 6172, 11665, 9501, 2810, 9570, 7781, 910, 10549, 4395, 10639, 16147, 8173, 14164, 2528, 11591, 14164, 11993, 11610, 15891, 6242, 1936, 14602, 4903, 3583, 11574, 7516, 12892, 8173, 14447, 2528, 11591, 7467, 5243, 13157, 2810, 6790, 16017, 7236, 4301, 11725, 10689, 11941, 12659, 8173, 1052, 2528, 6965, 6598, 4465, 4816, 2895, 11820, 3132, 15917, 1811, 4904, 6933, 6690, 4811, 7504, 2528, 11605, 7467, 4815, 351, 6948, 10228, 7771, 9479, 9213, 11196, 6628, 9897, 12480, 5885, 14247, 5772, 5772]\n",
"detokenizing image\n"
]
},
{
"output_type": "display_data",
"data": {
"text/plain": [
2022-06-28 15:05:59 +00:00
"<PIL.Image.Image image mode=RGB size=256x256 at 0x7F8795C12050>"
2022-06-28 00:58:17 +00:00
],
"image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s5vrY+5yZAZMgUAkiEACQciAjua9cW6sb2eJxf3FW+cA59Tz58qRrVfqqte6ZY3BFgSw5t7ys9lsyi2qrZYZi6bf8uK6nPVbcu7xeFNwMime0+ZSPVs+mvfmQs8s2lO/pRVqCqIBQkEBicZwcW/3+N23P/uDn33wzoOHn73/4PUHr7/+6Or+bn9oDhcXjSIxQVoGSCPN4VDRhiJCIpQSEDjd0YQy6EY398yIYARcBZAMpweTa3ZPCN3bfhd2kBTt7lG7PzYXLy4uXzx4+Ozxi6fPX3x8ff38ur/ujzfXDBhYpIqOH7cwj8rq228ZSlld4AwVbv5dKwepni3KqWWTrG+OZpI1+61biy1Sb9YvLBq3KezvohzWPLcuX6pGcSTfyTI4vTPZgqafhR+G/pKqB0+dVcD5jNbrltS9piuJWF/7mF8T1JGBy4SrB/t7r91/+5133v78a5//gXdff/e1+w8v9w+ai8uG0ihEoBRxChQE0YBsAtg1rSA8Ike4IUAnQIkQD0FIzuHmfe/h7haU0BCHICQkTCXtdwQDFplB1/BWyJ0lstk3V5d677XUvXHx7MnVzccvXnzSHp8e+2POCAEJNtAAiLhFda+vN2l9IeMX8vsWySI4/R7u8GzmdXuWj26dKtQjPr0+XW9DoDUL1hdrHt3sqc1CFtdDcdN9ni508v3g6pVym6eLaYmkyjko+rXs8WXNy28pfxvA5s0Mx+Ei/cDn337jnbfeeO/td979zKPXH732+PDgwf3DVXNoRXchRGgADFBVBKpNSqoUgkpNCrgbPRoSq
},
"metadata": {}
}
2022-06-28 15:05:59 +00:00
],
"source": [
"#@title Default title text\n",
"text = \"alien life\" #@param {type:\"string\"}\n",
"seed = 7#@param {type:\"integer\"}\n",
"torch = True\n",
"mega = False\n",
"\n",
"import os\n",
"os.chdir('/content/min-dalle')\n",
"from min_dalle.generate_image import generate_image_from_text\n",
"image = generate_image_from_text(text, seed=seed)\n",
"display(image)"
2022-06-28 00:58:17 +00:00
]
}
],
"metadata": {
"accelerator": "GPU",
"colab": {
"name": "min-dalle",
"provenance": [],
2022-06-28 15:05:59 +00:00
"collapsed_sections": [
"Zl_ZFisFApeh"
],
"authorship_tag": "ABX9TyMOl5R0K08QJNx12TxSCM7M",
2022-06-28 00:58:17 +00:00
"include_colab_link": true
},
"gpuClass": "standard",
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
}