Abstract
Recent advances in diffusion transformers (DiTs) have set new standards in image generation, yet remain impractical for on-device deployment due to their high computational and memory costs. In this work, we present an efficient DiT framework tailored for mobile and edge devices that achieves transformer-level generation quality under strict resource constraints. Our design combines three key components. First, we propose a compact DiT architecture with an adaptive global-local sparse attention mechanism that balances global context modeling and local detail preservation. Second, we propose an elastic training framework that jointly optimizes sub-DiTs of varying capacities within a unified supernetwork, allowing a single model to dynamically adjust for efficient inference across different hardware. Finally, we develop Knowledge-Guided Distribution Matching Distillation, a step-distillation pipeline that integrates the DMD objective with knowledge transfer from few-step teacher models, producing high-fidelity and low-latency generation (e.g., 4-step) suitable for real-time on-device use. Together, these contributions enable scalable, efficient, and high-quality diffusion models for deployment on diverse hardware.
Introduction
In the current landscape of generative AI, Diffusion Transformers (DiTs) such as Flux and Stable Diffusion 3 represent the state-of-the-art in image synthesis. However, these models typically feature tens of billions of parameters, necessitating server-grade GPUs for inference. For mobile users, this dependency on the cloud introduces latency, compromises privacy, and incurs significant infrastructure costs. While previous efforts to miniaturize these models for edge devices relied on older U-Net architectures, they often failed to capture the fine-grained detail and scalability inherent in transformers. SnapGen++ addresses this gap, fitting the power of a massive transformer into the strict memory and compute limits of a smartphone without sacrificing visual fidelity.
Methodology
SnapGen++ introduces three core innovations to enable high-performance on-device generation:
1. Adaptive Sparse Self-Attention (ASSA)
Standard attention mechanisms exhibit quadratic complexity, where computational costs explode as image resolution increases. ASSA mitigates this by bifurcating the workload into two parallel branches:
- Global Attention: Compresses image data to capture macro-level structure and composition.
- Local Attention (Blockwise Neighborhood Attention): Focuses on small, overlapping pixel blocks to preserve sharp textures and intricate details.
2. Elastic Training Framework
To accommodate the heterogeneous nature of mobile hardware, the authors employ an "elastic" training strategy. Instead of training discrete models for different device tiers, a single "supernetwork" is trained. This model can be dynamically "sliced" into various capacities (e.g., 0.3B, 0.4B, or 1.6B parameters) at inference time, ensuring optimal performance whether running on a budget device or a flagship smartphone.
3. Knowledge-Guided Distribution Matching Distillation (K-DMD)
Standard generation requires 20–50 sampling steps, which is too slow for real-time mobile use. SnapGen++ utilizes K-DMD, a novel distillation pipeline that compresses the process into 4 steps. By using a "teacher" model that is already optimized for few-step generation (via LoRA), the framework provides a stable and achievable learning target for the smaller "student" models.
Evaluation and Benchmarks
The framework was rigorously evaluated using industry-standard benchmarks:
- ImageNet-1K: Used for architectural validation and conditional generation.
- DPG-Bench, GenEval, and T2I-CompBench: These benchmarks measure text-to-image (T2I) alignment and the model's ability to follow complex, multi-attribute prompts.
- MS-COCO: Utilized for calculating CLIP-Scores to measure semantic alignment between text and generated imagery.
Key Results
SnapGen++ demonstrates that hybrid attention and weight-sharing are sufficient to maintain high quality at a fraction of the computational cost. Key performance metrics include:
- Latency: The 0.4B "small" model generates a 1024x1024 image in just 1.8 seconds on an iPhone 16 Pro Max using a 4-step sampling process.
- Quality and Alignment: Despite its compact size, SnapGen++ (0.4B) outperformed significantly larger models, including SD3.5-Large (8.1B) and Flux.1-dev (12B), on prompt-following benchmarks like DPG-Bench.
- Human Preference: User studies indicate a consistent preference for SnapGen++ over competitors like SANA and SD3-Medium in terms of realism and visual fidelity.
Conclusion and Future Work
SnapGen++ successfully brings state-of-the-art DiT performance to the edge. While the 4-step distilled models are exceptionally fast, future research will focus on closing the minor quality gap between distilled and full 28-step base models. Additionally, the efficiency of the ASSA mechanism and the elastic framework provides a promising foundation for extending these techniques to real-time on-device video generation.
Summary updated