Models · Image restoration

Restormer

Restormer (Zamir et al., CVPR 2022): a transposed-attention U-Net transformer that removes motion blur (GoPro), rain streaks (Rain13K) or real camera noise (SIDD). MIT code and weights.

experimental Fork of swz30/Restormer@68dc6ac · backends: portable, kernels

Checkpoint

Paper 2021 Added in 0.2.0 Evaluated with 0.2.0

Kernels, RTX 5060 Ti 16 GB 180 ms 512x512, fp16
vs the faster original 1.3× original fp16: 234 ms
Peak memory 850 MiB original: 1,221 MiB
Accuracy vs original fp32 ±0.00 kernels psnr, GoPro test (every 15th: 75 frames) (32.85 original)

Use it

pip install fastforks

Lean install with only what this model needs: pip install fastforks-core

from fastforks import restoration

model = restoration.load("restormer-deblur")  # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.image
result.backend  # what ran: mode, device, dtype, kernels
fastforks bench restormer-deblur

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)

BackenddtypeTime per call (ms)vs original fp16Peak memory
allocated / reserved
Load (s)First call (s)
Original fp32fp32not measured ––––
Original fp16.half() on 1 modules, fp16 inputs; upstream test.py, float32, no tilefp16 234–1,221 MiB/1,418 MiB0.30.23
Portable fp32fp32not measured ––––
Portablefp16 2281.0×850 MiB/1,000 MiB0.30.71
Kernelsfp16 1801.3×850 MiB/918 MiB0.60.50
Portable + torch.compile 1431.6×660 MiB/778 MiB44 (build)–
TensorRT fp16fp16 1621.4×656 MiBenginenot comparable58 (build)–

Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-14 to 2026-11-15. 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

DeviceBackenddtypems / callPeak memoryOutput vs referenceInput
Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-15Originalfp322395 6,858 MiB process–512x512
Portablefp161476 3,657 MiB processmatches512x512
Portablefp321376 4,735 MiB processmatches512x512
Kernelsfp16not 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

Code
MIT LICENSE
Weights
MIT source
Training data

Our reading of the licences, not legal advice.

Weights

motion_deblurring.pth 105 MB· hosted on GitHub

fastforks downloads and checks these files on first use (fastforks download restormer-deblur).

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.

GoPro test (every 15th: 75 frames)

deblurring, PSNR / SSIM (RGB)

Rundtypepsnr ↑ssim ↑Δ psnr vs fp32 originalimagesms / image
Original fp32fp3232.850.9405 reference 75 –
Original fp16not measured
Portable fp32fp3232.850.9405 ±0.00 75 –
Portablefp1632.850.9405 ±0.00 75 –
Kernelsfp1632.850.9405 ±0.00 75 –

