Skip to content

MrKuenning/AI-Photo-Frame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

51 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Real Time - AI Photo Frame

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.

Version Python Flask

✨ Features

πŸ“Έ Three Viewing Modes

  • 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

🎨 Modern UI

  • Glassmorphism design with smooth animations
  • Dark theme optimized for media viewing
  • Responsive layout for all screen sizes
  • Customizable thumbnail sizes

πŸ” Smart Features

  • 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

⌨️ Keyboard Controls

  • Arrow Keys - Navigate between images
  • Escape - Close preview panels
  • Full keyboard navigation on all pages

🎬 Video Support

  • 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.

πŸ“‹ Requirements

  • Python 3.8 or higher
  • Modern web browser (Chrome, Firefox, Edge, Safari)
  • Windows, macOS, or Linux

πŸš€ Installation - Tested on Windows 11

1. Clone or Download

git clone https://github.com/MrKuenning/AI-Photo-Frame

2. Install Dependencies

pip install -r requirements.txt

Dependencies:

  • 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)

3. Configure

Edit config.ini to set your image folder path:

[App]
# Path to the main image folder to monitor
IMAGE_FOLDER = E:\AI\Output

See Configuration section for all options.

4. Run

python Image_Viewer.py

Or use the included batch file:

Start Server.bat

5. Open Browser

Navigate to: http://localhost:5000

βš™οΈ Configuration

The config.ini file allows you to customize the application:

Global Settings

# Main folder to monitor (can contain subfolders)
IMAGE_FOLDER = E:\AI\Output

# Initial load limit for performance
MAX_INITIAL_LOAD = 100

NSFW Filtering

# Keywords to identify NSFW content (comma-separated)
NSFW_KEYWORDS = adult, nsfw, bikini, ...

# Folders containing NSFW content (comma-separated)
NSFW_FOLDERS = NSFW, VIDEO, FAMILY

Display Settings

# 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

Authentication (Optional)

# 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 βœ… βœ…

πŸ“‚ Project Structure

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)

🎯 Usage

Home Page

  • 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 2025-12-12 00_36_48-

Gallery

  • 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 2025-12-12 00_37_28-Greenshot

Picture Frame Mode

  • 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 2025-12-12 00_37_41-Greenshot

πŸ”§ Filename Format

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

πŸ›‘οΈ Safe Mode

The application includes a built-in NSFW filter:

  1. Toggle Safe Mode via the switch in the header
  2. Images/videos are filtered based on:
    • Keywords in the prompt (configured in config.ini)
    • Folder names (configured in config.ini)
  3. Filtered content is hidden from all views
  4. Setting persists in browser cookies

πŸ› Troubleshooting

Server won't start

  • 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

Images not appearing

  • Verify IMAGE_FOLDER path in config.ini is correct
  • Check folder permissions
  • Ensure images are in supported formats (JPG, PNG, GIF, BMP, WebP)

Real-time updates not working

  • Check browser console for WebSocket errors
  • Ensure Flask-SocketIO is installed
  • Try refreshing the browser

High memory usage with large libraries

  • Reduce MAX_INITIAL_LOAD in config.ini
  • Clear browser cache
  • Close unused tabs

🎨 Customization

Changing Colors

Edit static/css/style.css and modify CSS variables:

:root {
    --color-primary: #6366f1;
    --color-background: #0f172a;
    --color-surface: #1e293b;
    /* ... */
}

Adjusting Layout

  • 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

🀝 Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest features
  • Submit pull requests
  • Improve documentation

πŸ“ License

This project is provided as-is for personal use.

πŸ™ Acknowledgments

  • 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! πŸ“Έβœ¨

About

A lightweight AI Photo / Video Frame that automaticly refreshes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors