NAFNet MLX
Collection
MLX port of NAFNet (Simple Baselines for Image Restoration): on-device deblur/denoise on Apple Silicon. β’ 3 items β’ Updated β’ 1
Run mlx-community/NAFNet-REDS-width64 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Use HF Jobs to fine-tune https://huggingface.co/mlx-community/NAFNet-REDS-width64. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to run batch inference with https://huggingface.co/mlx-community/NAFNet-REDS-width64 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use mlx-community/NAFNet-REDS-width64 with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download mlx-community/NAFNet-REDS-width64 --local-dir NAFNet-REDS-width64
Apple MLX port of NAFNet (Simple Baselines for Image Restoration, ECCV 2022). Runs on Apple Silicon via MLX.
This checkpoint: REDS (Image deblurring). width64.
from nafnet_mlx import NAFNetConfig
from nafnet_mlx.pipeline import load_model, restore_to_file
m = load_model("model.safetensors", NAFNetConfig.reds_width64())
restore_to_file(m, "input.png", "output.png")
Faithful NHWC port (SimpleGate, Simplified Channel Attention, channel-axis LayerNorm2d, UNet + PixelShuffle). PT-vs-MLX full-model parity on a real image ~1e-6. Uses NAFNetLocal (TLC) local pooling.
MIT. Derived from megvii-research/NAFNet (MIT). See NOTICE.
Quantized