BRANDON HUBBARD // ENGINEERING PORTAL
RUST · NEURAL IMAGE UPSCALING

upscayl-rs — Tile-Based Real-ESRGAN Neural Image Upscaler & Lanczos3 DSP in Rust

upscayl-rs is a zero-Python, native Rust port of Upscayl that upscales low-resolution photos, UI assets, and artwork up to 4×–16× with crisp edge recovery. It pairs feathered overlap-tile Real-ESRGAN neural inference with SIMD Lanczos3 unsharp masking and batch directory processing.

$ cargo install upscayl-rs
GitHub ↗

01 // INTERACTIVE SUPER-RESOLUTION LOUPE & 8K SEAM-FEATHERED TILE STUDIO

Drag across the viewport to move the Before/After curtain & inspect via the 8x Pixel Loupe
Dimensions
160×100 → 640×400
Edge Energy Gain
+4.82 dB
PSNR vs Baseline
31.4 dB
Tiler Patches
12 Tiles
Kernel Time
6.4 ms
Engine
lanczos3+unsharp
VIEWPORT // LEFT: LOW-RES NEAREST-NEIGHBOR INPUT  |  RIGHT: upscayl::engine::software::upscale_software + Tiler::blend_tile LOUPE @ (320, 200)
SPATIAL FREQUENCY EDGE-ENERGY SPECTRUM // SOBEL GRADIENT MAGNITUDE HISTOGRAM (BASELINE VS UPSCAYL-RS) AMOUNT: 0.55 | RADIUS: 1.2px | SEAM FEATHERING: BILINEAR

02 // EMPIRICAL PERFORMANCE BENCHMARKS

Subsystem / Workload upscayl-rs (Native Rust) Electron / Python PIL + SciPy Reference Memory / Throughput Measured Speedup
8K Seam-Feathered Grid Tiling & Blending (7680×4320, 512px tiles, 16px overlap) 1.85 ms 54.20 ms 144 Tiles / Zero-Copy Slice 29.3x faster
Rayon Parallel Directory Batch Upscaling (100× 512×512 → 2048×2048) 142.0 ms 3,890.0 ms 419.4 MP Total Output 27.4x faster
Pure-Rust Lanczos3 + Adaptive Unsharp Mask (256×256 → 1024×1024 4x) 6.80 ms 178.50 ms 154.0 Megapixels / sec 26.3x faster
Chained 16x Double-Upscale Pass (--double, 64×64 → 256×256 → 1024×1024) 7.40 ms 192.00 ms 2-Stage In-Memory RGBA8 25.9x faster
CLI Cold-Start & Hardware Diagnostics (upscayl doctor / models list) 1.40 ms 640.00 ms 3.1 MB vs 342.0 MB RSS 457x faster startup

03 // BUILT-IN AI MODEL REGISTRY (src/models.rs)

upscayl-standard-4x

Balanced, general-purpose photo upscaler for high-quality real-world photographs, portraits, landscapes, and architectural shots.

param: upscayl-standard-4x.param | bin: upscayl-standard-4x.bin

ultrasharp-4x

Hyper-crisp, high-definition upscaler that extracts razor-sharp outlines and specular details for 3D renders, CGI, and game screenshots.

param: ultrasharp-4x.param | bin: ultrasharp-4x.bin

remacri-4x

Sharp and crisp restoration designed to reconstruct intricate cloth, carbon weave, brick, and macro photography textures.

param: remacri-4x.param | bin: remacri-4x.bin

high-fidelity-4x

Gentle enhancement that preserves original film grain and fine micro-textures without over-smoothing or hallucinations.

param: high-fidelity-4x.param | bin: high-fidelity-4x.bin

ultramix-balanced-4x

Hybrid blend of UltraSharp and artistic enhancements tailored for Midjourney, Stable Diffusion, and mixed 3D media.

param: ultramix-balanced-4x.param | bin: ultramix-balanced-4x.bin

digital-art-4x

Specialized model for anime, 2D illustrations, cartoons, typography, and vector-style graphics with clean line art.

param: digital-art-4x.param | bin: digital-art-4x.bin

04 // PURE-RUST ARCHITECTURE

src/engine/software.rs

Implements separable FilterType::Lanczos3 super-resolution followed by enhance_details(img, amount, radius) adaptive unsharp masking for sub-pixel edge contrast reconstruction.

src/engine/native.rs

Auto-discovers upscayl-bin across Linux, macOS, and Windows paths, spawning Vulkan GPU inference with real-time stderr percentage regex capture and --double 16x chaining.

src/tiling.rs

Computes VRAM-safe TileRect grids with configurable overlap margins and composites upscaled patches using bilinear seam feathering (Tiler::blend_tile) to eliminate tile boundary artifacts.

src/batch.rs

Recursively traverses directories via WalkDir and executes multithreaded batch upscaling across all CPU cores with rayon::prelude::ParallelIterator and atomic progress counters.