RealPLKSR
RealPLKSR (neosr, after PLKSR by Lee et al., 2024): a large-kernel CNN upscaler; `realplksr-nomoswebphoto-x4` is Philip Hofmann's x4 model for noisy, blurred and JPEG / WebP-compressed photos; also loads other RealPLKSR checkpoints. Apache-2.0 code, CC-BY-4.0 weights.
experimental Fork of neosr-project/neosr@31c7022 · backends: portable, kernels
- Paper Partial Large Kernel CNNs for Efficient Super-Resolution arXiv · first released 18 Apr 2024
Checkpoint realplksr-nomoswebphoto-x4
Paper 2024 Added in 0.2.0 Evaluated with 0.2.0
Use it
pip install fastforks Lean install with only what this model needs: pip install fastforks-core
from fastforks import restoration
model = restoration.load("realplksr-nomoswebphoto-x4") # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.image
result.backend # what ran: mode, device, dtype, kernels fastforks bench realplksr-nomoswebphoto-x4 Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.
Speed and memory
Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.
Input: synthetic, 512x512 (the task’s standard size)
| Backend | dtype | Time per call (ms) | vs original fp16 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | not measured | – | – | – | – |
| Original fp16.half() on 1 modules, fp16 inputs; neosr realplksr eval mode, float32, net(lq) clamped | fp16 | 267 | – | 244 MiB/320 MiB | 0.1 | 0.27 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 182 | 1.5× | 179 MiB/216 MiB | 0.2 | 0.41 |
| Kernels | fp16 | 130 | 2.1× | 179 MiB/216 MiB | 0.6 | 0.25 |
| Portable + torch.compile | 154 | 1.7× | 179 MiB/196 MiB | 15 (build) | – | |
| TensorRT fp16 | fp16 | 247 | 1.1× | 290 MiBenginenot comparable | 26 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-14. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two
times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.
Other devices
| Device | Backend | dtype | ms / call | Peak memory | Output vs reference | Input |
|---|---|---|---|---|---|---|
| Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-14 | Original | fp32 | 1555 | 1,407 MiB process | – | 512x512 |
| Portable | fp16 | 1092 | 1,368 MiB process | matches | 512x512 | |
| Portable | fp32 | 1527 | 1,384 MiB process | matches | 512x512 | |
| Kernels | fp16 | not implemented | – | 512x512 | ||
CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.
Licence and weights
Commercial use allowed
Our reading of the licences, not legal advice.
Weights
4xNomosWebPhoto_RealPLKSR.safetensors 29.6 MB· hosted on GitHubfastforks downloads and checks these files on first use (fastforks download realplksr-nomoswebphoto-x4).
Accuracy
The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.
DIV2K validation (every 2nd: 50 images)
bicubic x4 LR -> HR, PSNR / SSIM (Y)
| Run | dtype | psnr ↑ | ssim ↑ | Δ psnr vs fp32 original | images | ms / image |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | 26.99 | 0.7481 | reference | 50 | – |
| Original fp16 | not measured | |||||
| Portable fp32 | fp32 | 26.99 | 0.7481 | ±0.00 | 50 | – |
| Portable | fp16 | 26.99 | 0.7481 | ±0.00 | 50 | – |
| Kernels | fp16 | 26.99 | 0.7481 | ±0.00 | 50 | – |
DIV2K validation HR images and the official bicubic LR images (x4 or x2, the model's scale), one pass without tiles; PSNR and SSIM (Gaussian 11 x 11, sigma 1.5) on the Y channel (BT.601) of the output rounded to uint8, `scale` px border cropped, averaged over the images. Real-ESRGAN is trained for real-world degradations, not bicubic, so its PSNR is low: the numbers compare our modes with the original, not with PSNR-oriented upscalers. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-14; portable fp32, portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 60534e1d, 2026-11-14.
Closeness to the original
Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. CPU, float32: max |diff| <= 1.4e-06 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.00047 and p99 <= 0.0018 (absolute error of the output image).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.0000014 | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.00047 | 0.00031 |
| GPU default dtypes, p99 |diff| | ≤ 0.0018 | 0.00118 |
Recorded for realplksr-nomoswebphoto-x4 on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-14, with these kernels: cudnn_hacc
Details
RealPLKSR (neosr; after PLKSR, Lee et al., 2024): a real-world super-resolution CNN of partial large-kernel blocks (3 x 3 channel mixer, a 17 x 17 conv on a quarter of the channels, element-wise attention, GroupNorm) and a pixel-shuffle upsampler. `realplksr-nomoswebphoto-x4` is Philip Hofmann's 4xNomosWebPhoto_RealPLKSR, an x4 model for photos with noise, lens blur and JPEG / WebP compression. `load(path)` reads other RealPLKSR checkpoints with the pixel-shuffle upsampler (any scale, width and depth).
- Input / output
- Input: one RGB image. Output: the restored (upscaled) image,
model.scalex the input size, RGB in [0, 1].What the numbers mean, and which models need the camera focal length
tile=runs large images in overlapping tiles (as ComfyUI). - Input size
- any H x W >= 1, resized or padded inside the model; tested up to 512x512 (179 MiB allocated)
- Outputs
image- CUDA kernels
cudnn_haccconvolutions with fp16 accumulation (cuDNN)
- Apple (MPS)
- fp32, fp16
Full reference, generated from the repository
RealPLKSR (neosr, after PLKSR by Lee et al., 2024): a large-kernel CNN upscaler; realplksr-nomoswebphoto-x4 is Philip Hofmann's x4 model for noisy, blurred and JPEG / WebP-compressed photos; also loads other RealPLKSR checkpoints. Apache-2.0 code, CC-BY-4.0 weights.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
realplksr-nomoswebphoto-x4 | synthetic (512x512) | original portable kernels portable + torch.compile TensorRT fp16 | 267 182 130 154 247 | 244 / 320 179 / 216 179 / 216 179 / 196 358 / 366 |
Details
- Original code: https://github.com/neosr-project/neosr at
31c7022620c6 - Code licence: Apache-2.0 (permissive); files:
LICENSE - Weights licence: CC-BY-4.0
- Licence evidence: https://github.com/neosr-project/neosr/blob/31c7022620c682cf0961c8634d60787179145c5b/license.txt ; https://github.com/Phhofm/models/releases/tag/4xNomosWebPhoto_RealPLKSR
- Training data: Nomos-v2 (neosr's 6000-image multipurpose super-resolution set) (Release notes: Nomos-v2 (6000 photos, neosr's dataset) with realistic noise, lens blur, JPEG and WebP degradations; pretrained from neosr's 4x_realplksr_gan_pretrain.)
- Kernel libraries:
cudnn_hacc - Variants:
realplksr-nomoswebphoto-x4 - Outputs: image
- Input size: any H x W >= 1, resized or padded inside the model
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
realplksr-nomoswebphoto-x4512x512 (0.2 GiB peak allocated, 0.3 reserved) realplksr-nomoswebphoto-x4512x512, first call: portable + torch.compile 15 s (cold Inductor cache), TensorRT fp16 26 s (ONNX + engine).realplksr-nomoswebphoto-x4original 512x512: .half() on 1 modules, fp16 inputs; neosr realplksr eval mode, float32, net(lq) clampedrealplksr-nomoswebphoto-x4load / first call: original 0.21 s / 0.759 s, portable 0.18 s / 0.414 s, kernels 0.56 s / 0.253 s- Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5
Measured
DIV2K validation HR images and the official bicubic LR images (x4 or x2, the model's scale), one pass without tiles; PSNR and SSIM (Gaussian 11 x 11, sigma 1.5) on the Y channel (BT.601) of the output rounded to uint8, scale px border cropped, averaged over the images. Real-ESRGAN is trained for real-world degradations, not bicubic, so its PSNR is low: the numbers compare our modes with the original, not with PSNR-oriented upscalers. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp32 | portable | portable fp32 | kernels | note |
|---|---|---|---|---|---|---|
realplksr-nomoswebphoto-x4 | DIV2K validation (every 2nd: 50 images), bicubic x4 LR -> HR, PSNR / SSIM (Y) | 26.99 / 0.7481 | 26.99 / 0.7481 | 26.99 / 0.7481 | 26.99 / 0.7481 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 60534e1d, 2026-11-14.
Parity
CPU, float32: max |diff| <= 1.4e-06 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.00047 and p99 <= 0.0018 (absolute error of the output image).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
realplksr-nomoswebphoto-x4 | 0.00031 / 0.00118 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400 |
Example output
No example rendered for this checkpoint yet.