Abstract
Stable Diffusion models have revolutionized text-to-image generation but remain computationally expensive due to their iterative denoising process. While quantization offers a path toward efficiency, existing methods often struggle with training instability and a lack of fidelity to the original floating-point (FP) models. We present a novel quantization framework featuring a Serial-to-Parallel (S2P) calibration pipeline. By combining multi-timestep activation quantization, time information precalculation, and selective layer freezing, our approach ensures high-fidelity generation and training stability. Experiments across Stable Diffusion v1.4, v2.1, and XL 1.0 demonstrate that our method improves distribution and visual similarity by 45%-60% under W4A8 quantization settings compared to current state-of-the-art techniques.
Introduction
Stable Diffusion Models (SDMs) are the backbone of modern AI image generation, yet their heavy computational requirements hinder deployment on edge devices like smartphones and laptops. Quantization—reducing numerical precision from 16-bit to 4-bit—is a standard efficiency solution, but it faces two primary hurdles: training instability and fidelity loss. Previous methods often resulted in "weight oscillations" during training or produced images that deviated significantly from the original model's style and content. This paper introduces a framework designed to maintain the "consistency" essential for professional creative workflows while achieving significant compression.
Methodology: The Serial-to-Parallel Pipeline
The core innovation of this framework is the Serial-to-Parallel (S2P) Pipeline. Traditional training pipelines are either Serial (mimicking real inference but prone to unstable gradients) or Parallel (stable but suffering from distribution mismatch).
Our S2P approach bridges this gap by using a full-precision model to pre-generate a "latent dataset" of actual denoising steps. The quantized model is then trained in parallel on this specific, high-fidelity data. To further enhance performance, we implement:
- Multi-Timestep Activation Quantization: Using distinct quantization parameters for different stages of the denoising process to account for changing data distributions.
- Time Information Precalculation: Storing pre-calculated time embeddings to avoid the quality loss associated with quantizing these sensitive layers.
- Selective Freezing: Identifying and freezing "sensitive layers" to prevent harmful weight oscillations during fine-tuning.
Key Results and Stability
The framework achieves state-of-the-art results, particularly in the challenging W4A8 (4-bit weights, 8-bit activations) setting. A critical discovery was that the "Serial" training used in prior work causes periodic spikes in weight gradients, leading to instability. By adopting the Parallel approach within our S2P framework, we significantly lowered both the training loss and the percentage of weight oscillations.
On Stable Diffusion v2.1, our method achieved an FID-FP score of 12.05, outperforming previous methods like PCR (12.92). Beyond metrics, the framework preserves visual consistency—maintaining colors, features, and compositions that other 4-bit models often distort. Furthermore, the calibration process is highly efficient; for SD-XL, training takes approximately 7.5 hours, a nearly 70% reduction compared to competing block-wise methods.
Conclusion
By addressing the root causes of instability and distribution mismatch, this framework enables Stable Diffusion models to run at 4-bit precision without sacrificing the fidelity that creators rely on. The S2P pipeline and multi-timestep strategies provide a scalable path for deploying high-quality generative AI on resource-constrained hardware.
Summary updated