cd ..

Do LLMs Dream of Electric Sheep?

Building a Fully Local Creative AI Image Generator

As AI continues to evolve, I've been fascinated by the question: what happens when we let AI systems dream?

The Electric Sheep Project

Philip K. Dick's iconic novel "Do Androids Dream of Electric Sheep?" (which inspired Blade Runner) raised profound questions about artificial consciousness. As LLMs continue to advance, I found myself wondering: what might their "dreams" look like if visualized?

This curiosity led me to create a Python application that continuously generates creative images using AI. It uses Ollama for generating creative prompts and Flux for image generation - allowing your machine to dream up endless artistic possibilities!

Like electric sheep in the dreams of androids, this project explores the boundaries between human and artificial creativity. What does AI imagine when we let it dream?

Why I Built This

As someone with a 4090 GPU sitting idle for large stretches of time, I couldn't help but think about the untapped potential. Why not put those compute cycles to creative use? This project allows your machine to generate art during idle times, turning unused computing power into an endless stream of AI-generated creativity.

The open-source approach was essential to me - making this technology accessible to anyone with suitable hardware rather than locked behind subscription paywalls or API usage limits.

The Architecture: 100% Local, 100% Private, 100% Cross-Platform

One of the most important aspects of this project is that it runs completely locally on Mac, Windows, and Linux systems:

The system uses Ollama for generating the initial creative prompts, which are then processed through a plugin system that introduces additional context and randomness (what I like to call "creative entropy"). Finally, these enhanced prompts are sent to Flux, a powerful image generation model that runs entirely on your local GPU.

Introducing Creative Entropy

The plugin system is the heart of what makes this project special. I've found that introducing the right amount of entropy leads to more creative and interesting results. The plugins provide contextual information that gets seamlessly integrated into prompts:

Time of Day: Adapts prompts to morning, afternoon, evening, or night themes

Holiday Awareness: Detects upcoming holidays and incorporates them into prompts

Art Style Variation: Rotates through 90+ distinct art styles to keep generations fresh

Lora Integration: Seamlessly incorporates custom models as subjects! You can add your likeness or an art style from fal.ai or another marketplace of LORAs.

Day of Week: Adjusts prompts based on the current day

Add your own plugin! (send me a PR!)

This contextual information creates a feedback loop similar to what we see in agentic frameworks. The system doesn't just generate images; it can adapt and based on the context provided by these plugins.

Subscribe now

Model Variants and Hardware Flexibility

The system supports two diffusion models - Flux model variants with different licensing terms:

This flexibility allows users to choose the appropriate model based on their needs and licensing requirements.

Apple Silicon Support

I've implemented full support for Apple Silicon (M1/M2/M3/M4) Macs using PyTorch's Metal Performance Shaders (MPS) backend. The system automatically detects Apple Silicon and uses the appropriate GPU acceleration:

Float16 precision option for improved performance on Apple Silicon

Memory management through unified memory architecture

Optimized settings for Schnell model on Apple chips

Combined with support for NVIDIA GPUs on Windows/Linux, this ensures the project runs efficiently across all major platforms and hardware configurations.

The Weekly Drop Series

I've been using this system to generate my "Weekly Drop" series on Substack:

Weekly Image Drop 07-2025

Weekly Image Drop 06-2025

Weekly Image Drop 04-2025

My Windows scheduler detects idle cycles and automatically generates images, giving me a fresh batch of AI art to curate and share each week. It's become a fascinating way to showcase the creative potential of AI systems when given the freedom to "dream."

Sharing Your Machine's Dreams

The project includes a host-image feature that allows you to share your AI-generated masterpieces with the world. Using Cloudflare Workers and R2 storage, your latest generated image can be available on a public endpoint - perfect for embedding in websites, sharing on social media, or creating an always-updating display of your AI art.

This can easily be turned into a slideshow with a raspberry pi.

Cross-Platform Implementation

A key achievement of this project is its true cross-platform nature:

Windows: Leverages NVIDIA CUDA for maximum performance on RTX cards

Mac: Full native support for Apple Silicon via Metal Performance Shaders

Linux: Compatible with various distributions using CUDA acceleration

I've specifically optimized the Mac implementation to take advantage of Apple's unified memory architecture, with special attention to the unique performance characteristics of M-series chips.

What's Next?

I'll be expanding this project in several ways:

The project is open source and available on GitHub. I invite you to try it, contribute, and see what your machine dreams up!