simplify colab

This commit is contained in:
Brett Kuprel 2022-07-05 09:37:52 -04:00
parent e1c744821b
commit 7cae9f27be

30
min_dalle.ipynb vendored
View File

@ -3,8 +3,8 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": { "metadata": {
"colab_type": "text", "id": "view-in-github",
"id": "view-in-github" "colab_type": "text"
}, },
"source": [ "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>" "<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>"
@ -30,7 +30,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 1, "execution_count": null,
"metadata": { "metadata": {
"cellView": "code", "cellView": "code",
"colab": { "colab": {
@ -102,7 +102,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": null,
"metadata": { "metadata": {
"colab": { "colab": {
"base_uri": "https://localhost:8080/" "base_uri": "https://localhost:8080/"
@ -145,18 +145,16 @@
"source": [ "source": [
"### Generate Images\n", "### Generate Images\n",
"\n", "\n",
"- `grid_size` Size of the image grid. 3x3 works best when displaying intermediate results. 4x4 has been tested to work on T4 and P100 with intermediate_image_count = 1\n", "- `grid_size` Size of the image grid. 3x3 works best when displaying intermediate outputs. 4x4 has been tested to work on T4 and P100 with intermediate outputs off\n",
"\n", "\n",
"- `seed` Set the seed to a positive number for reproducible results\n", "- `intermediate_outputs` Whether to show intermediate output. Adds a small delay and increases memory usage.\n",
"\n",
"- `intermediate_image_count` Set the total number of images to show while running. Each image adds a slight delay.\n",
"\n", "\n",
"- `supercondition_factor` Higher values result in better agreement with the text but a narrower variety of generated images" "- `supercondition_factor` Higher values result in better agreement with the text but a narrower variety of generated images"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 4, "execution_count": null,
"metadata": { "metadata": {
"colab": { "colab": {
"base_uri": "https://localhost:8080/", "base_uri": "https://localhost:8080/",
@ -189,16 +187,16 @@
"%%time\n", "%%time\n",
"\n", "\n",
"text = \"Dali painting of WALL·E\" #@param {type:\"string\"}\n", "text = \"Dali painting of WALL·E\" #@param {type:\"string\"}\n",
"intermediate_outputs = True #@param {type:\"boolean\"}\n",
"grid_size = 3 #@param {type:\"integer\"}\n", "grid_size = 3 #@param {type:\"integer\"}\n",
"seed = -1 #@param {type:\"integer\"}\n",
"intermediate_image_count = 4 #@param [\"1\", \"2\", \"4\", \"8\", \"16\"] {type:\"raw\"}\n",
"supercondition_factor = 8 #@param [\"2\", \"4\", \"8\", \"16\", \"32\", \"64\"] {type:\"raw\"}\n", "supercondition_factor = 8 #@param [\"2\", \"4\", \"8\", \"16\", \"32\", \"64\"] {type:\"raw\"}\n",
"log2_mid_count = 3 if intermediate_outputs else 0\n",
"\n", "\n",
"image_stream = model.generate_image_stream(\n", "image_stream = model.generate_image_stream(\n",
" text=text,\n", " text=text,\n",
" seed=seed,\n", " seed=-1,\n",
" grid_size=grid_size,\n", " grid_size=grid_size,\n",
" log2_mid_count=log2(intermediate_image_count),\n", " log2_mid_count=log2_mid_count,\n",
" log2_supercondition_factor=log2(supercondition_factor)\n", " log2_supercondition_factor=log2(supercondition_factor)\n",
")\n", ")\n",
"\n", "\n",
@ -216,9 +214,9 @@
"collapsed_sections": [ "collapsed_sections": [
"Zl_ZFisFApeh" "Zl_ZFisFApeh"
], ],
"include_colab_link": true,
"name": "min-dalle", "name": "min-dalle",
"provenance": [] "provenance": [],
"include_colab_link": true
}, },
"gpuClass": "standard", "gpuClass": "standard",
"kernelspec": { "kernelspec": {
@ -231,4 +229,4 @@
}, },
"nbformat": 4, "nbformat": 4,
"nbformat_minor": 0 "nbformat_minor": 0
} }