Local upscaler for AI-generated images, aimed at high-quality print output. Uses Real-ESRGAN NCNN Vulkan — no CUDA, no cloud, native AMD GPU support on Windows.
Tested on AMD Radeon RX 9060 XT, Windows 11.
pip install -r requirements.txt
# Photorealistic / AI photo-realistic (best quality)
python upscale.py my_image.png
# AI art, illustration, anime
python upscale.py my_image.png --model anime
# Fast preview
python upscale.py my_image.png --model fast
# 2x instead of 4x
python upscale.py my_image.png --scale 2
# Process a whole folder
python upscale.py images/ --model photo
# Custom output folder
python upscale.py my_image.png --output ~/Pictures/upscaledThe NCNN binary and models (~43 MB) are downloaded automatically on first run.
By default, results land in output/.
Input: 768×1364px → Output: 3072×5456px (4× scale, >4K on the long edge)
| Model | Time | Resolution | PNG size | Recommended use |
|---|---|---|---|---|
photo (x4plus) |
9.6s | 3072×5456px | 19.6 MB | Photorealistic images, AI portraits |
anime (x4plus-anime) |
3.8s | 3072×5456px | 17.7 MB | AI art, illustration, cartoon |
fast (animevideo) |
1.6s | 3072×5456px | 21.4 MB | Previews, batch processing |
All models autodetect the GPU via Vulkan (fp16 enabled).
| Output resolution | 300 DPI (photo quality) | 150 DPI (wall poster) |
|---|---|---|
| 3072×5456px (4×) | ~10" × 18" | ~20" × 36" |
| 1536×2728px (2×) | ~5" × 9" | ~10" × 18" |
File in bin/models/ |
--model flag |
Scale | Weight |
|---|---|---|---|
realesrgan-x4plus |
photo |
4× | 32 MB |
realesrgan-x4plus-anime |
anime |
4× | 8.6 MB |
realesr-animevideov3-x2/x3/x4 |
fast |
2/3/4× | 1.2 MB |
The script auto-downloads the binary + models on first use. To do it manually:
upscale.py <- main script (single Python file)
requirements.txt <- only pillow
bin/
realesrgan-ncnn-vulkan.exe <- NCNN binary
vcomp140.dll <- Visual C++ runtime
models/
realesrgan-x4plus.bin/.param <- photo model (32 MB)
realesrgan-x4plus-anime.bin/.param <- anime model (8.6 MB)
realesr-animevideov3-x*.bin/.param <- fast models (1.2 MB × 3)
Sources:
- Binary:
xinntao/Real-ESRGAN-ncnn-vulkanv0.2.0 - Models:
xinntao/Real-ESRGANv0.2.5.0
pillow -> only for reading image dimensions and mode (display info)
The actual upscaling is done by the NCNN binary compiled with Vulkan. No PyTorch, CUDA, ROCm, or heavy ML libraries required.
Full research notes (alternatives evaluated, findings, what doesn't work on AMD Windows): see RESEARCH.md.
TL;DR: AMD GPU on Windows = Vulkan or nothing. NCNN Vulkan gives quality on par with Topaz / Aiarty without paying and without uploading anything to the cloud.
- Real-ESRGAN — Xintao Wang et al.
- Real-ESRGAN-ncnn-vulkan — MIT License
MIT — see LICENSE.