Abstract
Standard diffusion models, such as Stable Diffusion, utilize a static set of U-Net parameters across the entire denoising process. This "one-size-fits-all" approach is suboptimal, as different stages of generation—from global structure formation to fine texture refinement—require distinct parameter specializations. We present MaskUNet, a framework that introduces dynamic, timestep- and sample-dependent masking of U-Net weights. By selectively activating specific parameters during inference, MaskUNet significantly improves image quality and semantic alignment without altering the original pre-trained weights. Our results demonstrate substantial gains in FID and CLIP scores, as well as enhanced performance in complex semantic binding tasks.
Introduction
In traditional deep learning architectures like ResNets or GANs, layers naturally specialize: shallow layers handle basic structures, while deeper layers manage fine textures. However, diffusion models typically reuse the exact same U-Net parameters at every step of the generation process. At $t=900$, the model must determine global composition (e.g., placing a mountain), while at $t=10$, it focuses on local details (e.g., the texture of grass). Forcing the same weights to perform both tasks simultaneously creates a bottleneck. MaskUNet addresses this by discovering that "less is more"—identifying and masking parameters that may be distracting or redundant at specific stages of generation.
Methodology
MaskUNet applies a binary mask to U-Net weights, preserving the original model's general knowledge while tailoring its application. The authors propose two strategies for mask generation:
- Training-based Approach: A lightweight "Parameter Sampler" (a small MLP) is introduced. It takes the current timestep and latent features as input to output a dynamic mask. This sampler is trained using standard diffusion loss on a small dataset (e.g., 20k images from Laion-art). To maintain differentiability, the Gumbel-Sigmoid trick is employed.
- Training-free Approach: For scenarios where training is not feasible, the mask is iteratively optimized during inference using "Reward Models" (such as ImageReward or HPSv2). This ensures the mask is perfectly aligned with the specific prompt provided.
Key Insights and Results
A core discovery of this work is that the U-Net is significantly over-parameterized for any single denoising step. The researchers observed that even random masking can occasionally improve results, suggesting that specific weights are more relevant at different timesteps. Furthermore, the ideal mask is sample-dependent; the parameters required to generate a "zebra" differ from those needed for a "sunset."
Performance Benchmarks
MaskUNet was evaluated on COCO 2014 and 2017 benchmarks for zero-shot generation:
- Image Quality: On COCO 2014, MaskUNet achieved an FID of 11.72, outperforming both the base Stable Diffusion 1.5 (12.85) and LoRA-based fine-tuning (12.82).
- Semantic Binding: Using the GenEval benchmark, MaskUNet improved attribute correspondence (e.g., correctly linking colors to specific objects) by over 21% when combined with SynGen.
- Versatility: The method is highly adaptable and was successfully integrated into downstream tasks including DreamBooth, ReVersion, and Text2Video-Zero, yielding consistent quality improvements.
Conclusion
MaskUNet demonstrates that dynamic parameter selection is a powerful alternative to traditional fine-tuning. By preserving original weights, it avoids the "catastrophic forgetting" common in standard weight updates. While the training-free version introduces some inference latency due to iterative optimization, the overall framework provides a robust, plug-and-play solution for enhancing diffusion model performance. Future work may explore hybrid approaches that combine LoRA for new knowledge injection with MaskUNet for efficient, timestep-aware parameter utilization.
Summary updated