Hyper-SD: Trajectory Segmented Consistency Model for Efficient Image Synthesis

Yuxi Ren, Xin Xia, Yanzuo Lu, Jiacheng Zhang, Jie Wu, Pan Xie, Xing Wang, Xuefeng Xiao

TL;DR

Hyper-SD is a novel distillation framework that enables Stable Diffusion models (like SDXL and SD1.5) to generate high-quality images in as few as 1 to 8 steps. By synergistically combining ODE trajectory preservation with human feedback and score distillation, it achieves state-of-the-art performance. Furthermore, it introduces a "Unified LoRA" that operates across multiple step counts without requiring separate weights.

Visual comparison of Hyper-SDXL against baseline and other 1-step models

The Challenge of Fast Image Synthesis

Diffusion Models (DMs) are the current standard for image synthesis, but their multi-step inference process (typically 25 to 50 steps) makes them computationally expensive and slow for real-time applications.

To accelerate this, researchers rely on distillation, where a faster "student" model learns to mimic a slower "teacher" model. Current distillation techniques generally fall into two distinct camps:

  1. ODE Trajectory Preservation: These methods strictly follow the original mathematical path (the ODE trajectory) of the model. They are accurate but often hit a severe quality ceiling when compressed below 4 steps.
  2. ODE Trajectory Reformulation: These methods rewrite the math to find a direct shortcut from noise to image. While they can achieve 1-step generation, they frequently suffer from "domain shift"—resulting in images that lose the fine details or stylistic essence of the original model.

Hyper-SD bridges this gap, aiming for near-lossless step compression that maintains the original model's quality while running at breakneck speeds.

Core Methodology

The authors propose a three-pronged strategy to build Hyper-SD:

1. Trajectory Segmented Consistency Distillation (TSCD)

Instead of forcing the model to learn a massive 50-step jump in one go, Hyper-SD uses a progressive "curriculum" approach. The ODE trajectory is divided into segments (e.g., $k=8, 4, 2, 1$). The model first learns to maintain consistency within 8 small segments, then 4, and so on. This segmented approach prevents the accumulation of errors that typically plagues fast sampling methods.

Illustration of Trajectory Segmented Consistency Distillation (TSCD)

2. Human Feedback Learning

To ensure the rapidly generated images remain visually appealing, the framework incorporates Reward Feedback Learning (ReFL) using two types of critics:

  • Aesthetic Critic: Evaluates the overall visual beauty of the image.
  • Structural/Perceptual Critic: Utilizes an instance segmentation model (SOLO) to verify that generated objects possess the correct shapes and structures, effectively preventing the "melted" or deformed look common in low-step generations.

3. Score Distillation (DMD) & Unified LoRA

For ultimate 1-step performance, Hyper-SD integrates Distribution Matching Distillation (DMD) to sharpen the output and align the 1-step distribution with the teacher's high-step distribution.

Practically, all of this is packaged into a single Unified Low-Rank Adaptation (LoRA) module. This allows developers to use a single set of weights to support inference at 1, 2, 4, or 8 steps interchangeably, vastly simplifying deployment.

Datasets Used

The researchers utilized several large-scale datasets to train and evaluate the model:

  • Training: Subsets of LAION and COYO for general distillation.
  • Structure Optimization: The COCO2017 training split (with instance annotations) to train structural integrity via segmentation feedback.
  • Evaluation: The COCO-5k dataset was used to benchmark CLIP scores (text alignment) and Aesthetic scores.

Key Results

Hyper-SD sets a new benchmark for efficient synthesis:

  • Quantitative SOTA: In 1-step inference, Hyper-SDXL outperforms SDXL-Lightning by +0.68 in CLIP Score and +0.51 in Aesthetic Score.
  • Near-Lossless Quality: At 4 to 8 steps, the generated images are virtually indistinguishable from the 50-step base SDXL model, but arrive in a fraction of the time.
  • User Preference: In user studies, Hyper-SD1.5 was preferred by a wide margin (often over 2:1) compared to other popular acceleration methods like LCM or TCD.
  • Ecosystem Compatibility: The LoRA modules are plug-and-play, working seamlessly with existing tools like ControlNet.

Limitations and Future Work

Like most distilled models, Hyper-SD struggles to maintain the full functionality of Classifier-Free Guidance (CFG), giving users slightly less control over prompt adherence at inference time. Additionally, the authors note that relying on off-the-shelf reward models leaves room for improvement; customized human feedback strategies could push performance further. Finally, while this work focuses on U-Net architectures, applying segmented distillation to Diffusion Transformers (DiT) represents an exciting next frontier.

Summary updated

BibTeX
@inproceedings{ren2024hyper,
  author = {Yuxi Ren and Xin Xia and Yanzuo Lu and Jiacheng Zhang and Jie Wu and Pan Xie and XING WANG and Xuefeng Xiao},
  title = {{Hyper-SD: Trajectory Segmented Consistency Model for Efficient Image Synthesis}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=O5XbOoi0x3},
}
Figure