No description
Find a file
DJP 8be6a1ecab Initial commit: Topaz Labs Gigapixel Image Upscaler web application
- PHP-based web interface for image upscaling using Topaz Labs API
- Multiple image upload with batch processing support
- AI model selection (Standard V2, Low Resolution V2, CGI, etc.)
- Output resolution options from 2K to 8K
- Face enhancement feature
- Real-time job tracking and status monitoring
- Bulk download functionality
- Dark mode toggle
- Microsoft authentication integration
- Comprehensive README with installation instructions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 14:15:31 -04:00
css Initial commit: Topaz Labs Gigapixel Image Upscaler web application 2025-09-17 14:15:31 -04:00
js Initial commit: Topaz Labs Gigapixel Image Upscaler web application 2025-09-17 14:15:31 -04:00
.DS_Store Initial commit: Topaz Labs Gigapixel Image Upscaler web application 2025-09-17 14:15:31 -04:00
config.php Initial commit: Topaz Labs Gigapixel Image Upscaler web application 2025-09-17 14:15:31 -04:00
download.php Initial commit: Topaz Labs Gigapixel Image Upscaler web application 2025-09-17 14:15:31 -04:00
index.php Initial commit: Topaz Labs Gigapixel Image Upscaler web application 2025-09-17 14:15:31 -04:00
process.php Initial commit: Topaz Labs Gigapixel Image Upscaler web application 2025-09-17 14:15:31 -04:00
README.md Initial commit: Topaz Labs Gigapixel Image Upscaler web application 2025-09-17 14:15:31 -04:00
status.php Initial commit: Topaz Labs Gigapixel Image Upscaler web application 2025-09-17 14:15:31 -04:00

Topaz Labs Gigapixel Image Upscaler

A web-based interface for upscaling images using the Topaz Labs Gigapixel API. This application provides an intuitive web interface for users to upload images and enhance them using AI-powered upscaling technology.

Features

  • Multiple Image Upload: Upload multiple images simultaneously for batch processing
  • AI Model Selection: Choose from various AI models including:
    • Standard V2
    • Low Resolution V2
    • CGI
    • High Fidelity V2
    • Text Refine
    • Auto (automatically selects best model)
  • Flexible Output Resolution: Support for 2K through 8K output resolutions
  • Face Enhancement: Optional face enhancement for portrait images
  • Real-time Job Tracking: Monitor processing status with live updates
  • Bulk Download: Download multiple processed images at once
  • Job History: Keep track of previous processing jobs
  • Dark Mode: Toggle between light and dark themes
  • Microsoft Authentication: Secure access using Microsoft Identity Platform

Prerequisites

  • Web Server: Apache or Nginx with PHP support
  • PHP: Version 7.4 or higher
  • PHP Extensions:
    • curl - for API communication
    • json - for JSON handling
    • fileinfo - for file type detection
  • Topaz Labs API Key: Required for image processing
  • Microsoft Azure App Registration: For authentication (optional)

Installation

1. Clone or Download the Application

git clone https://bitbucket.org/zlalani/btg-sandbox-image-scale.git
cd btg-sandbox-image-scale

2. Configure Your Web Server

Apache Configuration

Ensure your Apache server has PHP enabled and place the application in your web root directory (typically /var/www/html/ or /htdocs/).

Nginx Configuration

Configure Nginx to serve PHP files through PHP-FPM:

server {
    listen 80;
    server_name your-domain.com;
    root /path/to/image-scale;
    index index.php index.html;
    
    location ~ \.php$ {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

3. Configure the Application

API Configuration

Edit config.php and replace the placeholder API token with your Topaz Labs API key:

<?php
define('API_TOKEN', 'your-topaz-labs-api-key-here');
define('MAX_CONCURRENT_UPLOADS', 10);
define('POLL_INTERVAL', 5000); // 5 seconds

Microsoft Authentication (Optional)

If using Microsoft authentication, update the configuration in index.php:

const msalConfig = {
    auth: {
        clientId: "your-azure-app-client-id",
        authority: "https://login.microsoftonline.com/your-tenant-id",
        redirectUri: "https://your-domain.com/image-scale/"
    }
};

4. Set File Permissions

Ensure proper file permissions for the web server:

# Set ownership to web server user (e.g., www-data, apache)
sudo chown -R www-data:www-data /path/to/image-scale/

# Set appropriate permissions
sudo chmod -R 755 /path/to/image-scale/
sudo chmod -R 644 /path/to/image-scale/*.php

5. PHP Configuration

Ensure your PHP configuration allows file uploads by checking these settings in php.ini:

file_uploads = On
upload_max_filesize = 100M
post_max_size = 100M
max_execution_time = 300
memory_limit = 256M

Restart your web server after making changes to php.ini.

Usage

  1. Access the Application: Navigate to your application URL in a web browser
  2. Authentication: If Microsoft authentication is enabled, log in with your Microsoft account
  3. Upload Images: Select one or more image files (supported formats: JPG, JPEG, PNG, BMP, TIFF, WEBP)
  4. Configure Settings:
    • Choose output resolution (2K-8K)
    • Select AI model
    • Enable/disable face enhancement
  5. Process Images: Click "Upload and Process" to start the enhancement
  6. Monitor Progress: Track job status in the "Current Jobs" section
  7. Download Results: Once processing is complete, download individual images or use bulk download

API Endpoints

The application uses the following Topaz Labs API endpoints:

  • Enhancement: https://api.topazlabs.com/image/v1/enhance/async
  • Status Check: https://api.topazlabs.com/image/v1/status/{process_id}
  • Download: https://api.topazlabs.com/image/v1/download/{process_id}

File Structure

image-scale/
├── index.php          # Main application interface
├── config.php         # Configuration settings
├── process.php        # Image processing handler
├── status.php         # Job status checker
├── download.php       # File download handler
├── css/
│   └── style.css     # Application styling
├── js/
│   └── script.js     # Frontend JavaScript functionality
└── README.md         # This file

Security Considerations

  • API Key Protection: Never expose your Topaz Labs API key in client-side code
  • File Upload Validation: The application validates file types and sizes
  • Authentication: Microsoft authentication provides secure access control
  • HTTPS: Always use HTTPS in production environments

Troubleshooting

Common Issues

  1. File Upload Errors

    • Check PHP upload limits in php.ini
    • Verify web server has write permissions to temp directory
  2. API Connection Issues

    • Verify your Topaz Labs API key is valid
    • Check network connectivity and firewall settings
  3. Authentication Problems

    • Verify Microsoft Azure app registration settings
    • Check redirect URI matches your application URL

Debug Information

The application includes debug information in API responses. Check browser developer tools for detailed error messages.

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/new-feature)
  3. Commit your changes (git commit -am 'Add new feature')
  4. Push to the branch (git push origin feature/new-feature)
  5. Create a Pull Request

License

This project is proprietary software. All rights reserved.

Support

For technical support or questions about this application, please contact the development team or create an issue in the repository.

Version History

  • v1.0.0 - Initial release with basic upscaling functionality
  • v1.1.0 - Added Microsoft authentication and bulk operations
  • v1.2.0 - Enhanced UI with dark mode and improved job tracking