Upload 2 files
Browse files- requirements.txt +12 -12
- roop-unleashed.ipynb +90 -126
requirements.txt
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
-
--extra-index-url https://download.pytorch.org/whl/
|
2 |
-
|
3 |
numpy==1.26.4
|
4 |
-
gradio==
|
5 |
-
opencv-python==4.
|
6 |
-
onnx==1.16.
|
7 |
insightface==0.7.3
|
|
|
8 |
psutil==5.9.6
|
9 |
-
torch==2.1
|
10 |
-
torch==2.1
|
11 |
-
torchvision==0.
|
12 |
-
torchvision==0.
|
13 |
-
onnxruntime==1.
|
14 |
-
onnxruntime-silicon==1.
|
15 |
-
onnxruntime-gpu==1.
|
16 |
tqdm==4.66.4
|
17 |
ftfy
|
18 |
regex
|
|
|
1 |
+
--extra-index-url https://download.pytorch.org/whl/cu124
|
|
|
2 |
numpy==1.26.4
|
3 |
+
gradio==5.9.1
|
4 |
+
opencv-python-headless==4.10.0.84
|
5 |
+
onnx==1.16.1
|
6 |
insightface==0.7.3
|
7 |
+
albucore==0.0.16
|
8 |
psutil==5.9.6
|
9 |
+
torch==2.5.1+cu124; sys_platform != 'darwin'
|
10 |
+
torch==2.5.1; sys_platform == 'darwin'
|
11 |
+
torchvision==0.20.1+cu124; sys_platform != 'darwin'
|
12 |
+
torchvision==0.20.1; sys_platform == 'darwin'
|
13 |
+
onnxruntime==1.20.1; sys_platform == 'darwin' and platform_machine != 'arm64'
|
14 |
+
onnxruntime-silicon==1.20.1; sys_platform == 'darwin' and platform_machine == 'arm64'
|
15 |
+
onnxruntime-gpu==1.20.1; sys_platform != 'darwin'
|
16 |
tqdm==4.66.4
|
17 |
ftfy
|
18 |
regex
|
roop-unleashed.ipynb
CHANGED
@@ -1,66 +1,51 @@
|
|
1 |
{
|
2 |
-
"nbformat": 4,
|
3 |
-
"nbformat_minor": 0,
|
4 |
-
"metadata": {
|
5 |
-
"colab": {
|
6 |
-
"provenance": [],
|
7 |
-
"gpuType": "T4",
|
8 |
-
"collapsed_sections": [
|
9 |
-
"UdQ1VHdI8lCf"
|
10 |
-
]
|
11 |
-
},
|
12 |
-
"kernelspec": {
|
13 |
-
"name": "python3",
|
14 |
-
"display_name": "Python 3"
|
15 |
-
},
|
16 |
-
"language_info": {
|
17 |
-
"name": "python"
|
18 |
-
},
|
19 |
-
"accelerator": "GPU"
|
20 |
-
},
|
21 |
"cells": [
|
22 |
{
|
23 |
"cell_type": "markdown",
|
|
|
|
|
|
|
24 |
"source": [
|
25 |
"# Colab for roop-unleashed - Gradio version\n",
|
26 |
"https://github.com/C0untFloyd/roop-unleashed\n"
|
27 |
-
]
|
28 |
-
"metadata": {
|
29 |
-
"id": "G9BdiCppV6AS"
|
30 |
-
}
|
31 |
},
|
32 |
{
|
33 |
"cell_type": "markdown",
|
34 |
-
"source": [
|
35 |
-
"Install CUDA V11.8 on Google Cloud Compute"
|
36 |
-
],
|
37 |
"metadata": {
|
38 |
"id": "CanIXgLJgaOj"
|
39 |
-
}
|
|
|
|
|
|
|
40 |
},
|
41 |
{
|
42 |
"cell_type": "code",
|
43 |
-
"
|
44 |
-
"!apt-get -y update\n",
|
45 |
-
"!apt-get -y install cuda-toolkit-11-8\n",
|
46 |
-
"import os\n",
|
47 |
-
"os.environ[\"LD_LIBRARY_PATH\"] += \":\" + \"/usr/local/cuda-11/lib64\"\n",
|
48 |
-
"os.environ[\"LD_LIBRARY_PATH\"] += \":\" + \"/usr/local/cuda-11.8/lib64\""
|
49 |
-
],
|
50 |
"metadata": {
|
51 |
"id": "96GE4UgYg3Ej"
|
52 |
},
|
53 |
-
"
|
54 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
},
|
56 |
{
|
57 |
"cell_type": "markdown",
|
58 |
-
"source": [
|
59 |
-
"Installing & preparing requirements"
|
60 |
-
],
|
61 |
"metadata": {
|
62 |
"id": "0ZYRNb0AWLLW"
|
63 |
-
}
|
|
|
|
|
|
|
64 |
},
|
65 |
{
|
66 |
"cell_type": "code",
|
@@ -73,61 +58,46 @@
|
|
73 |
"!git clone https://github.com/C0untFloyd/roop-unleashed.git\n",
|
74 |
"%cd roop-unleashed\n",
|
75 |
"!mv config_colab.yaml config.yaml\n",
|
76 |
-
"!pip install
|
77 |
]
|
78 |
},
|
79 |
{
|
80 |
"cell_type": "markdown",
|
81 |
-
"source": [
|
82 |
-
"Running roop-unleashed with default config"
|
83 |
-
],
|
84 |
"metadata": {
|
85 |
"id": "u_4JQiSlV9Fi"
|
86 |
-
}
|
|
|
|
|
|
|
87 |
},
|
88 |
{
|
89 |
"cell_type": "code",
|
90 |
-
"
|
91 |
-
"!python run.py"
|
92 |
-
],
|
93 |
"metadata": {
|
94 |
"id": "Is6U2huqSzLE"
|
95 |
},
|
96 |
-
"
|
97 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
},
|
99 |
{
|
100 |
"cell_type": "markdown",
|
|
|
|
|
|
|
101 |
"source": [
|
102 |
"### Download generated images folder\n",
|
103 |
"(only needed if you want to zip the generated output)"
|
104 |
-
]
|
105 |
-
"metadata": {
|
106 |
-
"id": "UdQ1VHdI8lCf"
|
107 |
-
}
|
108 |
},
|
109 |
{
|
110 |
"cell_type": "code",
|
111 |
-
"
|
112 |
-
"import shutil\n",
|
113 |
-
"import os\n",
|
114 |
-
"from google.colab import files\n",
|
115 |
-
"\n",
|
116 |
-
"def zip_directory(directory_path, zip_path):\n",
|
117 |
-
" shutil.make_archive(zip_path, 'zip', directory_path)\n",
|
118 |
-
"\n",
|
119 |
-
"# Set the directory path you want to download\n",
|
120 |
-
"directory_path = '/content/roop-unleashed/output'\n",
|
121 |
-
"\n",
|
122 |
-
"# Set the zip file name\n",
|
123 |
-
"zip_filename = 'fake_output.zip'\n",
|
124 |
-
"\n",
|
125 |
-
"# Zip the directory\n",
|
126 |
-
"zip_directory(directory_path, zip_filename)\n",
|
127 |
-
"\n",
|
128 |
-
"# Download the zip file\n",
|
129 |
-
"files.download(zip_filename+'.zip')\n"
|
130 |
-
],
|
131 |
"metadata": {
|
132 |
"colab": {
|
133 |
"base_uri": "https://localhost:8080/",
|
@@ -136,73 +106,67 @@
|
|
136 |
"id": "oYjWveAmw10X",
|
137 |
"outputId": "5b4c3650-f951-434a-c650-5525a8a70c1e"
|
138 |
},
|
139 |
-
"execution_count": null,
|
140 |
"outputs": [
|
141 |
{
|
142 |
-
"output_type": "display_data",
|
143 |
"data": {
|
|
|
144 |
"text/plain": [
|
145 |
"<IPython.core.display.Javascript object>"
|
146 |
-
],
|
147 |
-
"application/javascript": [
|
148 |
-
"\n",
|
149 |
-
" async function download(id, filename, size) {\n",
|
150 |
-
" if (!google.colab.kernel.accessAllowed) {\n",
|
151 |
-
" return;\n",
|
152 |
-
" }\n",
|
153 |
-
" const div = document.createElement('div');\n",
|
154 |
-
" const label = document.createElement('label');\n",
|
155 |
-
" label.textContent = `Downloading \"${filename}\": `;\n",
|
156 |
-
" div.appendChild(label);\n",
|
157 |
-
" const progress = document.createElement('progress');\n",
|
158 |
-
" progress.max = size;\n",
|
159 |
-
" div.appendChild(progress);\n",
|
160 |
-
" document.body.appendChild(div);\n",
|
161 |
-
"\n",
|
162 |
-
" const buffers = [];\n",
|
163 |
-
" let downloaded = 0;\n",
|
164 |
-
"\n",
|
165 |
-
" const channel = await google.colab.kernel.comms.open(id);\n",
|
166 |
-
" // Send a message to notify the kernel that we're ready.\n",
|
167 |
-
" channel.send({})\n",
|
168 |
-
"\n",
|
169 |
-
" for await (const message of channel.messages) {\n",
|
170 |
-
" // Send a message to notify the kernel that we're ready.\n",
|
171 |
-
" channel.send({})\n",
|
172 |
-
" if (message.buffers) {\n",
|
173 |
-
" for (const buffer of message.buffers) {\n",
|
174 |
-
" buffers.push(buffer);\n",
|
175 |
-
" downloaded += buffer.byteLength;\n",
|
176 |
-
" progress.value = downloaded;\n",
|
177 |
-
" }\n",
|
178 |
-
" }\n",
|
179 |
-
" }\n",
|
180 |
-
" const blob = new Blob(buffers, {type: 'application/binary'});\n",
|
181 |
-
" const a = document.createElement('a');\n",
|
182 |
-
" a.href = window.URL.createObjectURL(blob);\n",
|
183 |
-
" a.download = filename;\n",
|
184 |
-
" div.appendChild(a);\n",
|
185 |
-
" a.click();\n",
|
186 |
-
" div.remove();\n",
|
187 |
-
" }\n",
|
188 |
-
" "
|
189 |
]
|
190 |
},
|
191 |
-
"metadata": {}
|
|
|
192 |
},
|
193 |
{
|
194 |
-
"output_type": "display_data",
|
195 |
"data": {
|
|
|
196 |
"text/plain": [
|
197 |
"<IPython.core.display.Javascript object>"
|
198 |
-
],
|
199 |
-
"application/javascript": [
|
200 |
-
"download(\"download_789eab11-93d2-4880-adf3-6aceee0cc5f9\", \"fake_output.zip.zip\", 80125)"
|
201 |
]
|
202 |
},
|
203 |
-
"metadata": {}
|
|
|
204 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
]
|
206 |
}
|
207 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
}
|
|
|
1 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "markdown",
|
5 |
+
"metadata": {
|
6 |
+
"id": "G9BdiCppV6AS"
|
7 |
+
},
|
8 |
"source": [
|
9 |
"# Colab for roop-unleashed - Gradio version\n",
|
10 |
"https://github.com/C0untFloyd/roop-unleashed\n"
|
11 |
+
]
|
|
|
|
|
|
|
12 |
},
|
13 |
{
|
14 |
"cell_type": "markdown",
|
|
|
|
|
|
|
15 |
"metadata": {
|
16 |
"id": "CanIXgLJgaOj"
|
17 |
+
},
|
18 |
+
"source": [
|
19 |
+
"Install CUDA 12.6 & CUDNN on Google Cloud Compute"
|
20 |
+
]
|
21 |
},
|
22 |
{
|
23 |
"cell_type": "code",
|
24 |
+
"execution_count": null,
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
"metadata": {
|
26 |
"id": "96GE4UgYg3Ej"
|
27 |
},
|
28 |
+
"outputs": [],
|
29 |
+
"source": [
|
30 |
+
"!apt-get -y update\n",
|
31 |
+
"!apt-get -y install cuda-toolkit-12-6\n",
|
32 |
+
"!apt-get -y install cudnn9-cuda-12\n",
|
33 |
+
"\n",
|
34 |
+
"import os\n",
|
35 |
+
"os.environ[\"LD_LIBRARY_PATH\"] += \":\" + \"/usr/local/cuda-12/lib64\"\n",
|
36 |
+
"os.environ[\"LD_LIBRARY_PATH\"] += \":\" + \"/usr/local/cuda-12.6/lib64\"\n",
|
37 |
+
"\n",
|
38 |
+
"!nvcc --version"
|
39 |
+
]
|
40 |
},
|
41 |
{
|
42 |
"cell_type": "markdown",
|
|
|
|
|
|
|
43 |
"metadata": {
|
44 |
"id": "0ZYRNb0AWLLW"
|
45 |
+
},
|
46 |
+
"source": [
|
47 |
+
"Installing & preparing requirements"
|
48 |
+
]
|
49 |
},
|
50 |
{
|
51 |
"cell_type": "code",
|
|
|
58 |
"!git clone https://github.com/C0untFloyd/roop-unleashed.git\n",
|
59 |
"%cd roop-unleashed\n",
|
60 |
"!mv config_colab.yaml config.yaml\n",
|
61 |
+
"!pip install -r requirements.txt"
|
62 |
]
|
63 |
},
|
64 |
{
|
65 |
"cell_type": "markdown",
|
|
|
|
|
|
|
66 |
"metadata": {
|
67 |
"id": "u_4JQiSlV9Fi"
|
68 |
+
},
|
69 |
+
"source": [
|
70 |
+
"Running roop-unleashed with default config"
|
71 |
+
]
|
72 |
},
|
73 |
{
|
74 |
"cell_type": "code",
|
75 |
+
"execution_count": null,
|
|
|
|
|
76 |
"metadata": {
|
77 |
"id": "Is6U2huqSzLE"
|
78 |
},
|
79 |
+
"outputs": [],
|
80 |
+
"source": [
|
81 |
+
"import torch\n",
|
82 |
+
"print(f\"PyTorch version: {torch.__version__}\")\n",
|
83 |
+
"print(f\"CUDA device is available: {torch.cuda.is_available()}\")\n",
|
84 |
+
"\n",
|
85 |
+
"!python run.py"
|
86 |
+
]
|
87 |
},
|
88 |
{
|
89 |
"cell_type": "markdown",
|
90 |
+
"metadata": {
|
91 |
+
"id": "UdQ1VHdI8lCf"
|
92 |
+
},
|
93 |
"source": [
|
94 |
"### Download generated images folder\n",
|
95 |
"(only needed if you want to zip the generated output)"
|
96 |
+
]
|
|
|
|
|
|
|
97 |
},
|
98 |
{
|
99 |
"cell_type": "code",
|
100 |
+
"execution_count": null,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
"metadata": {
|
102 |
"colab": {
|
103 |
"base_uri": "https://localhost:8080/",
|
|
|
106 |
"id": "oYjWveAmw10X",
|
107 |
"outputId": "5b4c3650-f951-434a-c650-5525a8a70c1e"
|
108 |
},
|
|
|
109 |
"outputs": [
|
110 |
{
|
|
|
111 |
"data": {
|
112 |
+
"application/javascript": "\n async function download(id, filename, size) {\n if (!google.colab.kernel.accessAllowed) {\n return;\n }\n const div = document.createElement('div');\n const label = document.createElement('label');\n label.textContent = `Downloading \"${filename}\": `;\n div.appendChild(label);\n const progress = document.createElement('progress');\n progress.max = size;\n div.appendChild(progress);\n document.body.appendChild(div);\n\n const buffers = [];\n let downloaded = 0;\n\n const channel = await google.colab.kernel.comms.open(id);\n // Send a message to notify the kernel that we're ready.\n channel.send({})\n\n for await (const message of channel.messages) {\n // Send a message to notify the kernel that we're ready.\n channel.send({})\n if (message.buffers) {\n for (const buffer of message.buffers) {\n buffers.push(buffer);\n downloaded += buffer.byteLength;\n progress.value = downloaded;\n }\n }\n }\n const blob = new Blob(buffers, {type: 'application/binary'});\n const a = document.createElement('a');\n a.href = window.URL.createObjectURL(blob);\n a.download = filename;\n div.appendChild(a);\n a.click();\n div.remove();\n }\n ",
|
113 |
"text/plain": [
|
114 |
"<IPython.core.display.Javascript object>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
]
|
116 |
},
|
117 |
+
"metadata": {},
|
118 |
+
"output_type": "display_data"
|
119 |
},
|
120 |
{
|
|
|
121 |
"data": {
|
122 |
+
"application/javascript": "download(\"download_789eab11-93d2-4880-adf3-6aceee0cc5f9\", \"fake_output.zip.zip\", 80125)",
|
123 |
"text/plain": [
|
124 |
"<IPython.core.display.Javascript object>"
|
|
|
|
|
|
|
125 |
]
|
126 |
},
|
127 |
+
"metadata": {},
|
128 |
+
"output_type": "display_data"
|
129 |
}
|
130 |
+
],
|
131 |
+
"source": [
|
132 |
+
"import shutil\n",
|
133 |
+
"import os\n",
|
134 |
+
"from google.colab import files\n",
|
135 |
+
"\n",
|
136 |
+
"def zip_directory(directory_path, zip_path):\n",
|
137 |
+
" shutil.make_archive(zip_path, 'zip', directory_path)\n",
|
138 |
+
"\n",
|
139 |
+
"# Set the directory path you want to download\n",
|
140 |
+
"directory_path = '/content/roop-unleashed/output'\n",
|
141 |
+
"\n",
|
142 |
+
"# Set the zip file name\n",
|
143 |
+
"zip_filename = 'fake_output.zip'\n",
|
144 |
+
"\n",
|
145 |
+
"# Zip the directory\n",
|
146 |
+
"zip_directory(directory_path, zip_filename)\n",
|
147 |
+
"\n",
|
148 |
+
"# Download the zip file\n",
|
149 |
+
"files.download(zip_filename+'.zip')\n"
|
150 |
]
|
151 |
}
|
152 |
+
],
|
153 |
+
"metadata": {
|
154 |
+
"accelerator": "GPU",
|
155 |
+
"colab": {
|
156 |
+
"collapsed_sections": [
|
157 |
+
"UdQ1VHdI8lCf"
|
158 |
+
],
|
159 |
+
"gpuType": "T4",
|
160 |
+
"provenance": []
|
161 |
+
},
|
162 |
+
"kernelspec": {
|
163 |
+
"display_name": "Python 3",
|
164 |
+
"name": "python3"
|
165 |
+
},
|
166 |
+
"language_info": {
|
167 |
+
"name": "python"
|
168 |
+
}
|
169 |
+
},
|
170 |
+
"nbformat": 4,
|
171 |
+
"nbformat_minor": 0
|
172 |
}
|