austinsymbolofquality.com

Effortlessly Set Up Stable Diffusion AI at Home Without Coding

Written on

Getting Started with Stable Diffusion

Recently, StabilityAI unveiled Stable Diffusion, a robust AI image generator that operates on standard graphics cards. The best part? You don’t need any programming skills to get started; everything is laid out step-by-step.

Prerequisites

Before you begin, ensure that your hardware meets the following requirements:

  • An NVIDIA GPU with a minimum of 4GB VRAM
  • At least 10GB of free space on your hard drive

Step 1: Setting Up Git and Python Environment

Step 2: Download the Model Weights

Downloading Stable Diffusion library

Once there, navigate to the “Files and versions” tab, locate the checkpoint file, and download it. Note that this file is over 4GB, so feel free to grab a coffee while it downloads.

Step 3: Acquire the Stable Diffusion Repository

Download the source code from this GitHub repository titled "Stable Diffusion Dream Script," which is a modified version of the original code created by lstein.

Extracting Stable Diffusion files

After downloading, extract the files to your local machine. Within the “ldm” folder, create a new folder named “stable-diffusion-v1.” Copy the model file sd-v1–4.ckpt from Step 2 into this new folder and rename it to model.ckpt.

Step 4: Activate the Environment

Open the Anaconda command prompt and navigate to the “stable-diffusion-main” folder.

Activating the environment in Anaconda

Next, you’ll need to activate several Python packages. Execute the following commands:

(base) ~/stable-diffusion-main$ conda env create -f environment.yaml

(base) ~/stable-diffusion-main$ conda activate ldm

(ldm) ~/stable-diffusion-main$

The first command will download all the necessary dependencies, which may take some time due to the large file sizes. Once that’s done, activate the environment with the command conda activate ldm, indicated by the “ldm” prefix in your command prompt.

Step 5: Load Required Models

Now, load a couple of small machine learning models necessary for Stable Diffusion by running:

(ldm) ~/stable-diffusion-main$ python scripts/preload_models.py

Ensure that you receive a “success” message before proceeding.

Step 6: Generate Images

You are now ready to start creating images! Use the command:

(ldm) ~/stable-diffusion-main$ python scripts/dream.py

This will prompt you to enter your desired image description.

This video tutorial, titled "How to run Stable Diffusion at Home - Install Tutorial & Free Online Access! FAST & EASY," provides a detailed guide on setting up the system.

With my setup, an NVIDIA GeForce RTX 3060 Ti with 8GB RAM, it took approximately 12.82 seconds to generate a 512x512 image.

Generated image using Stable Diffusion

The outcome isn’t too shabby, right?

Conclusion

That wraps up the basic steps! In the upcoming days, I will write another article detailing how to tweak the image parameters, such as resolution and seed, to achieve different results. Feel free to experiment!

If you encounter any issues or wish to showcase your artwork, don’t hesitate to leave a comment.

Update: 09/12/2022

I recently published a new guide on running Stable Diffusion with a GUI, which simplifies the process. The new repository is also an optimized version of the original.

Check out the video "Install Stable Diffusion Locally (Quick Setup Guide) - YouTube" for a quick walkthrough of the installation process.

Share the page:

Twitter Facebook Reddit LinkIn

-----------------------

Recent Post:

Hidden Java Classes You Should Discover for Better Coding

Explore six lesser-known Java classes that can enhance your coding experience and efficiency.

Embracing Patience: The Key to a Fulfilling Future

Discover how patience can transform your life and help you build a brighter future amidst the pressures of modern society.

# Insights from My Life Journey: Meta-Awareness and Learning

Discover my journey through meta-awareness and meta-learning, and how they shape my identity and growth.

Achieving the Extraordinary: A Journey of Growth and Learning

This piece discusses the importance of soft skills, mentorship, and the right environment in achieving extraordinary goals.

Crafting Impactful Writing: It's Not Just About You

Discover how to shift your writing focus from self-interest to creating value for your readers.

Ignite Spiritual Renewal: 7 Transformative Techniques for Self-Discovery

Discover seven transformative techniques that enhance self-discovery and spiritual renewal, guiding you toward a more meaningful life.

Python's Ascendancy: The Language Redefining Programming

Discover how Python transformed programming with its simplicity, versatility, and robust community support.

Embracing Happiness Without Justification: A Philosophical Journey

Explore the concept of finding happiness without reasons, challenging societal expectations and embracing mindfulness.