[Paper Review] SANA: Efficient High-Resolution Image Synthesis with Linear Diffusion Transformers
Sana introduces a highly efficient text-to-image diffusion framework that generates 4096×4096 images with state-of-the-art quality at unprecedented speed, using a 32× deep compression autoencoder, linear attention in a DiT architecture, a decoder-only LLM (Gemma) for text encoding with in-context instruction tuning, and a flow-based DPM solver to reduce inference steps. Sana-0.6B achieves 100× faster inference than SOTA models like FLUX while being 20× smaller and deployable on a 16GB laptop GPU.
We introduce Sana, a text-to-image framework that can efficiently generate images up to 4096$ imes$4096 resolution. Sana can synthesize high-resolution, high-quality images with strong text-image alignment at a remarkably fast speed, deployable on laptop GPU. Core designs include: (1) Deep compression autoencoder: unlike traditional AEs, which compress images only 8$ imes$, we trained an AE that can compress images 32$ imes$, effectively reducing the number of latent tokens. (2) Linear DiT: we replace all vanilla attention in DiT with linear attention, which is more efficient at high resolutions without sacrificing quality. (3) Decoder-only text encoder: we replaced T5 with modern decoder-only small LLM as the text encoder and designed complex human instruction with in-context learning to enhance the image-text alignment. (4) Efficient training and sampling: we propose Flow-DPM-Solver to reduce sampling steps, with efficient caption labeling and selection to accelerate convergence. As a result, Sana-0.6B is very competitive with modern giant diffusion model (e.g. Flux-12B), being 20 times smaller and 100+ times faster in measured throughput. Moreover, Sana-0.6B can be deployed on a 16GB laptop GPU, taking less than 1 second to generate a 1024$ imes$1024 resolution image. Sana enables content creation at low cost. Code and model will be publicly released.
Motivation & Objective
- Address the high computational cost and slow inference speed of existing high-resolution text-to-image diffusion models, especially at 4K resolution.
- Enable efficient, real-time inference of high-fidelity 4K images on consumer-grade hardware, such as laptops with 16GB GPU memory.
- Reduce model size and inference latency without sacrificing image quality or text-image alignment.
- Overcome limitations of traditional text encoders (e.g., CLIP, T5) by leveraging the instruction-following and reasoning capabilities of decoder-only LLMs.
- Develop a scalable, end-to-end training and inference pipeline that supports ultra-high-resolution image synthesis with minimal hardware requirements.
Proposed method
- Proposed a deep compression autoencoder (AE-F32) that compresses images 32× in spatial dimensions, reducing latent token count by 16× compared to standard 8× compression AEs.
- Replaced all standard self-attention modules in DiT with linear attention mechanisms, reducing computational complexity from O(N²) to O(N) for high-resolution generation.
- Introduced Mix-FFN, a 3×3 depth-wise convolution integrated into the MLP block, enabling local token aggregation and eliminating the need for positional encoding (NoPE).
- Replaced T5 with a small decoder-only LLM (Gemma) as the text encoder and used complex human instruction (CHI) prompting with in-context learning to improve instruction following and image-text alignment.
- Designed a multi-VLM captioning pipeline with clipscore-based dynamic caption selection to improve training data quality and convergence.
- Proposed Flow-DPM-Solver, a flow-based sampling method that reduces inference steps from 28–50 to 14–20 while improving generation quality and reducing latency.
Experimental results
Research questions
- RQ1Can a text-to-image diffusion model achieve 4K (4096×4096) resolution generation with high quality and low latency using a compact architecture?
- RQ2Can linear attention replace standard self-attention in DiT without quality degradation while enabling efficient high-resolution inference?
- RQ3Can a small decoder-only LLM (e.g., Gemma) outperform traditional T5 or CLIP encoders in text-image alignment when properly prompted with complex human instructions?
- RQ4Can a combination of advanced autoencoding, efficient attention, and optimized sampling reduce inference time by over 100× compared to SOTA models?
- RQ5Is it feasible to deploy a high-resolution diffusion model on a 16GB laptop GPU with sub-second inference for 1024×1024 images?
Key findings
- Sana-0.6B generates 1024×1024 images in under 1 second on a 16GB laptop GPU, demonstrating real-time inference capability.
- Sana-0.6B achieves 106× faster inference than FLUX on 4096×4096 resolution images, reducing latency from 469 seconds to 9.6 seconds on an A100 GPU.
- Sana-0.6B achieves a FID of 5.81 and CLIP score of 28.36 on 1024×1024 generation, outperforming models like SDXL and PixArt-Σ in both metrics.
- The use of Gemma-2B as a text encoder achieves a FID of 5.9 and CLIP score of 26.8, matching or exceeding T5-Large and T5-XXL at comparable or lower latency.
- The Flow-DPM-Solver reduces sampling steps from 28–50 to 14–20, improving inference speed while maintaining or improving generation quality.
- The NoPE (no positional embedding) design with Mix-FFN enables effective modeling without positional encodings, simplifying the architecture and improving training stability.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.