256f4d9656a6b18d00fafcbe0f49e9dc86d2af7d
- Detects Git LFS pointer files vs actual models - Auto-downloads from Google Drive if LFS failed - Keeps gdown as optional fallback dependency Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ComfyUI-NAFNet
ComfyUI custom nodes for NAFNet - Simple Baselines for Image Restoration.
This node pack provides state-of-the-art image denoising, deblurring, and stereo super-resolution capabilities using NAFNet and NAFSSR models from MEGVII Research.
Features
- Image Denoising - Remove noise from images using SIDD-trained models
- Image Deblurring - Remove motion blur using GoPro/REDS-trained models
- Stereo Super-Resolution - Upscale stereo image pairs (2x/4x) using NAFSSR
- Tiled Processing - Handle large images with limited VRAM
- Model Caching - Efficient memory usage with automatic model caching
Nodes
| Node | Description |
|---|---|
| NAFNet Load Model | Load any NAFNet/NAFSSR model for use with NAFNet Restore |
| NAFNet Restore | Generic restoration with optional tiled processing |
| NAFNet Denoise (SIDD) | Quick denoise using SIDD-trained models |
| NAFNet Deblur (GoPro) | Quick deblur using GoPro-trained models |
| NAFSSR Stereo Super-Resolution | Upscale stereo image pairs with cross-attention |
Installation
Option 1: ComfyUI Manager (Recommended)
Search for "NAFNet" in ComfyUI Manager and install.
Option 2: Manual Installation
cd ComfyUI/custom_nodes
git clone https://github.com/marduk191/ComfyUI-NAFNet.git
cd ComfyUI-NAFNet
pip install -r requirements.txt
Note: Models (1.3 GB) are included via Git LFS. If you don't have Git LFS installed, run the fallback downloader:
python download_models.py
Models
| Model | Task | Size | Dataset |
|---|---|---|---|
| NAFNet-SIDD-width32.pth | Denoising | 111 MB | SIDD |
| NAFNet-SIDD-width64.pth | Denoising | 443 MB | SIDD |
| NAFNet-GoPro-width32.pth | Deblurring | 66 MB | GoPro |
| NAFNet-GoPro-width64.pth | Deblurring | 259 MB | GoPro |
| NAFNet-REDS-width64.pth | Video Deblurring | 259 MB | REDS |
| NAFSSR-L_2x.pth | Stereo SR 2x | 92 MB | Flickr1024 |
| NAFSSR-L_4x.pth | Stereo SR 4x | 92 MB | Flickr1024 |
Usage Examples
Denoise an Image
- Add Load Image node
- Add NAFNet Denoise (SIDD) node
- Connect image output to NAFNet input
- Choose
width64for best quality orwidth32for speed
Deblur an Image
- Add Load Image node
- Add NAFNet Deblur (GoPro) node
- Connect and run
Process Large Images (Tiled)
- Add Load Image node
- Add NAFNet Load Model node (select any model)
- Add NAFNet Restore node
- Set
tile_sizeto 512 andtile_overlapto 64 - Connect and run
Stereo Super-Resolution
- Add two Load Image nodes (left and right views)
- Add NAFSSR Stereo Super-Resolution node
- Connect left/right images to corresponding inputs
- Choose 2x or 4x upscaling
- Both outputs are upscaled with cross-view attention
Sample Workflows
Sample workflow JSON files are included in the workflows/ folder:
nafnet_denoise.json- Basic denoisingnafnet_deblur.json- Basic deblurringnafnet_loader_restore.json- Using model loadernafnet_tiled_restore.json- Tiled processing for large imagesnafssr_stereo_sr.json- Stereo super-resolution
Performance Tips
- Use
width32models for faster processing with slightly lower quality - Use
width64models for best quality - Enable tiled processing for images larger than 1024x1024
- NAFSSR works best with properly aligned stereo pairs
Requirements
- ComfyUI
- PyTorch (CUDA recommended)
- gdown (only needed if Git LFS models fail to download)
Credits
Citation
@inproceedings{chen2022simple,
title={Simple Baselines for Image Restoration},
author={Chen, Liangyu and Chu, Xiaojie and Zhang, Xiangyu and Sun, Jian},
booktitle={European Conference on Computer Vision (ECCV)},
year={2022}
}
@inproceedings{chu2022nafssr,
title={NAFSSR: Stereo Image Super-Resolution Using NAFNet},
author={Chu, Xiaojie and Chen, Liangyu and Yu, Wenqing},
booktitle={CVPR Workshop},
year={2022}
}
License
This project is released under the MIT License. The NAFNet model weights are subject to their original license from MEGVII Research.
Languages
Python
100%
