Upload 10 files
Browse files- Dockerfile +18 -0
- README.md +79 -6
- config_colab.yaml +14 -0
- requirements.txt +4 -2
- roop-unleashed.ipynb +79 -123
- runMacOS.sh +48 -0
- settings.py +1 -0
Dockerfile
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11
|
| 2 |
+
|
| 3 |
+
# making app folder
|
| 4 |
+
WORKDIR /app
|
| 5 |
+
|
| 6 |
+
# copying files
|
| 7 |
+
COPY . .
|
| 8 |
+
|
| 9 |
+
# installing requirements
|
| 10 |
+
RUN apt-get update
|
| 11 |
+
RUN apt-get install ffmpeg -y
|
| 12 |
+
RUN pip install --upgrade pip
|
| 13 |
+
RUN pip install -r ./requirements.txt
|
| 14 |
+
|
| 15 |
+
# launching gradio app
|
| 16 |
+
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
| 17 |
+
EXPOSE 7860
|
| 18 |
+
ENTRYPOINT python ./run.py
|
README.md
CHANGED
|
@@ -1,9 +1,3 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: roop-unleashed
|
| 3 |
-
app_file: run.py
|
| 4 |
-
sdk: gradio
|
| 5 |
-
sdk_version: 4.32.1
|
| 6 |
-
---
|
| 7 |
# roop-unleashed
|
| 8 |
|
| 9 |
[Changelog](#changelog) • [Usage](#usage) • [Wiki](https://github.com/C0untFloyd/roop-unleashed/wiki)
|
|
@@ -43,6 +37,10 @@ In the event of violation of the legal and ethical requirements of the user's co
|
|
| 43 |
|
| 44 |
Please refer to the [wiki](https://github.com/C0untFloyd/roop-unleashed/wiki).
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
|
|
@@ -50,6 +48,17 @@ Please refer to the [wiki](https://github.com/C0untFloyd/roop-unleashed/wiki).
|
|
| 50 |
|
| 51 |
- Windows: run the `windows_run.bat` from the Installer.
|
| 52 |
- Linux: `python run.py`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
<a target="_blank" href="https://colab.research.google.com/github/C0untFloyd/roop-unleashed/blob/main/roop-unleashed.ipynb">
|
| 55 |
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
|
|
@@ -65,6 +74,70 @@ Additional commandline arguments are currently unsupported and settings should b
|
|
| 65 |
|
| 66 |
### Changelog
|
| 67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
**22.04.2024** v3.9.0
|
| 69 |
|
| 70 |
- Bugfix: Face detection bounding box corrupt values at weird angles
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# roop-unleashed
|
| 2 |
|
| 3 |
[Changelog](#changelog) • [Usage](#usage) • [Wiki](https://github.com/C0untFloyd/roop-unleashed/wiki)
|
|
|
|
| 37 |
|
| 38 |
Please refer to the [wiki](https://github.com/C0untFloyd/roop-unleashed/wiki).
|
| 39 |
|
| 40 |
+
#### macOS Installation
|
| 41 |
+
Simply run the following command. It will check and install all dependencies if necessary.
|
| 42 |
+
|
| 43 |
+
`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/PJF16/roop-unleashed/master/installer/macOSinstaller.sh)"`
|
| 44 |
|
| 45 |
|
| 46 |
|
|
|
|
| 48 |
|
| 49 |
- Windows: run the `windows_run.bat` from the Installer.
|
| 50 |
- Linux: `python run.py`
|
| 51 |
+
- macOS: `sh runMacOS.sh`
|
| 52 |
+
- Dockerfile:
|
| 53 |
+
```shell
|
| 54 |
+
docker build -t roop-unleashed . && docker run -t \
|
| 55 |
+
-p 7860:7860 \
|
| 56 |
+
-v ./config.yaml:/app/config.yaml \
|
| 57 |
+
-v ./models:/app/models \
|
| 58 |
+
-v ./temp:/app/temp \
|
| 59 |
+
-v ./output:/app/output \
|
| 60 |
+
roop-unleashed
|
| 61 |
+
```
|
| 62 |
|
| 63 |
<a target="_blank" href="https://colab.research.google.com/github/C0untFloyd/roop-unleashed/blob/main/roop-unleashed.ipynb">
|
| 64 |
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
|
|
|
|
| 74 |
|
| 75 |
### Changelog
|
| 76 |
|
| 77 |
+
**28.9.2024** v4.3.1
|
| 78 |
+
|
| 79 |
+
- Bugfix: Several possible memory leaks
|
| 80 |
+
- Added different output modes, e.g. to virtual cam stream
|
| 81 |
+
- New swapping mode "All input faces"
|
| 82 |
+
- Average total fps displayed and setting for autorun
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
**16.9.2024** v4.2.8
|
| 86 |
+
|
| 87 |
+
- Bugfix: Starting roop-unleashed without NVIDIA gpu but cuda option enabled
|
| 88 |
+
- Bugfix: Target Faces couldn't be moved left/right
|
| 89 |
+
- Bugfix: Enhancement and upscaling working again in virtual cam
|
| 90 |
+
- Corrupt videos caught when adding to target files, displaying warning msg
|
| 91 |
+
- Source Files Component cleared after face detection to release temp files
|
| 92 |
+
- Added masking and mouth restore options to virtual cam
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
**9.9.2024** v4.2.3
|
| 96 |
+
|
| 97 |
+
- Hotfix for gradio pydantic issue with fastapi
|
| 98 |
+
- Upgraded to Gradio 4.43 hoping it will fix remaining issues
|
| 99 |
+
- Added new action when no face detected -> use last swapped
|
| 100 |
+
- Specified image format for image controls - opening new tabs on preview images possible again!
|
| 101 |
+
- Hardcoded image output format for livecam to jpeg - might be faster than previous webp
|
| 102 |
+
- Chain events to be only executed if previous was a success
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
**5.9.2024** v4.2.0
|
| 106 |
+
|
| 107 |
+
- Added ability to move input & target faces order
|
| 108 |
+
- New CLI Arguments override settings
|
| 109 |
+
- Small UI changes to faceswapping tab
|
| 110 |
+
- Added mask option and code for restoration of original mouth area
|
| 111 |
+
- Updated gradio to v4.42.0
|
| 112 |
+
- Added CLI Arguments --server_share and --cuda_device_id
|
| 113 |
+
- Added webp image support
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
**15.07.2024** v4.1.1
|
| 117 |
+
|
| 118 |
+
- Bugfix: Post-processing after swapping
|
| 119 |
+
|
| 120 |
+
|
| 121 |
+
**14.07.2024** v4.1.0
|
| 122 |
+
|
| 123 |
+
- Added subsample upscaling to increase swap resolution
|
| 124 |
+
- Upgraded gradio
|
| 125 |
+
|
| 126 |
+
|
| 127 |
+
**12.05.2024** v4.0.0
|
| 128 |
+
|
| 129 |
+
- Bugfix: Unnecessary init every frame in live-cam
|
| 130 |
+
- Bugfix: Installer downloading insightface package each run
|
| 131 |
+
- Added xseg masking to live-cam
|
| 132 |
+
- Added realesrganx2 to frame processors
|
| 133 |
+
- Upgraded some requirements
|
| 134 |
+
- Added subtypes and different model support to frame processors
|
| 135 |
+
- Allow frame processors to change resolutions of videos
|
| 136 |
+
- Different OpenCV Cap for MacOS Virtual Cam
|
| 137 |
+
- Added complete frame processing to extras tab
|
| 138 |
+
- Colorize, upscale and misc filters added
|
| 139 |
+
|
| 140 |
+
|
| 141 |
**22.04.2024** v3.9.0
|
| 142 |
|
| 143 |
- Bugfix: Face detection bounding box corrupt values at weird angles
|
config_colab.yaml
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
clear_output: true
|
| 2 |
+
force_cpu: false
|
| 3 |
+
max_threads: 3
|
| 4 |
+
memory_limit: 0
|
| 5 |
+
output_image_format: png
|
| 6 |
+
output_template: '{file}_{time}'
|
| 7 |
+
output_video_codec: libx264
|
| 8 |
+
output_video_format: mp4
|
| 9 |
+
provider: cuda
|
| 10 |
+
selected_theme: Default
|
| 11 |
+
server_name: ''
|
| 12 |
+
server_port: 0
|
| 13 |
+
server_share: true
|
| 14 |
+
video_quality: 14
|
requirements.txt
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
--extra-index-url https://download.pytorch.org/whl/cu118
|
| 2 |
|
| 3 |
numpy==1.26.4
|
| 4 |
-
gradio==4.
|
| 5 |
-
|
|
|
|
| 6 |
onnx==1.16.0
|
| 7 |
insightface==0.7.3
|
|
|
|
| 8 |
psutil==5.9.6
|
| 9 |
torch==2.1.2+cu118; sys_platform != 'darwin'
|
| 10 |
torch==2.1.2; sys_platform == 'darwin'
|
|
|
|
| 1 |
--extra-index-url https://download.pytorch.org/whl/cu118
|
| 2 |
|
| 3 |
numpy==1.26.4
|
| 4 |
+
gradio==4.44.0
|
| 5 |
+
fastapi<0.113.0
|
| 6 |
+
opencv-python-headless==4.9.0.80
|
| 7 |
onnx==1.16.0
|
| 8 |
insightface==0.7.3
|
| 9 |
+
albucore==0.0.16
|
| 10 |
psutil==5.9.6
|
| 11 |
torch==2.1.2+cu118; sys_platform != 'darwin'
|
| 12 |
torch==2.1.2; sys_platform == 'darwin'
|
roop-unleashed.ipynb
CHANGED
|
@@ -1,66 +1,47 @@
|
|
| 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 |
"source": [
|
| 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 |
-
"execution_count": null,
|
| 54 |
-
"outputs": []
|
| 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 +54,42 @@
|
|
| 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 +98,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 V11.8 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-11-8\n",
|
| 32 |
"import os\n",
|
| 33 |
"os.environ[\"LD_LIBRARY_PATH\"] += \":\" + \"/usr/local/cuda-11/lib64\"\n",
|
| 34 |
"os.environ[\"LD_LIBRARY_PATH\"] += \":\" + \"/usr/local/cuda-11.8/lib64\""
|
| 35 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
},
|
| 37 |
{
|
| 38 |
"cell_type": "markdown",
|
|
|
|
|
|
|
|
|
|
| 39 |
"metadata": {
|
| 40 |
"id": "0ZYRNb0AWLLW"
|
| 41 |
+
},
|
| 42 |
+
"source": [
|
| 43 |
+
"Installing & preparing requirements"
|
| 44 |
+
]
|
| 45 |
},
|
| 46 |
{
|
| 47 |
"cell_type": "code",
|
|
|
|
| 54 |
"!git clone https://github.com/C0untFloyd/roop-unleashed.git\n",
|
| 55 |
"%cd roop-unleashed\n",
|
| 56 |
"!mv config_colab.yaml config.yaml\n",
|
| 57 |
+
"!pip install -r requirements.txt"
|
| 58 |
]
|
| 59 |
},
|
| 60 |
{
|
| 61 |
"cell_type": "markdown",
|
|
|
|
|
|
|
|
|
|
| 62 |
"metadata": {
|
| 63 |
"id": "u_4JQiSlV9Fi"
|
| 64 |
+
},
|
| 65 |
+
"source": [
|
| 66 |
+
"Running roop-unleashed with default config"
|
| 67 |
+
]
|
| 68 |
},
|
| 69 |
{
|
| 70 |
"cell_type": "code",
|
| 71 |
+
"execution_count": null,
|
|
|
|
|
|
|
| 72 |
"metadata": {
|
| 73 |
"id": "Is6U2huqSzLE"
|
| 74 |
},
|
| 75 |
+
"outputs": [],
|
| 76 |
+
"source": [
|
| 77 |
+
"!python run.py"
|
| 78 |
+
]
|
| 79 |
},
|
| 80 |
{
|
| 81 |
"cell_type": "markdown",
|
| 82 |
+
"metadata": {
|
| 83 |
+
"id": "UdQ1VHdI8lCf"
|
| 84 |
+
},
|
| 85 |
"source": [
|
| 86 |
"### Download generated images folder\n",
|
| 87 |
"(only needed if you want to zip the generated output)"
|
| 88 |
+
]
|
|
|
|
|
|
|
|
|
|
| 89 |
},
|
| 90 |
{
|
| 91 |
"cell_type": "code",
|
| 92 |
+
"execution_count": null,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
"metadata": {
|
| 94 |
"colab": {
|
| 95 |
"base_uri": "https://localhost:8080/",
|
|
|
|
| 98 |
"id": "oYjWveAmw10X",
|
| 99 |
"outputId": "5b4c3650-f951-434a-c650-5525a8a70c1e"
|
| 100 |
},
|
|
|
|
| 101 |
"outputs": [
|
| 102 |
{
|
|
|
|
| 103 |
"data": {
|
| 104 |
+
"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 ",
|
| 105 |
"text/plain": [
|
| 106 |
"<IPython.core.display.Javascript object>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
]
|
| 108 |
},
|
| 109 |
+
"metadata": {},
|
| 110 |
+
"output_type": "display_data"
|
| 111 |
},
|
| 112 |
{
|
|
|
|
| 113 |
"data": {
|
| 114 |
+
"application/javascript": "download(\"download_789eab11-93d2-4880-adf3-6aceee0cc5f9\", \"fake_output.zip.zip\", 80125)",
|
| 115 |
"text/plain": [
|
| 116 |
"<IPython.core.display.Javascript object>"
|
|
|
|
|
|
|
|
|
|
| 117 |
]
|
| 118 |
},
|
| 119 |
+
"metadata": {},
|
| 120 |
+
"output_type": "display_data"
|
| 121 |
}
|
| 122 |
+
],
|
| 123 |
+
"source": [
|
| 124 |
+
"import shutil\n",
|
| 125 |
+
"import os\n",
|
| 126 |
+
"from google.colab import files\n",
|
| 127 |
+
"\n",
|
| 128 |
+
"def zip_directory(directory_path, zip_path):\n",
|
| 129 |
+
" shutil.make_archive(zip_path, 'zip', directory_path)\n",
|
| 130 |
+
"\n",
|
| 131 |
+
"# Set the directory path you want to download\n",
|
| 132 |
+
"directory_path = '/content/roop-unleashed/output'\n",
|
| 133 |
+
"\n",
|
| 134 |
+
"# Set the zip file name\n",
|
| 135 |
+
"zip_filename = 'fake_output.zip'\n",
|
| 136 |
+
"\n",
|
| 137 |
+
"# Zip the directory\n",
|
| 138 |
+
"zip_directory(directory_path, zip_filename)\n",
|
| 139 |
+
"\n",
|
| 140 |
+
"# Download the zip file\n",
|
| 141 |
+
"files.download(zip_filename+'.zip')\n"
|
| 142 |
]
|
| 143 |
}
|
| 144 |
+
],
|
| 145 |
+
"metadata": {
|
| 146 |
+
"accelerator": "GPU",
|
| 147 |
+
"colab": {
|
| 148 |
+
"collapsed_sections": [
|
| 149 |
+
"UdQ1VHdI8lCf"
|
| 150 |
+
],
|
| 151 |
+
"gpuType": "T4",
|
| 152 |
+
"provenance": []
|
| 153 |
+
},
|
| 154 |
+
"kernelspec": {
|
| 155 |
+
"display_name": "Python 3",
|
| 156 |
+
"name": "python3"
|
| 157 |
+
},
|
| 158 |
+
"language_info": {
|
| 159 |
+
"name": "python"
|
| 160 |
+
}
|
| 161 |
+
},
|
| 162 |
+
"nbformat": 4,
|
| 163 |
+
"nbformat_minor": 0
|
| 164 |
}
|
runMacOS.sh
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
# Check if we are in the correct repository directory
|
| 4 |
+
if [ ! -f "run.py" ]; then
|
| 5 |
+
echo "run.py not found!"
|
| 6 |
+
exit 1
|
| 7 |
+
fi
|
| 8 |
+
|
| 9 |
+
# Create a hidden Python 3.11 virtual environment in the .venv folder
|
| 10 |
+
VENV_DIR=".venv"
|
| 11 |
+
|
| 12 |
+
# Check if Python 3.11 is installed
|
| 13 |
+
if ! brew list --versions python@3.11 >/dev/null; then
|
| 14 |
+
echo "Python 3.11 is not installed. Please install it first."
|
| 15 |
+
exit 1
|
| 16 |
+
fi
|
| 17 |
+
|
| 18 |
+
# Use Python 3.11 to create the virtual environment
|
| 19 |
+
echo "Creating a virtual environment using Python 3.11..."
|
| 20 |
+
python3.11 -m venv $VENV_DIR
|
| 21 |
+
|
| 22 |
+
# Activate the virtual environment
|
| 23 |
+
echo "Activating the virtual environment..."
|
| 24 |
+
source "$VENV_DIR/bin/activate"
|
| 25 |
+
|
| 26 |
+
# Check if the activation was successful
|
| 27 |
+
if [ "$VIRTUAL_ENV" != "" ]; then
|
| 28 |
+
echo "Virtual environment activated successfully."
|
| 29 |
+
else
|
| 30 |
+
echo "Failed to activate the virtual environment."
|
| 31 |
+
exit 1
|
| 32 |
+
fi
|
| 33 |
+
|
| 34 |
+
# Install dependencies from requirements.txt
|
| 35 |
+
if [ -f "requirements.txt" ]; then
|
| 36 |
+
echo "Installing dependencies from requirements.txt..."
|
| 37 |
+
pip install -r requirements.txt
|
| 38 |
+
else
|
| 39 |
+
echo "requirements.txt not found. Skipping dependency installation."
|
| 40 |
+
fi
|
| 41 |
+
|
| 42 |
+
# Run roop-unleashed. This can take a while - especially at first startup...
|
| 43 |
+
echo "Running the run.py script..."
|
| 44 |
+
python run.py
|
| 45 |
+
|
| 46 |
+
# Deactivate the virtual environment after execution
|
| 47 |
+
echo "Deactivating the virtual environment..."
|
| 48 |
+
deactivate
|
settings.py
CHANGED
|
@@ -37,6 +37,7 @@ class Settings:
|
|
| 37 |
self.output_template = self.default_get(data, 'output_template', '{file}_{time}')
|
| 38 |
self.use_os_temp_folder = self.default_get(data, 'use_os_temp_folder', False)
|
| 39 |
self.output_show_video = self.default_get(data, 'output_show_video', True)
|
|
|
|
| 40 |
|
| 41 |
|
| 42 |
|
|
|
|
| 37 |
self.output_template = self.default_get(data, 'output_template', '{file}_{time}')
|
| 38 |
self.use_os_temp_folder = self.default_get(data, 'use_os_temp_folder', False)
|
| 39 |
self.output_show_video = self.default_get(data, 'output_show_video', True)
|
| 40 |
+
self.launch_browser = self.default_get(data, 'launch_browser', True)
|
| 41 |
|
| 42 |
|
| 43 |
|