Real-ESRGAN General x4v3 β€” LiteRT (CompiledModel GPU)

Real-ESRGAN realesr-general-x4v3 (SRVGGNetCompact, ~1.2M params, BSD-3-Clause) re-authored to a GPU-native LiteRT .tflite via the official litert_torch path. Γ—4 real-world super-resolution. FP16, 3.5 MB, input 128Γ—128 β†’ output 512Γ—512 (NHWC, RGB, 0–1).

Verified on a Pixel 8a: the whole graph runs on the GPU delegate (full LITERT_CL residency, 211/211 nodes, 1 partition) in ~1 ms, and the GPU output matches the CPU/PyTorch reference (corr β‰ˆ 0.995).

Why this is GPU-clean

A pure CNN, but the stock conversion isn't GPU-clean: PReLU lowers to GREATER+SELECT+MUL and PixelShuffle lowers to a >4-D reshape β€” both GPU-rejected. Here:

  • PReLU β†’ relu(x) βˆ’ aΒ·relu(βˆ’x) (per-channel a): exact, only RELU/MUL/SUB.
  • PixelShuffle(4) β†’ a one-hot ConvTranspose(stride 4) β†’ ZeroStuffConvT (zero-stuff nearest + Conv2d): exact, no TRANSPOSE_CONV, no >4-D tensors.

Result: zero GATHER/SELECT/TopK/Cast, no >4-D tensors β€” full GPU residency. Re-authored vs original: corr 1.000000.

I/O

  • Input [1, 128, 128, 3] NHWC, RGB, 0–1 float (no mean/std). Tile larger images into 128Γ—128 patches.
  • Output [1, 512, 512, 3] NHWC, RGB, 0–1 (clamp to [0,1]). Γ—4 upscale.

Training data & PII

realesr-general-x4v3 was trained by the Real-ESRGAN authors on public super-resolution datasets (DIV2K / Flickr2K / OST and a synthetic high-order degradation pipeline). The model upscales image pixels only β€” no faces, identities, or other personal attributes are detected, recognized, or output. No additional or private data was used; weights are the official release, only the op graph was re-authored for GPU.

Sample app + conversion script

Android sample (CompiledModel GPU, before/after compare) and the litert_torch conversion script: https://github.com/google-ai-edge/litert-samples (compiled_model_api/super_resolution)

Downloads last month
30
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support