AI-powered photo merging web app - Create beautiful memories by merging your past and present photos!
- 📸 Dual Photo Upload - Upload childhood and current photos
- 🎨 AI-Powered Merging - Intelligent photo blending with face detection
- 🎭 Multiple Styles - Classic, Cinematic, Vintage, Photoreal
- ⚙️ Advanced Controls - Blend amount, opacity, background effects
- 👀 Before/After Comparison - Interactive slider
- 📥 Download & Share - Save or share your memories
- 📱 Fully Responsive - Works on mobile, tablet, and desktop
- ♿ Accessible - WCAG compliant with keyboard navigation
MemoryHug/
├── frontend-files/ # Frontend (HTML/CSS/JS)
│ ├── index.html # Main page
│ ├── app.js # JavaScript logic
│ ├── styles.css # Styling
│ └── config.js # Configuration
│
├── backend/ # Backend API (FastAPI)
│ ├── app.py # Main FastAPI app
│ ├── config.py # Configuration
│ ├── requirements.txt # Python dependencies
│ ├── Dockerfile # Docker configuration
│ ├── utils/ # Image processing utilities
│ └── models/ # AI model integration
│
└── README.md # This file
# Clone repository
git clone https://github.com/ayax-khan/MemoryHug.git
cd MemoryHug/frontend-files
# Open in browser
# Simply open index.html in your browser
# OR use a local server:
python -m http.server 8080
# Visit: http://localhost:8080cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run server
python app.py
# API will run at: http://localhost:7860- Start backend (port 7860)
- Update frontend
config.js:const API_BASE_URL = 'http://localhost:7860';
- Open frontend in browser
- Auto-deploys from
mainbranch - Live at: https://memoryhug.vercel.app
- Deployed as Docker container
- API at: https://zeroday-00-past-present-backend.hf.space
- HTML5, CSS3 (Modern)
- Vanilla JavaScript (ES6+)
- Google Fonts (Inter, Poppins)
- Framework: FastAPI (Python)
- Image Processing: Pillow, OpenCV
- Face Detection: Haar Cascade (CPU-friendly)
- AI Model: Stable Diffusion (optional, fallback blending default)
- Deployment: Docker on Hugging Face Spaces
- Modern browser (Chrome 90+, Firefox 88+, Safari 14+)
- Python 3.10+
- Dependencies in
backend/requirements.txt
- Upload - User uploads childhood and current photos
- Face Detection - OpenCV detects faces in both images
- Feature Extraction - Extract face embeddings
- AI Merging - Generate merged image (AI model or fallback blend)
- Post-Processing - Apply lighting match, effects, opacity
- Download - User downloads or shares the result
Edit frontend-files/app.js:
const API_BASE_URL = 'YOUR_BACKEND_URL';Edit backend/config.py:
TARGET_SIZE = (512, 512) # Image processing size
MAX_FILE_SIZE = 10 * 1024 * 1024 # 10MB limit- Use clear, front-facing photos
- Ensure good lighting
- Image should be at least 256x256 pixels
- Backend allows all origins by default
- For production, update CORS settings in
backend/app.py
- Fallback blending: ~2-5 seconds (CPU)
- With AI model: ~5-15 seconds (GPU recommended)
MIT License - Free for personal and commercial use
- Face detection: OpenCV Haar Cascades
- Fonts: Google Fonts (Inter, Poppins)
- Icons: Custom SVG icons
Ayax Khan - GitHub
Contributions welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
For issues or questions:
- Open an issue on GitHub
- Check existing issues for solutions
Made with ❤️ for preserving memories