A modern, web-based photo frame application designed for viewing and managing AI-generated images and videos. Features a sleek glassmorphism UI with real-time updates, smart NSFW filtering, and responsive navigation.
It monitors a folder for new images and videos and updates image and video files in real-time. This allows you to use a second monitor as a photo frame or video player as you generate new images and videos.
- Home Page - Latest image hero view with scrollable thumbnail sidebar
- Gallery - Grid layout with folder navigation and live preview panel
- Picture Frame - Minimalist full-screen slideshow mode
- Glassmorphism design with smooth animations
- Dark theme optimized for media viewing
- Responsive layout for all screen sizes
- Customizable thumbnail sizes
- Real-time Monitoring - Auto-detects new images via file system watcher
- AI Content Scan - Automatic NSFW detection using NudeNet AI (configurable sensitivity)
- NSFW Filtering - Keyword and folder-based safe mode with passphrase lock option
- Authentication - Optional passphrase login with user/admin roles
- Media Type Filters - Toggle between photos, videos, or all
- Recursive Folder Navigation - Browse nested folder structures
- Metadata Extraction - Displays AI generation parameters including prompts, seed, model, and LoRAs used
- Search Functionality - Search by filename, prompt, or model
- Infinite Scroll - Smooth loading for large libraries
- Delete & Flag NSFW - Remove or flag unwanted images directly from the interface
- Arrow Keys - Navigate between images
- Escape - Close preview panels
- Full keyboard navigation on all pages
- Plays MP4, WebM, MOV, AVI, MKV, and M4V formats
- Custom video controls with auto-hide (no native browser overlays)
- Frame navigation - First frame, step back/forward, last frame buttons
- Save frame - Capture current frame as JPEG image
- Native fullscreen - Fullscreen video with browser's native player
- Seekable progress bar with time display
- Mobile-responsive layout with larger touch targets
- Auto-play with loop
π See CHANGELOG.md for recent updates and fixes.
- Python 3.8 or higher
- Modern web browser (Chrome, Firefox, Edge, Safari)
- Windows, macOS, or Linux
git clone https://github.com/MrKuenning/AI-Photo-Framepip install -r requirements.txtDependencies:
- Flask 2.3.3
- watchdog 3.0.0
- Pillow 10.0.0
- python-magic 0.4.27
- python-magic-bin 0.4.14
- flask-paginate 2023.10.8
- flask-socketio 5.3.6
- itsdangerous 2.1.0+ (for session management)
- NudeNet 3.0.0+ (optional, for AI content scanning)
Edit config.ini to set your image folder path:
[App]
# Path to the main image folder to monitor
IMAGE_FOLDER = E:\AI\OutputSee Configuration section for all options.
python Image_Viewer.pyOr use the included batch file:
Start Server.batNavigate to: http://localhost:5000
The config.ini file allows you to customize the application:
# Main folder to monitor (can contain subfolders)
IMAGE_FOLDER = E:\AI\Output
# Initial load limit for performance
MAX_INITIAL_LOAD = 100# Keywords to identify NSFW content (comma-separated)
NSFW_KEYWORDS = adult, nsfw, bikini, ...
# Folders containing NSFW content (comma-separated)
NSFW_FOLDERS = NSFW, VIDEO, FAMILY# Thumbnail size for home page
HOME_THUMBNAIL_SIZE = 200x200
# Thumbnail size for gallery
GALLERY_THUMBNAIL_SIZE = 200x200
# Preview size for gallery hero view
GALLERY_PREVIEW_SIZE = 800x800# Enable login requirement
AUTH_ENABLED = false
# User passphrase - can access UI but restricted from delete/flag if admin pass is set
USER_PASSPHRASE =
# Admin passphrase - full access including delete/flag
ADMIN_PASSPHRASE =
# Require passphrase to disable Safe Mode
SAFEMODE_LOCK_ENABLED = false
SAFEMODE_PASSPHRASE = Permission Matrix:
| Role | Delete/Flag | Safe Mode Toggle |
|---|---|---|
| No Auth | β | β |
| User (with admin pass set) | β | π Needs passphrase |
| Admin | β | β |
AI - Photo Frame 5/App1/
βββ Image_Viewer.py # Main Flask application
βββ config.ini # Configuration file
βββ requirements.txt # Python dependencies
βββ Start Server.bat # Quick start script
β
βββ templates/ # HTML templates
β βββ base.html # Base template with header/navigation
β βββ index.html # Home page
β βββ gallery.html # Gallery view
β βββ frame.html # Picture frame mode
β
βββ static/ # Static assets
βββ css/
β βββ style.css # Main stylesheet
βββ js/
βββ gallery.js # Gallery page logic
βββ index_navigation.js # Home page navigation
βββ hero_metadata.js # Metadata loading
βββ live_update.js # Real-time updates
βββ infinite-scroll.js # Infinite scroll
βββ media_filter.js # Media type filtering
βββ display_mode_toggle.js # Safe mode toggle
βββ ... (other utilities)
- View the latest image in large hero view
- Scroll through thumbnails in the sidebar
- Click thumbnails to view in hero
- Use Previous/Next buttons or arrow keys to navigate
- Toggle Safe Mode in the header to filter NSFW content
- Filter by Photos or Videos using media type buttons

- Browse images in a responsive grid layout
- Click any image to open in preview panel
- Navigate with Previous/Next buttons
- Use folder breadcrumbs to navigate directory structure
- Search by filename, prompt, or model name
- Adjust thumbnail size with the slider
- Delete images directly from the preview panel

- Minimalist full-screen view
- Auto-updates when new images arrive
- Perfect for dedicated display setups
- Click Go to Home to return to main view
- Full-Screen button for mobile devices

The application extracts metadata from AI-generated image filenames in this format:
YYYY-MM-DD.HH-MM-SS - seed - dimensions - model - prompt.extension
Example:
2025-12-12.14-30-45 - 123456 - 1024x1024 - stable-diffusion-xl - a beautiful sunset over mountains.jpg
Extracted metadata:
- Date/Time:
2025-12-12.14-30-45 - Seed:
123456 - Dimensions:
1024x1024 - Model:
stable-diffusion-xl - Prompt:
a beautiful sunset over mountains
The application includes a built-in NSFW filter:
- Toggle Safe Mode via the switch in the header
- Images/videos are filtered based on:
- Keywords in the prompt (configured in
config.ini) - Folder names (configured in
config.ini)
- Keywords in the prompt (configured in
- Filtered content is hidden from all views
- Setting persists in browser cookies
- Check Python version:
python --version(needs 3.8+) - Verify all dependencies installed:
pip install -r requirements.txt - Check if port 5000 is already in use
- Verify
IMAGE_FOLDERpath inconfig.iniis correct - Check folder permissions
- Ensure images are in supported formats (JPG, PNG, GIF, BMP, WebP)
- Check browser console for WebSocket errors
- Ensure Flask-SocketIO is installed
- Try refreshing the browser
- Reduce
MAX_INITIAL_LOADinconfig.ini - Clear browser cache
- Close unused tabs
Edit static/css/style.css and modify CSS variables:
:root {
--color-primary: #6366f1;
--color-background: #0f172a;
--color-surface: #1e293b;
/* ... */
}- Thumbnail sizes: Adjust sliders in the UI or change defaults in
config.ini - Grid columns: Modify CSS grid settings in
style.css - Spacing: Update CSS spacing variables
Contributions are welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
- Improve documentation
This project is provided as-is for personal use.
- Built with Flask web framework
- UI inspired by modern design trends
- Bootstrap Icons for iconography
- Watchdog library for file system monitoring
Enjoy your AI Photo Frame! πΈβ¨