TL;DR
This paper introduces "Self-Corrected Flow Distillation" (SCFD), a novel method to distill knowledge from a powerful flow matching teacher model into a student model capable of generating high-quality images with very few sampling steps (even just one). SCFD addresses the common issues of blurry one-step generations and oversaturated few-step generations, achieving state-of-the-art results on CelebA-HQ and COCO benchmarks.
What Problem Does This Paper Address?
Generative AI models, particularly diffusion models and their recent flow matching counterparts, have achieved remarkable success in synthesizing realistic images. However, a significant bottleneck remains: generating high-quality images often requires a large number of sampling steps (NFEs - Number of Function Evaluations). This makes real-time applications challenging. While techniques like distillation aim to reduce these steps, they often introduce artifacts. Specifically, distilling flow matching models can lead to blurry images in one-step generation and oversaturated, less detailed images in few-step generation. This paper tackles the problem of achieving consistent, high-quality image generation across both one-step and few-step sampling regimes within the flow matching framework.
Methods
The core of this work is the Self-Corrected Flow Distillation (SCFD) framework. It builds upon latent consistency distillation but introduces several key innovations to overcome its limitations:
- Truncated Consistency Loss: To address oversaturation in few-step generation, this loss function selectively applies the consistency loss only for timesteps above a certain threshold (e.g.,
t > 0.4). For earlier timesteps, it uses a loss that directly compares the generated image to the ground truth, preventing the model from learning from near-zero gradients that cause oversaturation. - GAN for One-Step Quality: To combat the blurriness in one-step generated images, a Generative Adversarial Network (GAN) loss is incorporated. This adversarial training encourages the one-step output to be sharp and realistic, similar to techniques used in VQGAN for training stability.
- Reflow Loss: This loss, inspired by Rectified Flow, helps the model self-correct its flow estimation. It encourages the generated flow to be "straight" by penalizing deviations from the one-step prediction (which is already improved by the GAN loss). This further enhances consistency between one-step and few-step outputs.
- Bidirectional Consistency Distillation: To ensure consistency at both ends of the denoising trajectory (from noise to data and vice-versa), a bidirectional loss term is introduced. This loss leverages the high-quality one-step outputs (thanks to the GAN) to guide the student model.
These components are integrated into a unified training objective, allowing the student model to learn a consistent generation process across different sampling speeds.
Datasets
The paper uses the following datasets:
- CelebA-HQ 256: Used for unconditional image generation experiments.
- COCO2014 and COCO2017: Used for zero-shot text-to-image generation benchmarks. The authors evaluate on subsets of these datasets (first 30,000 prompts for COCO2014, first 5,000 for COCO2017).
Key Insights and Ideas
- Latent Space Challenges: The statistical differences between latent and pixel spaces are a primary cause for the blurriness in one-step and oversaturation in few-step generations when directly applying consistency distillation.
- GAN as a Sharpness Booster: A GAN is crucial for improving the sharpness of one-step generated images, which is a common failure mode of simple distillation.
- Truncation is Key for Few-Step: Simply applying consistency loss across all timesteps is problematic. Truncating the loss at later timesteps is essential to prevent oversaturation and maintain detail in few-step generations.
- Reflow for Consistency: The reflow loss acts as a self-correction mechanism, ensuring that the flow estimation is consistent across different sampling steps, especially by anchoring it to the improved one-step output.
- Bidirectional Guidance: Leveraging both the start (noise) and end (clean data) of the generation process through bidirectional loss leads to more robust and consistent results.
Key Results
- CelebA-HQ: SCFD achieves a FID score of 8.06 for one-step generation, outperforming all baselines. For two-step sampling, it achieves an even better FID of 7.67, significantly outperforming Rectified Flow (30.85) and Consistency Distillation (23.56).
- COCO2014 (Zero-Shot): SCFD (Ours-0.9B) achieves the best FID score of 11.91 with one step, surpassing even larger models like InstaFlow-1.7B. It also achieves a CLIP score of 0.312, indicating strong text-image alignment.
- COCO2017 (Zero-Shot): SCFD achieves the best FID of 22.09 and CLIP score of 0.313 for one-step generation. For two-step sampling, it achieves FID of 21.20 and CLIP of 0.317.
- Speed: The model maintains competitive inference times, with one-step generation taking approximately 0.09 seconds.
- Qualitative Results: Figures and tables demonstrate that SCFD produces high-quality, detailed, and consistent images across various sampling steps, without the oversaturation issues seen in other methods.
Limitations and Future Work
- Limitations: The paper acknowledges that while their method significantly mitigates oversaturation, it might not fully eliminate it in all scenarios, especially with very aggressive time-skipping. The statistical discrepancies between latent and pixel spaces remain a fundamental challenge that their method addresses through a combination of techniques.
- Future Work: The authors suggest that their framework is a strong foundation for further research in efficient and consistent generative modeling. The release of their code aims to facilitate future advancements in this area. The paper implicitly suggests that exploring different architectures or more advanced distillation techniques could further push the boundaries of performance.
Summary updated