First Step

Before We Begin

Preparing Our Tools

Before starting, we need to prepare the necessary tools for fine-tuning Stable Diffusion with LoRA.

References

Here are some useful resources to guide us through the process:

Required Tools

To set up our working environment, we need the following tools:

  • A GPU server - To run our code. In this guide, we use vast.ai.
  • PuTTY - To connect to the server via SSH.
  • WinSCP - For easy file transfer between the server and local PC.
  • A Hugging Face account.
  • Python 3 - Ensure Python 3 is installed on your system.

Connecting to the Server

Logging into the Server

  1. Go to https://cloud.vast.ai.
  2. Register and ensure your account has sufficient credit.

Creating an SSH Connection

  1. Install PuTTY as mentioned above. (Ubuntu and macOS users can use the terminal instead. Windows users can also use PowerShell, but PuTTY is recommended.)

  2. Watch the video below to learn how to create an SSH key using PuTTYgen:

    PuTTY

  3. After generating your SSH key, add the public key to your Vast.ai account as shown below:

    Public Key Setup

Selecting a Server

Once logged into Vast.ai, you will see an environment similar to the following:

Server Selection

  1. Choose a Template:
    • It is recommended to select Ubuntu 22.04.
    • Alternatively, choose another OS if needed.
  2. Choose a GPU:
    • For training and testing, NVIDIA RTX Series GPUs are recommended.
    • Good options include RTX 3060, RTX 3070, and RTX 3090, depending on your computational requirements.
  3. Select Server Type:
    • On-demand servers are recommended since interruptible servers may be disconnected unexpectedly.
  4. After selecting your server, click RENT to proceed.
  5. You will be redirected to a page that looks like the following.

!\[alt text\](vast-server.png)

  1. You should navigate to INSTANCES section
  2. Age of the server
  3. Connecting information will be available after loading. Such as IP address and port