0% found this document useful (0 votes)
450 views4 pages

Roop-Unleashed Ipynb

This document details the steps to install and run a deep learning model called roop-unleashed on Google Colab using a GPU. It clones the roop-unleashed GitHub repository, installs requirements, runs the model with default settings, and downloads the generated output folder.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
450 views4 pages

Roop-Unleashed Ipynb

This document details the steps to install and run a deep learning model called roop-unleashed on Google Colab using a GPU. It clones the roop-unleashed GitHub repository, installs requirements, runs the model with default settings, and downloads the generated output folder.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

{

"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 update\n",
"!apt-get 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",
"execution_count": null,
"metadata": {
"id": "t1yPuhdySqCq"
},
"outputs": [],
"source": [
"!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/",
"height": 17
},
"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": {}
}
]
}
]
}

You might also like