Upload 2 files
Browse filesFiles changed (2)
- requirements.txt+12-12
- roop-unleashed.ipynb+90-126
123456789101112131415161718--extra-index-url https://download.pytorch.org/whl/cu118numpy==1.26.4gradio==4.32.1opencv-python==4.9.0.80onnx==1.16.0insightface==0.7.3psutil==5.9.6torch==2.1.2+cu118; sys_platform != 'darwin'torch==2.1.2; sys_platform == 'darwin'torchvision==0.16.2+cu118; sys_platform != 'darwin'torchvision==0.16.2; sys_platform == 'darwin'onnxruntime==1.17.1; sys_platform == 'darwin' and platform_machine != 'arm64'onnxruntime-silicon==1.16.3; sys_platform == 'darwin' and platform_machine == 'arm64'onnxruntime-gpu==1.17.1; sys_platform != 'darwin'tqdm==4.66.4ftfyregex123456789101112131415161718--extra-index-url https://download.pytorch.org/whl/cu124numpy==1.26.4gradio==5.9.1opencv-python-headless==4.10.0.84onnx==1.16.1insightface==0.7.3albucore==0.0.16psutil==5.9.6torch==2.5.1+cu124; sys_platform != 'darwin'torch==2.5.1; sys_platform == 'darwin'torchvision==0.20.1+cu124; sys_platform != 'darwin'torchvision==0.20.1; sys_platform == 'darwin'onnxruntime==1.20.1; sys_platform == 'darwin' and platform_machine != 'arm64'onnxruntime-silicon==1.20.1; sys_platform == 'darwin' and platform_machine == 'arm64'onnxruntime-gpu==1.20.1; sys_platform != 'darwin'tqdm==4.66.4ftfyregex
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666 unmodified lines7374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321332 unmodified lines136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208{"nbformat": 4,"nbformat_minor": 0,"metadata": {"colab": {"provenance": [],"gpuType": "T4","collapsed_sections": ["UdQ1VHdI8lCf"]},"kernelspec": {"name": "python3","display_name": "Python 3"},"language_info": {"name": "python"},"accelerator": "GPU"},"cells": [{"cell_type": "markdown","source": ["# Colab for roop-unleashed - Gradio version\n","https://github.com/C0untFloyd/roop-unleashed\n"],"metadata": {"id": "G9BdiCppV6AS"}},{"cell_type": "markdown","source": ["Install CUDA V11.8 on Google Cloud Compute"],"metadata": {"id": "CanIXgLJgaOj"}},{"cell_type": "code","source": ["!apt-get -y update\n","!apt-get -y install cuda-toolkit-11-8\n","import os\n","os.environ[\"LD_LIBRARY_PATH\"] += \":\" + \"/usr/local/cuda-11/lib64\"\n","os.environ[\"LD_LIBRARY_PATH\"] += \":\" + \"/usr/local/cuda-11.8/lib64\""],"metadata": {"id": "96GE4UgYg3Ej"},"execution_count": null,"outputs": []},{"cell_type": "markdown","source": ["Installing & preparing requirements"],"metadata": {"id": "0ZYRNb0AWLLW"}},{"cell_type": "code",6 unmodified lines"!git clone https://github.com/C0untFloyd/roop-unleashed.git\n","%cd roop-unleashed\n","!mv config_colab.yaml config.yaml\n","!pip install pip install -r requirements.txt"]},{"cell_type": "markdown","source": ["Running roop-unleashed with default config"],"metadata": {"id": "u_4JQiSlV9Fi"}},{"cell_type": "code","source": ["!python run.py"],"metadata": {"id": "Is6U2huqSzLE"},"execution_count": null,"outputs": []},{"cell_type": "markdown","source": ["### Download generated images folder\n","(only needed if you want to zip the generated output)"],"metadata": {"id": "UdQ1VHdI8lCf"}},{"cell_type": "code","source": ["import shutil\n","import os\n","from google.colab import files\n","\n","def zip_directory(directory_path, zip_path):\n"," shutil.make_archive(zip_path, 'zip', directory_path)\n","\n","# Set the directory path you want to download\n","directory_path = '/content/roop-unleashed/output'\n","\n","# Set the zip file name\n","zip_filename = 'fake_output.zip'\n","\n","# Zip the directory\n","zip_directory(directory_path, zip_filename)\n","\n","# Download the zip file\n","files.download(zip_filename+'.zip')\n"],"metadata": {"colab": {"base_uri": "https://localhost:8080/",2 unmodified lines"id": "oYjWveAmw10X","outputId": "5b4c3650-f951-434a-c650-5525a8a70c1e"},"execution_count": null,"outputs": [{"output_type": "display_data","data": {"text/plain": ["<IPython.core.display.Javascript object>"],"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"," "]},"metadata": {}},{"output_type": "display_data","data": {"text/plain": ["<IPython.core.display.Javascript object>"],"application/javascript": ["download(\"download_789eab11-93d2-4880-adf3-6aceee0cc5f9\", \"fake_output.zip.zip\", 80125)"]},"metadata": {}}]}]}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950516 unmodified lines5859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021032 unmodified lines106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172{"cells": [{"cell_type": "markdown","metadata": {"id": "G9BdiCppV6AS"},"source": ["# Colab for roop-unleashed - Gradio version\n","https://github.com/C0untFloyd/roop-unleashed\n"]},{"cell_type": "markdown","metadata": {"id": "CanIXgLJgaOj"},"source": ["Install CUDA 12.6 & CUDNN on Google Cloud Compute"]},{"cell_type": "code","execution_count": null,"metadata": {"id": "96GE4UgYg3Ej"},"outputs": [],"source": ["!apt-get -y update\n","!apt-get -y install cuda-toolkit-12-6\n","!apt-get -y install cudnn9-cuda-12\n","\n","import os\n","os.environ[\"LD_LIBRARY_PATH\"] += \":\" + \"/usr/local/cuda-12/lib64\"\n","os.environ[\"LD_LIBRARY_PATH\"] += \":\" + \"/usr/local/cuda-12.6/lib64\"\n","\n","!nvcc --version"]},{"cell_type": "markdown","metadata": {"id": "0ZYRNb0AWLLW"},"source": ["Installing & preparing requirements"]},{"cell_type": "code",6 unmodified lines"!git clone https://github.com/C0untFloyd/roop-unleashed.git\n","%cd roop-unleashed\n","!mv config_colab.yaml config.yaml\n","!pip install -r requirements.txt"]},{"cell_type": "markdown","metadata": {"id": "u_4JQiSlV9Fi"},"source": ["Running roop-unleashed with default config"]},{"cell_type": "code","execution_count": null,"metadata": {"id": "Is6U2huqSzLE"},"outputs": [],"source": ["import torch\n","print(f\"PyTorch version: {torch.__version__}\")\n","print(f\"CUDA device is available: {torch.cuda.is_available()}\")\n","\n","!python run.py"]},{"cell_type": "markdown","metadata": {"id": "UdQ1VHdI8lCf"},"source": ["### Download generated images folder\n","(only needed if you want to zip the generated output)"]},{"cell_type": "code","execution_count": null,"metadata": {"colab": {"base_uri": "https://localhost:8080/",2 unmodified lines"id": "oYjWveAmw10X","outputId": "5b4c3650-f951-434a-c650-5525a8a70c1e"},"outputs": [{"data": {"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 ","text/plain": ["<IPython.core.display.Javascript object>"]},"metadata": {},"output_type": "display_data"},{"data": {"application/javascript": "download(\"download_789eab11-93d2-4880-adf3-6aceee0cc5f9\", \"fake_output.zip.zip\", 80125)","text/plain": ["<IPython.core.display.Javascript object>"]},"metadata": {},"output_type": "display_data"}],"source": ["import shutil\n","import os\n","from google.colab import files\n","\n","def zip_directory(directory_path, zip_path):\n"," shutil.make_archive(zip_path, 'zip', directory_path)\n","\n","# Set the directory path you want to download\n","directory_path = '/content/roop-unleashed/output'\n","\n","# Set the zip file name\n","zip_filename = 'fake_output.zip'\n","\n","# Zip the directory\n","zip_directory(directory_path, zip_filename)\n","\n","# Download the zip file\n","files.download(zip_filename+'.zip')\n"]}],"metadata": {"accelerator": "GPU","colab": {"collapsed_sections": ["UdQ1VHdI8lCf"],"gpuType": "T4","provenance": []},"kernelspec": {"display_name": "Python 3","name": "python3"},"language_info": {"name": "python"}},"nbformat": 4,"nbformat_minor": 0}
requirements.txt+12-12
roop-unleashed.ipynb+90-126