Skip to content

ItsNotAlexy/AIU

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AIU — AI Image Upscaler

Upscale low-quality images using Real-ESRGAN and auto-fit them to any device screen.

Setup

python -m venv venv
venv\Scripts\activate          # Windows
pip install -r requirements.txt

The Real-ESRGAN binary (realesrgan-ncnn-vulkan) is downloaded automatically on first run.

Test (Python only)

python test_upscale.py --image tests/test.png
python test_upscale.py --image tests/test.png --device iphone_15_pro --fit cover
python test_upscale.py --scale 2
python test_upscale.py --list-devices

Run the web app

python run_server.py

Open http://localhost:8000

API

Method Endpoint Description
GET /api/health Health check
GET /api/devices List device presets
POST /api/upscale Upscale an image
POST /api/upscale-device Upscale + fit to device screen

POST /api/upscale

Field Type Default Notes
file file Image upload
scale int 4 2 or 4
output_format str PNG PNG/JPEG/WEBP

POST /api/upscale-device

Same as above, plus:

Field Type Default Notes
device str Preset key (e.g. iphone_15_pro)
screen_width int Custom width (CSS px)
screen_height int Custom height (CSS px)
dpr float 1.0 Device pixel ratio
fit str contain contain / cover / fill

Device resolution priority: preset > custom dims > User-Agent > desktop_1080p fallback.

Device Presets

Phones: iPhone 15 Pro, iPhone 14, iPhone SE, Pixel 8, Galaxy S24 Tablets: iPad Pro 12.9", iPad Air Desktop: 1080p, 1440p, 4K, MacBook Pro 14", MacBook Air 13"

Stack

  • Real-ESRGAN (ncnn-vulkan) — GPU-accelerated image super-resolution
  • FastAPI — REST API
  • Pillow — Image processing
  • Vanilla JS — Frontend

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors