Running Disco Diffusion on a Windows instance
Disco Diffusion (aka DD) is a clip-guided diffusion model that can generate amazing images from text prompt
Last updated
Disco Diffusion (aka DD) is a clip-guided diffusion model that can generate amazing images from text prompt
Last updated
Disco Diffusion can be found at http://discodiffusion.com/
You can deploy a GPU on our Marketplace to your specific configurations based on cost, RAM, storage, and vCPUs.
Disco Diffusion works on NVIDIA GPUs with at least 12 GB of dedicated VRAM on a Windows OS, so make sure your Cloud GPU adheres to these settings. You will also need at least 80 GB in your Disk to run Windows.
Follow this tutorial to RDP into your Cloud GPU
In your Remote Desktop, download all of the following:
Cuda enabled GPU
Latest Nvidia Drivers
CUDA Toolkit for your version
Python (Anaconda)
We use anaconda to make it easier to manage different projects
Virtual python evironment and versioning
Anaconda also includes Jupyter Notebook pre-installed
Git
version control manager for code
we just use it to download repos from GitHub
When installing select the option add to system PATH
FFmpeg
Video encoding tool library
we use this mainly to turn image sequences into videos
Must be on system PATH
ImageMagick
software suite for displaying, creating, converting, modifying, and editing raster images.
used in some projects but handy to have already installed
Wget
used to download models for projects
Windows users need this verison
https://eternallybored.org/misc/wget/
download the .exe
create a new folder to put the .exe in (prefereable on the root of your C:/ drive)
e.g C:/wget/wget.exe
open Control Panel and search for environment variables
select the one with the shield icon Edit the system environment variables
click the button at the bottom Environment Virables...
under System variables
find the and select the path
variable
click Edit...
button and then New
add the new path to folder the .exe is in
e.g C:/wget
once entered click Ok
on each window until all 3 are closed
for the new env variables to be used you must reopen a new Command Prompt window
cURL
used to download models, some projects use this instead of wget
Latest versions of windows have cURL pre installed
Older versions that dont include cURL use this one
Linux users can just use the package in their distributions
Run the following in powershell on your remote desktop:
Setup and activate conda env
conda create --name disco-diffusion python=3.9
conda activate disco-diffusion
Install a few more pip dependencies
pip install ipykernel opencv-python pandas regex matplotlib ipywidgets
Install Pytorch with CUDA support!
be sure to install a version with GPU support!
example
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
Download disco diffusion repo
git clone https://github.com/alembics/disco-diffusion.git
change directories into the downloaded repo
cd disco-diffusion
You can now use any of the following methods to run disco diffusion:
[PYTHON .py]
plain python file wich means you will need to go into the file and manually find all the configuration options and change them as needed, an easy way to go about this is searching the document for #@param
lines and edit ones containing that comment trailing the lines e.g. use_secondary_model = True #@param {type: 'boolean'}
.
Run disco diffusion
python -m disco.py
[VS .py/.ipynb]
running the .ipynb file directly in VS also requires editing of the #@param
lines in the code
Download Visual Studio
Open the .ipynb file in VS
ENJOY!
for more interactivity see the tutorial using jupyter extension
[VS + Jupyter extension .py/.ipynb]
using the jupyter extension in VS we can get individual cell support to run the either the .ipynb or the .py file also requires editing of the #@param
lines in the code
Download Visual Studio
Get the Jupyter Notebook extensions
head over to the extensions tab in VS code
search for jupyter
and install the one from Microsoft
after this is enabled the notebook should have several new toolbars and features
you can actually run both the .py file or .ipynb file which both support individual cells
ENJOY!
[Jupyter .ipynb]
using Jupyter notebooks to run the .ipynb file also requires editing of the #@param
lines in the code
with anaconda installed you should already have jupyter notebook installed if you dont simple run:
pip install jupyterlab
Run Jupyter
jupyter notebook
this launches the juptyer notebook in the current directory and open a webpage
under the Files
tab double click and open the file named Disco-Diffusion.ipynb
ENJOY!
[Colab w/ Jupyter using colab links]
using Google Colab as a front end to get the nice view of all the editable fields while using Jupyter as middleware to connect your local resources
with anaconda installed you should already have jupyter notebook installed if you dont simple run:
pip install jupyterlab
Connect to colab front end
pip install --upgrade jupyter_http_over_ws>=0.0.7
Enable the extension for jupyter
jupyter serverextension enable --py jupyter_http_over_ws
Start the jupyter server
jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --port=8888 --NotebookApp.port_retries=0 --no-browser
Inside google colab click the down Arrow icon next to the Connect button to view more options
Select connect to Local Runtime and enter the Local Host Url that was printed in the console when we started jupyter server
ENJOY!
You can now use Disco Diffusion on your Tensordock instance. For examples of how to use, follow any of these tutorials: