Skip to main content
QUICK REVIEW

[Paper Review] Hybrid SD: Edge-Cloud Collaborative Inference for Stable Diffusion Models

Chenqian Yan, Songwei Liu|arXiv (Cornell University)|Aug 13, 2024
Complex Network Analysis TechniquesPhysics and Astronomy4 citations
TL;DR

This paper proposes Hybrid SD, a training-free edge-cloud collaborative inference framework for Stable Diffusion Models that offloads early denoising steps to cloud-based large models for semantic accuracy and delegates later refinement to compact edge models for efficiency. It achieves 66% lower cloud cost and state-of-the-art parameter efficiency (225.8M parameters) with competitive FID (12.22) on edge devices via structural pruning of the U-Net and a lightweight VAE.

ABSTRACT

Stable Diffusion Models (SDMs) have shown remarkable proficiency in image synthesis. However, their broad application is impeded by their large model sizes and intensive computational requirements, which typically require expensive cloud servers for deployment. On the flip side, while there are many compact models tailored for edge devices that can reduce these demands, they often compromise on semantic integrity and visual quality when compared to full-sized SDMs. To bridge this gap, we introduce Hybrid SD, an innovative, training-free SDMs inference framework designed for edge-cloud collaborative inference. Hybrid SD distributes the early steps of the diffusion process to the large models deployed on cloud servers, enhancing semantic planning. Furthermore, small efficient models deployed on edge devices can be integrated for refining visual details in the later stages. Acknowledging the diversity of edge devices with differing computational and storage capacities, we employ structural pruning to the SDMs U-Net and train a lightweight VAE. Empirical evaluations demonstrate that our compressed models achieve state-of-the-art parameter efficiency (225.8M) on edge devices with competitive image quality. Additionally, Hybrid SD reduces the cloud cost by 66% with edge-cloud collaborative inference.

Motivation & Objective

  • To address the high computational cost and privacy risks of deploying large Stable Diffusion Models (SDMs) on cloud servers.
  • To overcome the performance gap of existing compact edge models, which often sacrifice semantic fidelity and visual quality.
  • To design a training-free, collaborative inference framework that leverages the strengths of both cloud and edge devices.
  • To achieve state-of-the-art parameter efficiency on edge devices without compromising generative quality.
  • To ensure compatibility with acceleration techniques like LCM for practical deployment.

Proposed method

  • Distribute the diffusion process: early denoising steps are executed on large cloud-based SDMs for semantic planning, while later steps are handled by lightweight edge models for detail refinement.
  • Apply structural pruning to the SDM U-Net to reduce model size while preserving performance, enabling deployment on resource-constrained edge devices.
  • Train a lightweight VAE decoder specifically for edge deployment, reducing the overall model footprint without significant quality loss.
  • Integrate the compressed models into a hybrid inference pipeline that balances cloud and edge computation, minimizing data transfer and cloud cost.
  • Extend the framework to work with accelerated sampling methods like LCM (Latent Consistency Models), enabling fast inference with minimal steps.
  • Optimize the system to offload 66% of cloud FLOPs by shifting computation to edge devices, reducing latency and cost.
Figure 1: Comparisons of FLOPs, model size (#Params) and FID score on MS-COCO 2014 30K dataset (Lin et al. 2014 ) . We report FLOPs and parameters of the U-Net and VAE decoder for each model. Our proposed Hybrid SD is highlighted in red font, where $k$ indicates the number of steps running on cloud
Figure 1: Comparisons of FLOPs, model size (#Params) and FID score on MS-COCO 2014 30K dataset (Lin et al. 2014 ) . We report FLOPs and parameters of the U-Net and VAE decoder for each model. Our proposed Hybrid SD is highlighted in red font, where $k$ indicates the number of steps running on cloud

Experimental results

Research questions

  • RQ1Can edge-cloud collaboration improve the efficiency and cost-effectiveness of Stable Diffusion inference without requiring model retraining?
  • RQ2How can semantic integrity and visual quality be preserved when using compact models on edge devices?
  • RQ3To what extent can structural pruning and lightweight VAEs reduce model size while maintaining competitive FID scores?
  • RQ4What is the optimal distribution of computation between cloud and edge to minimize cloud cost while maintaining low latency?
  • RQ5How compatible is the hybrid inference framework with existing acceleration techniques like LCM?

Key findings

  • Hybrid SD reduces cloud inference cost by 66% by offloading 2.7 trillion FLOPs to edge devices, achieving 5.4T FLOPs on the cloud compared to 15.8T in full cloud inference.
  • The compressed edge model achieves 225.8 million parameters—909.0M in the original SD-v1.4—while maintaining a competitive FID of 12.22 versus 13.75 for the original.
  • Edge-cloud collaborative inference reduces cloud latency by 42% (1010.5 ms vs. 1733.6 ms) and FLOPs by 49% compared to full cloud inference.
  • The framework maintains superior semantic alignment compared to standalone edge models, which often fail to generate correct attributes (e.g., 'kichen' instead of 'kitchen', missing 'two sheep' in prompts).
  • The lightweight VAE enables a 42% reduction in edge-side FLOPs and improves efficiency without degrading image quality.
  • The hybrid framework is fully compatible with LCM acceleration, enabling 8-step sampling with minimal performance drop and further enhancing speed and efficiency.
Figure 2: The overview of Hybrid SD. We distribute the inference tasks to cloud servers and edge devices. The red line denotes text-to-image tasks while the blue line denotes image-to-image tasks.
Figure 2: The overview of Hybrid SD. We distribute the inference tasks to cloud servers and edge devices. The red line denotes text-to-image tasks while the blue line denotes image-to-image tasks.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.