Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available: 6.12.0
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