Now Writing Weekly Blogs As I Travel

--:--
--:--

AI Image Generation

This weekend, I delved into AI image generation technologies.... using stable diffusion

This weekend, I delved into AI image generation technologies. Previously, I've experimented with DALL·E and Midjourney, but I was curious to see if there was something out there that I could run on my own equipment, allowing for more hacking around.

That's when I stumbled upon Stable Diffusion. Developed by Stability AI, Stable Diffusion is an open-source tool that, much like Midjourney and DALL·E, generates images from text descriptions. The open-source nature of Stable Diffusion means you can run it directly on your hardware, eliminating ongoing costs and rate limits, and keeping your creations private.

At its core, Stable Diffusion utilizes latent diffusion, a technique in AI that starts with a canvas of random digital "noise" and incrementally refines it into a detailed image based on textual prompts. This method is particularly effective for quick image generation on more cost-effective hardware.

Latent space

I managed to successfully run it on my MacBook Pro M1 Max and, even got some results, on my MacBook Air as well.

The installation process is straightforward, you clone a github repo and run a few commands.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 # Install deps brew install cmake protobuf rust [email protected] git wget # Close stable diffusion webui git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui # Download a model checkpoint from the web, huggingface is a good resource https://huggingface.co/models?pipeline_tag=text-to-image&sort=downloads then place it into stable-diffusion-webui/models/Stable-diffusion # Enter the cloned repo cd stable-diffusion-webui # Run the installation ./webui.sh

After setup, you're greeted with a user interface where you can adjust settings such as models and LORAs (topics we'll explore in future discussions). Then, simply input your text and watch as an image materializes.

Stable Diffusion WebUI

If you end up running stable diffusion, let me know how you get on!