NAFNet-SIDD-width32 GGUF

GGUF conversion of megvii-research/NAFNet (MIT license) for use with CrispEmbed scan cleanup.

Model

NAFNet (Non-linear Activation Free Network) is a U-Net image restoration model that achieves state-of-the-art denoising without traditional nonlinear activations. Instead it uses SimpleGate (channel split + element-wise multiply) and Simplified Channel Attention.

  • Architecture: U-Net with NAFBlocks
  • Config: width=32, enc=[2,2,4,8], middle=12, dec=[2,2,2,2]
  • Channels: 32 β†’ 64 β†’ 128 β†’ 256 β†’ 512 (middle) β†’ 256 β†’ 128 β†’ 64 β†’ 32
  • Parameters: 29.2M
  • Training: SIDD (Smartphone Image Denoising Dataset)
  • Performance: PSNR 39.97 dB, SSIM 0.9599 on SIDD validation

Files

File Type Size Notes
nafnet-sidd-w32-f16.gguf F16 56 MB Full precision weights
nafnet-sidd-w32-q8_0.gguf Q8_0 30 MB Recommended
nafnet-sidd-w32-q4_k.gguf Q4_K 16 MB Maximum compression

Usage with CrispEmbed

# CLI β€” preprocess scan before OCR
./build/crispembed --cleanup -m ocr_model.gguf --ocr scan.png

# Standalone cleanup
./build/crispembed --cleanup-only scan.png
from crispembed import CrispScanCleanup

cleanup = CrispScanCleanup("nafnet-sidd-w32-q8_0.gguf")
cleaned = cleanup.process("scan.png")  # numpy RGB array

Architecture Details

Each NAFBlock:

  1. LayerNorm2d → Conv1x1 (c→2c) → DepthwiseConv3x3 → SimpleGate (2c→c)
  2. Simplified Channel Attention (global avg pool β†’ Conv1x1)
  3. Conv1x1 (c→c) → residual connection (×beta)
  4. LayerNorm2d → Conv1x1 (c→2c) → SimpleGate → Conv1x1 → residual (×gamma)

Downsampling: Conv2d stride 2, kernel 2Γ—2. Upsampling: Conv1x1 + PixelShuffle(2).

License

MIT (megvii-research/NAFNet). The GGUF conversion does not change the license.

Citation

@article{chen2022simple,
  title={Simple Baselines for Image Restoration},
  author={Chen, Liangyu and Chu, Xiaojie and Zhang, Xiangyu and Sun, Jian},
  journal={arXiv preprint arXiv:2204.04676},
  year={2022}
}
Downloads last month
307
GGUF
Model size
29.2M params
Architecture
nafnet
Hardware compatibility
Log In to add your hardware

8-bit

16-bit

32-bit

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

Paper for cstr/nafnet-sidd-GGUF