Campus-AI / docs /README1.md
realruneet's picture
Rename docs/README.md to docs/README1.md
15161d9 verified

A newer version of the Gradio SDK is available: 6.12.0

Upgrade

CampusGen AI โ€“ Universal Event Poster Generator

AI-powered event poster generation for any occasion in 10โ€“15 seconds.

Overview

CampusGen AI generates professional event posters using:

  • Stable Diffusion XL 1.0 fine-tuned on 55,000+ diverse poster images via LoRA
  • Llama 3.3 70B (Groq) for natural language event understanding
  • 5 Generation Modes: Textโ†’Poster, Reference Image, Img2Img, Inpainting, HD Upscale
  • GPU-accelerated pipeline from data processing to training
  • Zero cost deployment on Hugging Face Spaces (ZeroGPU)

Architecture

User Input โ†’ Groq LLM (prompt engineering) โ†’ SDXL 1.0 + LoRA โ†’ HD Upscale โ†’ Poster
                                                  โ†‘
                                     IP-Adapter (reference style)
                                     Img2Img (transform)
                                     Inpainting (edit regions)
Component Details
Base Model Stable Diffusion XL 1.0 (2.6B params)
Fine-tuning Dual-Phase LoRA rank 32, bf16, 55K+ images
Curriculum Phase 1 (Layout/1e-4) โ†’ Phase 2 (Perfection/2e-5)
Dataset 55,000+ curated event posters, 55 categories
LLM Llama 3.3 70B via Groq (free tier)
Upscaler Real-ESRGAN 4x
Deployment HF Spaces with ZeroGPU

Categories (55 themes)

Group Subcategories
Tech Fest Hackathons, AI/ML, robotics, coding competitions, cyber security
Cultural Event Dance, music, drama, art exhibitions, poetry
College Events Annual days, freshers, farewell, alumni meets
Sports Cricket, football, basketball, athletics, chess
Festivals Diwali, Holi, Navratri, Ganesh Chaturthi, Eid, Christmas
Workshops Seminars, webinars, training sessions, conferences
Social Blood donation, charity, environmental drives
Entertainment DJ nights, concerts, standup comedy, movie screenings

Project Structure

campus-ai/
โ”œโ”€โ”€ configs/
โ”‚   โ””โ”€โ”€ config.yaml                  # Master configuration
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ pinterest_scraper.py         # Image scraper (CPU, network-bound)
โ”‚   โ”œโ”€โ”€ quality_filter.py            # GPU-accelerated quality filtering
โ”‚   โ”œโ”€โ”€ caption_generator.py         # Florence-2 captioning (GPU)
โ”‚   โ”œโ”€โ”€ split_dataset.py             # Dataset splitting (1000/200/100)
โ”‚   โ”œโ”€โ”€ test_checkpoint.py           # LoRA inference testing
โ”‚   โ””โ”€โ”€ create_training_config.py    # ai-toolkit config generator
โ”œโ”€โ”€ deployment/
โ”‚   โ”œโ”€โ”€ app.py                       # 5-tab Gradio application
โ”‚   โ”œโ”€โ”€ pipelines.py                 # Pipeline manager (SDXL/IP-Adapter/ESRGAN)
โ”‚   โ”œโ”€โ”€ prompt_engine.py             # Groq LLM prompt engineering
โ”‚   โ”œโ”€โ”€ requirements.txt             # HF Space dependencies
โ”‚   โ””โ”€โ”€ README.md                    # HF Space card
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ raw/                         # Scraped images (~1900/theme)
โ”‚   โ”œโ”€โ”€ processed/                   # GPU-filtered images (~1300/theme)
โ”‚   โ”œโ”€โ”€ final/                       # Captioned dataset (GPU)
โ”‚   โ”œโ”€โ”€ train/                       # 1000 images/theme
โ”‚   โ”œโ”€โ”€ val/                         # 200 images/theme
โ”‚   โ””โ”€โ”€ test/                        # 100 images/theme
โ”œโ”€โ”€ models/                          # Trained LoRA checkpoints
โ”œโ”€โ”€ outputs/                         # Generated outputs
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ README.md                    # This file
โ”‚   โ”œโ”€โ”€ SETUP.md                     # Setup guide
โ”‚   โ””โ”€โ”€ PIPELINE.md                  # Execution pipeline
โ””โ”€โ”€ requirements.txt                 # Local dependencies

Quick Start

# 1. Setup
conda create -n campus-ai python=3.11
conda activate campus-ai
pip install -r requirements.txt

# 2. Data Pipeline
python scripts/pinterest_scraper.py      # ๐Ÿ–ฅ๏ธ CPU  โ€” Scrape posters (overnight)
python scripts/quality_filter.py         # ๐ŸŽฎ GPU  โ€” Filter quality (~5 min)
python scripts/caption_generator.py      # ๐ŸŽฎ GPU  โ€” Generate captions (overnight)
python scripts/split_dataset.py          # ๐Ÿ–ฅ๏ธ CPU  โ€” Split 1000/200/100

# 3. Training
python scripts/create_training_config.py # ๐Ÿ–ฅ๏ธ CPU  โ€” Generate ai-toolkit config
cd ai-toolkit && python run.py ../configs/train_sdxl_lora.yaml  # ๐ŸŽฎ GPU  โ€” Phase 1 (Layout)
cd ai-toolkit && python run.py ../configs/train_sdxl_lora_phase2.yaml # ๐ŸŽฎ GPU โ€” Phase 2 (Perfection)

# 4. Deploy
huggingface-cli upload YOUR_USERNAME/campus-ai-poster-sdxl models/sdxl/lora/ .  # Upload LoRA
# Push deployment/ files to HF Space

See SETUP.md for detailed instructions. See PIPELINE.md for step-by-step execution guide.

Hardware

  • GPU: NVIDIA RTX 5070 Ti (12GB VRAM) โ€” used for quality filtering, captioning, training
  • CPU: Intel Ultra 9 275HX (24 cores) โ€” used for scraping, splitting
  • RAM: 32GB
  • Training time: ~7.5 hours (Phase 1 Layout + Phase 2 Perfection)

Author

M Runeet Kumar โ€“ Ashta/Indore, MP, India

License

MIT