Stable Diffusion is a deep learning, text-to-image model that has been publicly released. It uses a variant of the diffusion model called latent diffusion. There are a few popular Open Source repos that create an easy to use web interface for typing in the prompts, managing the settings and seeing the images.
This guide will use the webui Github repo maintained by Automatic111 here. The docker image used comes pre-loaded with Stable Diffusion v2.1, and it is possible to upload other models once you have the instance up and running. The recommend template will also setup Jupyter so you can use a web browser to download and upload files to the instance.
For all questions or issues with the web GUI, the project has a readme with links.
The first thing to do if you are new to Vast is to create an account. Then head to the Billing tab and add credits. This is pretty self-explanatory. Vast uses Stripe to processes credit card payments and also accepts major cryptocurrencies through Crypto.com. $20 should be enough to start. You pre-buy credits on Vast and then spend them down.
Click on the Change template button from the create page. Then click on the edit button on the Stable Diffusion template. We will need to set a username and password, so it is very important that we edit our template to set a username and password first.
If you do not set up a username and password it will default the login to username: user & password: password
To set your username and password, go to the beginning of the Docker Options and add the arguments
-e WEB_USER=YOUR_USERNAME -e WEB_PASSWORD=YOUR_PASSWORD
as shown below.
You can also add the variables one by one in the env input
Stable Diffusion can only run on a 1X GPU so select 1X from the filter menu on the top nav. This will then update the interface to show 1X GPU offers. Note that some Stable Diffusion models require large amounts of GPU VRAM. For max settings, you want more GPU RAM. Use the GPU RAM slider in the interface to find offers with over 20GB. We recommend an A6000, A40 or A100 if you want to max the Stable Diffusion settings.
If available, it is also best to pick a host with the datacenter label, as those machines are more reliable.
Click the blue RENT button to spin up the instance. You can then watch progress from the instance tab.
The instance can take 3-5 minutes to start. Once it is ready a blue connect button will appear. Click on that to open the web gui.
The web gui can take an additional 1-2 minutes to load. If you click on the connect button and get a blank page or error, simply wait 1-2 minutes and reload the page.
And there you go! Please read the Automatic111 documentation for how the web GUI works.
There are buttons to save and download the artwork, and also to zip it up.
The recommended template has both SSH and Jupyter HTTPS launch modes enabled. To upload a model checkpoint, the simplest way is to click on the Jupyter button on the instances card to open Jupyter and then to upload the .ckpt file to the /workspace/stable-diffusion-webui/models/Stable-diffusion directory.
The Jupyter HTTPS launch mode will require you to install a certificate on your local machine. On macOS, this is not optional. Windows and Linux will show an error if the cert is not installed but there is a way to click through the error. To install the Jupyter certificate for Vast, follow the instructions here.
To use SSH, you will need to create an SSH key and upload the public portion to Vast. Learn more here.
For Linux/macOS users, SCP will also work.
After you generate your artwork and are done with the instance, you have a few options. If you STOP the instance using the stop button, you will no longer pay the hourly GPU charges. However you will still incur storage charges because the data is still stored on the host machine. When you hit the START button to restart the instance, you are also not guaranteed that you can rent the GPU as someone else might have rented it while it was stopped. We don't recommend that you stop an instance once done.
To incur no other charges you have to DESTROY the instance using the trash can icon. We recommend you destroy instances so as not to incur storage charges while you are not using the system.
Have fun!