NanoSD: Edge Efficient Foundation Model for Real Time Image Restoration
Subhajit Sanyal, Srinivas Soumitri Miriyala, Akshay Janardan Bankar, Sravanth Kodavanti, Harshit, Abhishek Ameta, Shreyas Pandith, Amit Satish Unde
TL;DR
NanoSD proposes an edge-friendly diffusion backbone by hardware-aware reengineering of the SD 1.5 U-Net, block-wise distillation, and end-to-end VAE refinement to yield a Pareto frontier of backbones balancing accuracy, latency, and size. It employs a hardware-aware block decomposition, feature-wise distillation, and Bayesian optimization with taFID to preserve SD 1.5's generative prior while dramatically reducing on-device latency. The resulting NanoSD family delivers real-time on-device image restoration across SR, FR, deblurring, dehazing, deraining, desnowing, and monocular depth estimation, demonstrated on SM8750 and Apple ANE with tile-based processing. This approach generalizes across platforms, showing that latency-aware architecture search coupled with distillation can unlock practical diffusion-based restoration on edge devices while preserving the teacher model's priors.
Abstract
Latent diffusion models such as Stable Diffusion 1.5 offer strong generative priors that are highly valuable for image restoration, yet their full pipelines remain too computationally heavy for deployment on edge devices. Existing lightweight variants predominantly compress the denoising U-Net or reduce the diffusion trajectory, which disrupts the underlying latent manifold and limits generalization beyond a single task. We introduce NanoSD, a family of Pareto-optimal diffusion foundation models distilled from Stable Diffusion 1.5 through network surgery, feature-wise generative distillation, and structured architectural scaling jointly applied to the U-Net and the VAE encoder-decoder. This full-pipeline co-design preserves the generative prior while producing models that occupy distinct operating points along the accuracy-latency-size frontier (e.g., 130M-315M parameters, achieving real-time inference down to 20ms on mobile-class NPUs). We show that parameter reduction alone does not correlate with hardware efficiency, and we provide an analysis revealing how architectural balance, feature routing, and latent-space preservation jointly shape true on-device latency. When used as a drop-in backbone, NanoSD enables state-of-the-art performance across image super-resolution, image deblurring, face restoration, and monocular depth estimation, outperforming prior lightweight diffusion models in both perceptual quality and practical deployability. NanoSD establishes a general-purpose diffusion foundation model family suitable for real-time visual generation and restoration on edge devices.
