Button / README.md
ChBysk's picture
Update README.md
111a5b8 verified
|
Raw
History Blame Contribute Delete
4.59 kB

A newer version of the Gradio SDK is available: 6.23.1

Upgrade
metadata
sdk: gradio
sdk-version: 6.20.0
python: app.py
python-version: 3.13

πŸ–ΌοΈ Image Gallery

A simple, Docker-based image gallery built with Gradio. No PHP, no Nginx, no complex configuration required.

Version Info

Component Version Updated
Python 3.13+ βœ… 2026-07-22
Gradio 6.20.0+ βœ… 2026-07-22
Pillow 10.2.0+ βœ… 2026-07-22
uvicorn β‰₯0.14.0 βœ… 2026-07-22
websockets β‰₯10.4 βœ… 2026-07-22

Note: Updated for full compatibility with HuggingFace Spaces and modern Gradio 6.x API. Previous version used Gradio 4.41.0 and Python 3.11.

Features

  • βœ… Upload Images - Drag and drop or select from your computer
  • πŸ” Search & Filter - Find images by filename
  • πŸ—‚οΈ Manage Images - Delete, organize, and browse your collection
  • πŸ“Š Image Metadata - View image dimensions, format, and upload date
  • 🐳 Docker Ready - One command to run anywhere
  • 🎨 Beautiful UI - Built with Gradio for a modern interface

Supported Image Formats

  • PNG
  • JPEG/JPG
  • GIF
  • WebP

Quick Start

Prerequisites

  • Docker & Docker Compose installed (Get Docker)
  • That's it! ✨

Run the Gallery

docker-compose up

The gallery will be available at: http://localhost:7860

First Time Setup

  1. Open http://localhost:7860 in your browser
  2. Go to the ⬆️ Upload tab
  3. Upload your first image
  4. Images are saved to images/gallery/

Directory Structure

image-gallery/
β”œβ”€β”€ app.py                 # Main Gradio application
β”œβ”€β”€ Dockerfile             # Docker image definition
β”œβ”€β”€ docker-compose.yml     # Docker Compose configuration
β”œβ”€β”€ requirements.txt       # Python dependencies
β”œβ”€β”€ README.md              # This file
└── images/
    β”œβ”€β”€ uploads/           # Temporarily uploaded images
    β”œβ”€β”€ gallery/           # Main gallery images
    └── metadata.json      # Image metadata (auto-generated)

Usage

πŸ“Έ Gallery Tab

  • View all images in a grid
  • Search by filename
  • Refresh to see new images

⬆️ Upload Tab

  • Upload new images from your computer
  • Supported formats: PNG, JPG, GIF, WebP
  • Images are stored and indexed automatically

βš™οΈ Manage Tab

  • Select and delete images
  • View all gallery images
  • Organize your collection

Advanced Usage

Stop the Gallery

docker-compose down

View Logs

docker-compose logs -f

Access Images Directly

Your images are stored in the images/gallery/ directory on your computer. You can:

  • Add images directly to this folder
  • Back them up
  • Share them

Change Port

Edit docker-compose.yml and change the port mapping:

ports:
  - "8080:7860"  # Access at http://localhost:8080

Increase Upload Limit

The default upload limit is 5GB per file. To change it, edit docker-compose.yml:

environment:
  - GRADIO_MAX_FILE_SIZE=10gb

Deployment

Render.com (Free)

  1. Push to GitHub
  2. Connect to Render.com
  3. Select "Docker" as the environment
  4. Deploy automatically

Other Cloud Platforms

  • AWS (ECS)
  • Google Cloud (Cloud Run)
  • Azure (Container Instances)
  • DigitalOcean (App Platform)
  • Heroku (with buildpack)

All support Docker out of the box!

Performance Tips

  • Store images on a fast disk (SSD recommended)
  • Limit gallery size to 10,000+ images for best performance
  • Use image optimization tools to reduce file sizes
  • Enable browser caching for faster loading

Troubleshooting

Port 7860 Already In Use

Change the port in docker-compose.yml:

ports:
  - "7861:7860"  # Use port 7861 instead

Images Not Appearing

  1. Refresh the page (F5)
  2. Click the πŸ”„ Refresh button in the Gallery tab
  3. Ensure images are in images/gallery/ directory

Container Won't Start

Check the logs:

docker-compose logs gallery

Upload Fails

  • Check file size (default 5GB limit)
  • Verify file format is supported
  • Ensure disk has free space

Development

Local Development (No Docker)

# Install dependencies
pip install -r requirements.txt

# Run locally
python app.py

Then open http://localhost:7860

Modify the Gallery

Edit app.py and restart:

docker-compose restart

License

MIT License - See LICENSE file

Support

For issues or feature requests, please open an issue on GitHub.


Built with ❀️ using Gradio and Docker