A sleek, local AI image generation app powered by FLUX.2 Klein running on Ollama.
- Local AI Image Generation - Generate images entirely on your machine using FLUX.2 Klein
- Beautiful Gallery - Browse, organize, and manage your generated images
- Categories - Create custom categories to organize your creations
- Favorites - Mark your best images as favorites
- Image Details - View prompts, timestamps, and navigate through images
- Keyboard Shortcuts - Quick generation with
⌘ + Enter, navigate gallery with arrow keys - Clean UI - Minimalist black & white design with a widget-style interface
┌─────────────────────────────────────────────────────────────┐
│ ○ Generate ○ Gallery (12) │
├─────────────────────────────────────────────────────────────┤
│ │
│ Create an image │
│ Powered by FLUX.2 Klein │
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Describe your image... │ │
│ │ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ ✦ Generate │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
- macOS (FLUX image generation currently only works on macOS)
- Node.js 18 or higher
- Ollama installed and running
git clone https://github.com/lalomorales22/local-ai-image-generation.git
cd local-ai-image-generation./start.shThis will:
- Check for and install Ollama if needed
- Pull the FLUX.2 Klein model (~5.7GB)
- Install all dependencies
- Start the app and open it in your browser
If you prefer to install manually:
# Download from https://ollama.com or use Homebrew
brew install ollamaollama pull x/flux2-klein# Install server dependencies
npm install
# Install client dependencies
cd client && npm install && cd ..npm run devThe app will be available at http://localhost:5173
To start the app by simply typing flux in your terminal:
# For zsh (default on macOS)
echo 'alias flux="/path/to/local-ai-image-generation/flux"' >> ~/.zshrc
source ~/.zshrc
# For bash
echo 'alias flux="/path/to/local-ai-image-generation/flux"' >> ~/.bashrc
source ~/.bashrcReplace /path/to/local-ai-image-generation with the actual path where you cloned the repo.
# Create a symlink in /usr/local/bin
sudo ln -s /path/to/local-ai-image-generation/flux /usr/local/bin/fluxNow you can start the app from anywhere:
flux- Click the Generate tab
- Enter a description of the image you want to create
- Click Generate or press
⌘ + Enter - Wait for the image to be generated (typically 15-60 seconds depending on your hardware)
FLUX.2 Klein excels at:
- Text rendering - "A neon sign reading 'OPEN 24 HOURS' in a rainy alley"
- UI mockups - "Mobile app interface showing account balance with clean iOS design"
- Product photography - "Luxury watch on dark velvet, dramatic side lighting"
- Specific colors - Use hex codes like "gradient background #FF6B35 to #F7C59F"
- Categories - Click
+ Newto create custom categories - Favorites - Click the heart icon to favorite images
- Navigation - Use
←→arrow keys to browse in the modal - Actions - Download, copy prompt, or use prompt for new generation
| Shortcut | Action |
|---|---|
⌘ + Enter |
Generate image |
← → |
Navigate images in modal |
Esc |
Close modal |
local-ai-image-generation/
├── server/
│ └── index.js # Express backend with Ollama integration
├── client/
│ ├── src/
│ │ ├── App.jsx # Main React component
│ │ └── index.css # Tailwind styles
│ └── package.json
├── public/
│ └── images/ # Generated images stored here
├── gallery.json # Gallery metadata
├── flux # CLI launcher script
├── start.sh # Installation & start script
└── package.json
To use a different FLUX model variant, edit server/index.js:
// Default model
const DEFAULT_MODEL = 'x/flux2-klein'
// For higher quality (larger, slower)
const DEFAULT_MODEL = 'x/flux2-klein:9b'- Backend: Edit
PORTinserver/index.js(default: 3001) - Frontend: Edit
server.portinclient/vite.config.js(default: 5173)
Make sure the FLUX model is installed:
ollama list | grep flux
# Should show: x/flux2-klein:latestIf not, pull it:
ollama pull x/flux2-kleinMake sure Ollama is running:
ollama serveCheck that you're on macOS. FLUX image generation currently only works on macOS due to MLX requirements.
Generation speed depends on your Mac's hardware:
- M1/M2/M3 Macs: 15-45 seconds per image
- Intel Macs: May be significantly slower or unsupported
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - feel free to use this project for personal or commercial purposes.
- FLUX.2 Klein by Black Forest Labs
- Ollama for local model hosting
- Built with React, Vite, Tailwind CSS, and Framer Motion
Made with ✦ by @lalomorales22