{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "98f19f20", "metadata": {}, "outputs": [], "source": [ "!pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117 > /dev/null\n", "!pip install deepfloyd-if==1.0.1 > /dev/null\n", "!pip install xformers==0.0.16 > /dev/null\n", "!pip install git+https://github.com/openai/CLIP.git --no-deps > /dev/null" ] }, { "cell_type": "code", "execution_count": null, "id": "e669eec4", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 1, "id": "e784c6fb", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "deepfloyd-if 1.0.1rc0\n", "xformers 0.0.16\n", "open-clip-torch 2.7.0\n", "pytorch-lightning 1.6.5\n", "torch 1.13.1+cu117\n", "torchaudio 0.13.1+cu117\n", "torchmetrics 0.9.3\n", "torchvision 0.14.1+cu117\n", "Thu Apr 27 18:36:22 2023 \n", "+-----------------------------------------------------------------------------+\n", "| NVIDIA-SMI 525.85.12 Driver Version: 525.85.12 CUDA Version: 12.0 |\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:10:1C.0 Off | 0 |\n", "| N/A 52C P0 63W / 400W | 0MiB / 40960MiB | 0% Default |\n", "| | | Disabled |\n", "+-------------------------------+----------------------+----------------------+\n" ] } ], "source": [ "!pip list | grep deepfloyd\n", "!pip list | grep xformers\n", "!pip list | grep torch\n", "!nvidia-smi | head -12" ] }, { "cell_type": "code", "execution_count": null, "id": "6477ed77", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 2, "id": "d7ffb944", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "FORCE_MEM_EFFICIENT_ATTN= 1 @UNET:QKVATTENTION\n" ] } ], "source": [ "import os\n", "import torch\n", "os.environ['FORCE_MEM_EFFICIENT_ATTN'] = \"1\"\n", "import sys\n", "from deepfloyd_if.modules import IFStageI, IFStageII, StableStageIII\n", "from deepfloyd_if.modules.t5 import T5Embedder\n", "from deepfloyd_if.pipelines import dream, style_transfer, super_resolution, inpainting\n", "import torch.nn.functional as F\n", "import random\n", "import torchvision.transforms as T\n", "import numpy as np\n", "import requests\n", "from PIL import Image\n", "import torch\n", "import re" ] }, { "cell_type": "code", "execution_count": null, "id": "49c837a1", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "615b6a8a", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 3, "id": "75e36185", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "6633d49c3020402f9888d8ae156cc464", "version_major": 2, "version_minor": 0 }, "text/plain": [ "VBox(children=(HTML(value='