Skip to content

🎨 AI-powered web service that creates personalized letter banners where each letter is styled based on individual interests and themes. Built with FastAPI, OpenAI DALL-E, and modern web technologies.

Notifications You must be signed in to change notification settings

davehedengren/letter-banner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Letter Banner Generator Web Service

A beautiful web service that creates stylized letter banners where each letter is inspired by interests and themes of your choice. Each letter is generated with a transparent background, perfect for cutting out and taping together to create personalized banners, educational materials, or decorative prints.

🌟 Features

  • Interest-Based Letters: Each letter is inspired by personal interests and themes
  • Transparent Backgrounds: Letters generated with transparent backgrounds for easy cutting and assembly
  • Color Palette Selection: Choose from curated color palettes or create custom ones
  • Print-Ready Output: Generates high-quality 300dpi images optimized for 8.5x11" printing
  • Multiple Formats: Individual letters, combined banner layout, and PDF compilation
  • Real-Time Progress: Track generation progress as letters are being created
  • Cost Transparency: See exactly what each banner costs to generate
  • Web Interface: Easy-to-use web UI for non-technical users

πŸš€ Quick Start

For Replit Deployment

  1. Clone/Fork this repository to Replit
  2. Set up environment variables:
    • Create a .env file with your OpenAI API key:
    OPENAI_API_KEY=your_openai_api_key_here
    
  3. Install dependencies:
    pip install -r requirements.txt
  4. Run the application:
    python main.py

For Local Development

  1. Clone the repository:

    git clone <repository-url>
    cd streamlit-letter-banner
  2. Create virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Set up environment:

    • Create .env file with your OpenAI API key
  5. Run the application:

    python main.py

🎨 How It Works

  1. Enter a Name: Type the name you want to create a banner for
  2. Choose Objects: For each letter, specify what object it should be shaped like
  3. Select Colors: Pick from beautiful pre-made color palettes or create your own
  4. Generate: Watch as AI creates each stylized letter
  5. Download: Get your print-ready banner files

πŸ“ Project Structure

streamlit-letter-banner/
β”œβ”€β”€ letter_banner/              # Core letter generation logic
β”‚   β”œβ”€β”€ main.py                # Original CLI interface
β”‚   β”œβ”€β”€ openai_client.py       # OpenAI API integration
β”‚   β”œβ”€β”€ color_palettes.py      # Color palette definitions
β”‚   β”œβ”€β”€ config.py              # Configuration settings
β”‚   β”œβ”€β”€ layout.py              # Banner layout creation
β”‚   └── utils.py               # Utility functions
β”œβ”€β”€ web/                       # Web service components
β”‚   β”œβ”€β”€ app.py                 # Flask/FastAPI web application
β”‚   β”œβ”€β”€ static/                # CSS, JavaScript, images
β”‚   └── templates/             # HTML templates
β”œβ”€β”€ main.py                    # Web service entry point
β”œβ”€β”€ requirements.txt           # Python dependencies
└── README.md                  # This file

🎨 Available Color Palettes

  • Earthy Vintage: Warm beige, forest greens, browns, orange sunset
  • Ocean Breeze: Deep navy, seafoam green, sandy beige, coral pink
  • Autumn Harvest: Burnt orange, golden yellow, deep red, chestnut
  • Spring Garden: Soft pink, sage green, lavender, butter yellow
  • Modern Minimal: Charcoal gray, soft blue, warm white
  • Sunset Desert: Terracotta, dusty rose, sage green, golden yellow
  • Bright Blue: Electric blue, bright yellow, lime green, orange
  • Custom: Create your own color combination

πŸ”§ API Endpoints

POST /api/generate-banner

Start banner generation process

{
  "name": "HELLO",
  "letters": [
    {"letter": "H", "object": "house"},
    {"letter": "E", "object": "elephant"},
    {"letter": "L", "object": "lion"},
    {"letter": "L", "object": "leaf"},
    {"letter": "O", "object": "octopus"}
  ],
  "color_palette": "earthy_vintage"
}

GET /api/status/{job_id}

Check generation progress

GET /api/download/{job_id}/{file_type}

Download generated files (banner, pdf, individual letters)

πŸ› οΈ Technical Details

  • Image Generation: Uses OpenAI's DALL-E for creating stylized letters
  • Output Format: 1024x1024 PNG images at 300dpi
  • Print Optimization: Designed for 8.5x11" paper printing
  • File Management: Automatic cleanup of temporary files
  • Progress Tracking: Real-time updates during generation process

πŸ“‹ Requirements

  • Python 3.8+
  • OpenAI API key
  • Modern web browser
  • Internet connection for AI generation

πŸš€ Deployment

Replit

  • Simply fork this repository to Replit
  • Add your OpenAI API key to the secrets/environment
  • Click "Run" - Replit handles the rest!

Other Platforms

  • Works on any platform supporting Python web applications
  • Ensure environment variables are properly configured
  • May need to adjust file paths for different hosting environments

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

πŸ“„ License

[Add your preferred license here]

⚠️ Important Notes

  • Requires valid OpenAI API key with image generation access
  • Generation time varies based on complexity (typically 30-60 seconds per letter)
  • Large names (8+ letters) may take several minutes to complete
  • Files are automatically cleaned up after download

πŸ†˜ Support

If you encounter issues:

  1. Check that your OpenAI API key is valid and has sufficient credits
  2. Ensure all dependencies are installed correctly
  3. Check the console logs for detailed error messages
  4. Create an issue for persistent problems

Created with ❀️ for making beautiful, personalized letter banners

About

🎨 AI-powered web service that creates personalized letter banners where each letter is styled based on individual interests and themes. Built with FastAPI, OpenAI DALL-E, and modern web technologies.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published