The intensive computational burden of Stable Diffusion (SD) for text-to-image generation poses a significant hurdle for its practical application. To tackle this challenge, recent research focuses on methods to reduce sampling steps, such as Latent Consistency Model (LCM), and on employing architectural optimizations, including pruning and knowledge distillation. Diverging from existing approaches, we uniquely start with a compact SD variant, BK-SDM. We observe that directly applying LCM to BK-SDM with commonly used crawled datasets yields unsatisfactory results. It leads us to develop two strategies: (1) leveraging high-quality image-text pairs from leading generative models and (2) designing an advanced distillation process tailored for LCM. Through our thorough exploration of quantization, profiling, and on-device deployment, we achieve rapid generation of photo-realistic, text-aligned images in just two steps, with latency under one second on resource-limited edge devices.
翻译:稳定扩散模型(SD)在文本到图像生成中面临严峻计算负担,这对其实际应用构成重大障碍。为应对这一挑战,近期研究聚焦于减少采样步骤的方法(如潜在一致性模型LCM),以及采用架构优化策略(包括剪枝和知识蒸馏)。与现有方法不同,我们独创性地从轻量级SD变体BK-SDM出发。研究发现,直接将LCM与BK-SDM结合并采用主流爬取数据集会产生不理想的结果。为此我们开发了两项策略:(1)利用来自领先生成模型的高质量图像-文本对,以及(2)设计适用于LCM的进阶蒸馏流程。通过对量化、性能剖析和设备端部署的全面探索,我们仅需两步即可生成照片级真实、文本对齐的图像,且在资源受限的边缘设备上延迟低于一秒。