LegoDiffusion: Micro-Serving Text-to-Image Diffusion Workflows
Organizations: Hong Kong University of Science and Technology · Alibaba Group
Abstract
Text-to-image generation executes a diffusion workflow comprising multiple models centered on a base diffusion model. Existing serving systems treat each workflow as an opaque monolith, provisioning, placing, and scaling all constituent models together, which obscures internal dataflow, prevents model sharing, and enforces coarse-grained resource management. In this paper, we make a case for micro-serving diffusion workflows with LegoDiffusion, a system that decomposes a workflow into loosely coupled model-execution nodes that can be independently managed and scheduled. By explicitly managing individual model inference, LegoDiffusion unlocks cluster-scale optimizations, including per-model scaling, model sharing, and adaptive model parallelism. Collectively, LegoDiffusion outperforms existing diffusion workflow serving systems, sustaining up to 3x higher request rates and tolerating up to 8x higher burst traffic.
Figures & tables
| Class | API | Description |
| Model | init() | Create a model instance |
| call() | Express a model invocation in the frontend | |
| setup_io() | Define model inputs and outputs | |
| load() | Load the model in the backend | |
| execute() | Execute model inference in the backend | |
| add_patch() | Attach a patchable adapter to a model |
| Setting | Diffusion Model | Workflow |
| Single-model Deployments (3 workflows each) | ||
| S1 | SD3 ( Esser et al., 2024 ) | (Basic, +C.N. 1, +C.N. 2) |
| S2 | SD3.5-Large ( stabilityai, 2025 ) | (Basic, +C.N. 1, +C.N. 2) |
| S3 | Flux-Schnell ( Labs, 2024 ) | (Basic, +C.N. 1, +C.N. 2) |
| S4 | Flux-Dev ( Labs, 2024 ) | (Basic, +C.N. 1, +C.N. 2) |
| Mixed-model Deployments (6 workflows each) | ||
| Technique | LOC / (Support adaptive adjustment?) | ||
| Katz ( Li et al., 2025b ) | xDiT ( Fang et al., 2024 ) | LegoDiffusion | |
| Latent parallel | 92 (No) | 68 (No) | 74 (Yes) |
| ControlNet parallel | 127 (No) | N.A. | 79 (Yes) |
| Async LoRA loading | 182 (Yes) | N.A. | 61 (Yes) |
Diffusion Model Serving
Diffusion model serving optimizes the scheduling, execution, and resource use of diffusion models to meet latency and throughput goals.
See all 18 papers