Each degraded image at its own size, one pass without tiles (the model pads internally); PSNR and SSIM of the output rounded to uint8 on RGB, no border crop, averaged over the images (the authors' test scripts). 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 f104019b, 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| <= 0.0001 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.001 and p99 <= 0.005 (absolute error of the output image).

CheckToleranceMeasured
CPU fp32, max |diff|≤ 0.0001 not recorded
GPU default dtypes, mean |diff|≤ 0.001 0.00016
GPU default dtypes, p99 |diff|≤ 0.005 0.00054

Recorded for restormer-deblur on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-14, with these kernels: cudnn_hacc

Details

Restormer (Zamir et al., CVPR 2022): a U-Net of transformer blocks for high-resolution image restoration: channel ('transposed') self-attention whose cost grows linearly with the pixels (MDTA) and a gated depthwise-conv feed-forward (GDFN), four 2 x down / up levels plus refinement blocks. `restormer-deblur` removes motion blur (GoPro), `restormer-derain` removes rain streaks (Rain13K), `restormer-sidd` removes smartphone sensor noise (SIDD).

Input / output
Input: one RGB image. Output: the restored (upscaled) image, model.scale x 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 >= 32, padded to a multiple of 32; tested up to 1024x2048 (6,152 MiB allocated)
Outputs
image
CUDA kernels
  • cudnn_haccconvolutions with fp16 accumulation (cuDNN)
Apple (MPS)
fp32, fp16
Full reference, generated from the repository

Restormer (Zamir et al., CVPR 2022): a transposed-attention U-Net transformer that removes motion blur (GoPro), rain streaks (Rain13K) or real camera noise (SIDD). MIT code and weights.

Commercial use: yes.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
restormer-deblursynthetic (512x512)original
portable
kernels
portable + torch.compile
TensorRT fp16
234
228
180
143
162
1221 / 1418
850 / 1000
850 / 918
660 / 778
757 / 774
restormer-derainsynthetic (512x512)original
portable
kernels
portable + torch.compile
TensorRT fp16
234
228
180
144
162
1221 / 1418
850 / 1000
850 / 920
660 / 778
757 / 774
restormer-siddsynthetic (512x512)original
portable
kernels
portable + torch.compile
TensorRT fp16
218
181
179
142
162
1221 / 1416
850 / 920
850 / 940
660 / 778
757 / 774
Details
  • Original code: https://github.com/swz30/Restormer at 68dc6ac472db
  • Code licence: MIT (permissive); files: LICENSE
  • Weights licence: MIT
  • Licence evidence: https://github.com/swz30/Restormer/blob/68dc6ac472db26f16361150cb7a96a1bc87da93f/LICENSE.md ; https://github.com/swz30/Restormer/releases/tag/v1.0
  • Training data: GoPro deblurring (GOPRO_Large, Nah et al. 2017: 3214 blurred / sharp frame pairs) (Motion_Deblurring/Options/Deblurring_Restormer.yml: GoPro train (2103 blurred / sharp pairs), progressive patch sizes 128 to 384.)
    • restormer-derain: Rain13K (13712 synthetic rainy / clean pairs merged from Rain14000, Rain1800, Rain800, Rain12; MPRNet's training set) (Deraining/Options/Deraining_Restormer.yml: Rain13K (13712 synthetic rainy / clean pairs), progressive patch sizes 128 to 384.)
    • restormer-sidd: Smartphone Image Denoising Dataset (SIDD, noisy / ground-truth smartphone photos) (Denoising/Options/RealDenoising_Restormer.yml: SIDD-Medium sRGB (320 noisy / clean pairs), progressive patch sizes 128 to 384.)
  • Kernel libraries: cudnn_hacc
  • Variants: restormer-deblur, restormer-derain, restormer-sidd
  • Outputs: image
  • Input size: any H x W >= 32, padded to a multiple of 32
  • Tested up to (portable, fp16, RTX 5060 Ti 16 GB): restormer-deblur 1024x2048 (6.0 GiB peak allocated, 8.5 reserved); restormer-derain 1024x2048 (6.0 GiB peak allocated, 8.5 reserved); restormer-sidd 1024x2048 (6.0 GiB peak allocated, 7.9 reserved)
  • restormer-deblur 512x512, first call: portable + torch.compile 44 s (cold Inductor cache), TensorRT fp16 58 s (ONNX + engine).
  • restormer-derain 512x512, first call: portable + torch.compile 41 s (cold Inductor cache), TensorRT fp16 55 s (ONNX + engine).
  • restormer-sidd 512x512, first call: portable + torch.compile 36 s (cold Inductor cache), TensorRT fp16 60 s (ONNX + engine).
  • restormer-deblur original 512x512: .half() on 1 modules, fp16 inputs; upstream test.py, float32, no tile
  • restormer-derain original 512x512: .half() on 1 modules, fp16 inputs; upstream test.py, float32, no tile
  • restormer-sidd original 512x512: .half() on 1 modules, fp16 inputs; upstream test.py, float32, no tile
  • restormer-deblur load / first call: original 0.36 s / 0.897 s, portable 0.28 s / 0.712 s, kernels 0.6 s / 0.528 s
  • restormer-derain load / first call: original 0.34 s / 0.898 s, portable 0.29 s / 0.721 s, kernels 0.58 s / 0.527 s
  • restormer-sidd load / first call: original 0.34 s / 0.886 s, portable 0.29 s / 0.891 s, kernels 0.59 s / 0.529 s
  • Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5

Measured

Each degraded image at its own size, one pass without tiles (the model pads internally); PSNR and SSIM of the output rounded to uint8 on RGB, no border crop, averaged over the images (the authors' test scripts). Each rainy image at its own size, one pass without tiles; PSNR and SSIM of the output rounded to uint8 on the Y channel (BT.601), no border crop, averaged over the images (Restormer's MATLAB evaluation). Original = the original code named under Details, same checkpoint and protocol.

variantdatasetoriginal fp32portableportable fp32kernelsnote
restormer-deblurGoPro test (every 15th: 75 frames), deblurring, PSNR / SSIM (RGB)32.85 / 0.940532.85 / 0.940532.85 / 0.940532.85 / 0.9405
restormer-derainRain100L test (100 images), deraining, PSNR / SSIM (Y)39.08 / 0.978539.08 / 0.978539.08 / 0.978539.08 / 0.9785
restormer-derainRain100H test (100 images), deraining, PSNR / SSIM (Y)31.48 / 0.905431.48 / 0.905331.48 / 0.905331.48 / 0.9054
restormer-siddSIDD validation (every 2nd: 640 crops), denoising, PSNR / SSIM (RGB)39.98 / 0.922639.98 / 0.922639.98 / 0.922639.98 / 0.9226

Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks f104019b, 2026-11-14.

Parity

CPU, float32: max |diff| <= 0.0001 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.001 and p99 <= 0.005 (absolute error of the output image).

variantkernels error vs original, mean / p99GPU, torchkernels used
restormer-deblur0.00016 / 0.00054RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400
restormer-derain0.00022 / 0.00087RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400
restormer-sidd0.00019 / 0.00071RTX 5060 Ti, torch 2.14.1+cu130cudnn_hacc@cudnn92400

Example output

No example rendered for this checkpoint yet.