File size: 4,484 Bytes
07501c1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "VjYy0F2gZIPR"
      },
      "outputs": [],
      "source": [
        "%cd /content\n",
        "!git clone https://github.com/runew0lf/RuinedFooocus.git\n",
        "%cd RuinedFooocus\n",
        "!apt -y install -qq aria2\n",
        "#!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://civitai.com/api/download/models/240840 -d /content/RuinedFooocus/models/checkpoints -o sd_xl_base_1.0_0.9vae.safetensors\n",
        "#!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://civitai.com/api/download/models/232565 -d /content/RuinedFooocus/models/checkpoints -o newrealityxl_12.safetensors\n",
        "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/dataautogpt3/OpenDalleV1.1/resolve/main/OpenDalleV1.1.safetensors?download=true -d /content/RuinedFooocus/models/checkpoints -o sd_xl_base_1.0_0.9vae.safetensors\n",
        "\n",
        "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://civitai.com/api/download/models/283697 -d /content/RuinedFooocus/models/loras -o MJ52.safetensors\n",
        "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/datasets/abbiepam/shorty/resolve/main/TraiLow/popaiwayle.safetensors?download=true -d /content/RuinedFooocus/models/loras -o popaiwayle_artwork.safetensors\n",
        "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/datasets/abbiepam/shorty/resolve/main/TraiLow/brandibae.safetensors?download=true -d /content/RuinedFooocus/models/loras -o brandibae.safetensors\n",
        "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/datasets/abbiepam/shorty/resolve/main/TraiLow/bestiefirst.safetensors?download=true -d /content/RuinedFooocus/models/loras -o bestiefirst.safetensors\n",
        "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/datasets/abbiepam/shorty/resolve/main/TraiLow/carodaq.safetensors?download=true -d /content/RuinedFooocus/models/loras -o carodaq.safetensors\n",
        "#!pip install pygit2==1.12.2\n",
        "#!pip install -q torch==2.0.1+cu118 torchvision==0.15.2+cu118 torchaudio==2.0.2+cu118 torchtext==0.15.2 torchdata==0.6.1 --extra-index-url https://download.pytorch.org/whl/cu118 -U\n",
        "#!pip install https://download.pytorch.org/whl/cu121/xformers-0.0.22.post4-cp310-cp310-manylinux2014_x86_64.whl#sha256=7075114dbf698b609b599f0d35032c0b2f9a389751e8bbf4dd3c628376b0dd9c\n",
        "!pip install -r requirements_versions.txt\n",
        "!python launch.py --share"
      ]
    },
    {
      "cell_type": "code",
      "source": [],
      "metadata": {
        "id": "new2R8nQpvRl"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "!python launch.py --share"
      ],
      "metadata": {
        "id": "X3iAizG6yfhU"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "# @title DOWNLOAD THE ZIP WITH ALL THE IMAGES\n",
        "import zipfile\n",
        "import os\n",
        "from google.colab import files\n",
        "\n",
        "def zip_folder(folder_path, zip_filename):\n",
        "    with zipfile.ZipFile(zip_filename, 'w', zipfile.ZIP_DEFLATED) as zipf:\n",
        "        for root, _, files in os.walk(folder_path):\n",
        "            for file in files:\n",
        "                file_path = os.path.join(root, file)\n",
        "                arcname = os.path.relpath(file_path, folder_path)\n",
        "                zipf.write(file_path, arcname)\n",
        "\n",
        "folder_to_zip = \"/content/RuinedFooocus/outputs/2023-11-17\"\n",
        "zip_filename = \"output2023-11-17.zip\"\n",
        "zip_folder(folder_to_zip, zip_filename)\n",
        "print(f'Succesfully saved all the images in {zip_filename}\\nDownloading the zip.....')\n",
        "files.download(zip_filename)"
      ],
      "metadata": {
        "id": "hr-VjaNtf4VJ"
      },
      "execution_count": null,
      "outputs": []
    }
  ],
  "metadata": {
    "accelerator": "GPU",
    "colab": {
      "gpuType": "T4",
      "provenance": []
    },
    "kernelspec": {
      "display_name": "Python 3",
      "name": "python3"
    },
    "language_info": {
      "name": "python"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}