Skip to content

kylemath/Generation

Repository files navigation

🎨 Local AI Image Generator

Generate cutting-edge images locally using state-of-the-art AI models like FLUX.1 and Stable Diffusion XL.

✨ Features

  • 🚀 Fast Models: SDXL Turbo (ultra-fast) and Stable Diffusion XL
  • 💻 Local Generation: Everything runs on your machine - no cloud dependencies
  • 🎯 Text-to-Image: Generate images from text descriptions
  • 🖼️ Image-to-Image: Transform existing images with text prompts
  • 🌐 Web Interface: Easy-to-use Gradio web interface
  • ⚡ Command Line: Direct CLI for batch processing
  • 🎛️ Full Control: Adjust steps, guidance, seeds, dimensions

🛠️ Installation

  1. Clone and setup:

    cd /Users/kylemathewson/Generation
    source venv/bin/activate
  2. Dependencies are already installed in the virtual environment

🚀 Usage

Web Interface (Recommended)

Launch the user-friendly web interface:

source venv/bin/activate
python simple_interface.py

Or use the launcher: ./launch.sh

Then open http://localhost:7860 in your browser.

Command Line Interface

Generate images directly from the terminal:

Text-to-Image with SDXL Turbo (ultra-fast):

source venv/bin/activate
python image_generator.py -p "A majestic dragon soaring over a medieval castle at sunset" --model flux -o dragon.png

Continuous Generation with High Variability:

python image_generator.py -p "fantasy castle" --model flux --continuous --prompt-variations --temperature 1.5 --prefix castle_variations

Text-to-Image with SDXL (faster):

python image_generator.py -p "A cyberpunk cityscape with neon lights" --model sdxl -s 20 -g 7.5 -o cyberpunk.png

Image-to-Image (SDXL only):

python image_generator.py -p "Transform into a watercolor painting" -i input.jpg --model sdxl --strength 0.7 -o watercolor.png

📋 Command Line Options

--prompt, -p        Text prompt (required)
--negative, -n      Negative prompt (what to avoid)
--model, -m         Model: 'flux' (best quality) or 'sdxl' (faster)
--width, -w         Image width (default: 1024)
--height, -h        Image height (default: 1024)
--steps, -s         Inference steps (flux: 4, sdxl: 20)
--guidance, -g      Guidance scale (flux: 0.0, sdxl: 7.5)
--seed              Random seed for reproducibility
--input-image, -i   Input image for img2img
--strength          Transformation strength for img2img (0.0-1.0)
--output, -o        Output filename
--continuous, -c    Continuous generation mode (press ENTER to stop)
--base-seed         Base seed for continuous mode (increments each iteration)
--prefix            Filename prefix for continuous mode
--prompt-variations Add random style/mood variations to prompt
--temperature       Creativity temperature (0.5-2.0, higher = more varied)

🎯 Model Comparison

Model Quality Speed VRAM Use Case
FLUX (Turbo) ⭐⭐⭐⭐ ⭐⭐⭐⭐⭐ Medium Ultra-fast, 1-step generation
SDXL ⭐⭐⭐⭐ ⭐⭐⭐⭐ Medium High quality, img2img support

💡 Pro Tips

  1. FLUX (Turbo) Settings: Use 1 step, guidance=0.0 for ultra-fast results
  2. SDXL Settings: Use 20+ steps, guidance=7.5 for quality
  3. Negative Prompts: Add "blurry, low quality, distorted" to improve quality
  4. Seeds: Use the same seed for consistent results
  5. Image-to-Image: Start with strength=0.7, adjust based on desired change

🖥️ System Requirements

  • macOS: Apple Silicon (M1/M2/M3) recommended for MPS acceleration
  • Memory: 8GB+ RAM, 16GB+ recommended
  • Storage: 10GB+ free space for models

🔧 Troubleshooting

Model download slow? Models download automatically on first use (~6GB each).

Out of memory? Try:

  • Using SDXL instead of FLUX
  • Reducing image dimensions (512x512)
  • Closing other applications

Poor quality? Try:

  • More inference steps
  • Better prompts with more detail
  • Negative prompts to avoid unwanted elements

📁 Project Structure

Generation/
├── venv/                   # Virtual environment
├── image_generator.py      # CLI interface
├── gradio_interface.py     # Web interface
├── requirements.txt        # Dependencies
└── README.md              # This file

🎨 Example Prompts

Photography:

  • "A professional portrait of a person, natural lighting, shallow depth of field, 85mm lens"

Art Styles:

  • "A landscape painting in the style of Van Gogh, swirling brushstrokes, vibrant colors"

Fantasy:

  • "A magical forest with glowing mushrooms, fairy lights, ethereal atmosphere, fantasy art"

Architecture:

  • "Modern glass house in the forest, minimalist design, large windows, natural lighting"

Enjoy creating amazing images locally! 🎉

Preview

Project screenshot

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published