Multivariate Diffusion Transformer with Decoupled Attention for High-Fidelity Mask-Text Collaborative Facial Generation

Yushe Cao, Dianxi Shi, Xing Fu, Xuechao Zou, Haikuo Peng, Xueqi Li, Chun Yu, Junliang Xing

TL;DR

MDiTFace is a novel diffusion transformer framework designed for high-fidelity, mask-text collaborative facial generation. By introducing a unified tokenization strategy and a clever decoupled attention mechanism that separates time-dependent and static features, it slashes mask-induced computational overhead by over 94% while achieving state-of-the-art generation quality and conditional consistency.

What Problem Does This Paper Address?

Generating realistic human faces based on user inputs is a major goal in computer vision. While text descriptions offer excellent high-level semantic control (e.g., "wavy hair," "dark skin"), language is inherently ambiguous when it comes to precise spatial layouts. Conversely, visual conditions like semantic masks provide exact geometric boundaries but lack semantic versatility.

To get the best of both worlds, researchers have turned to multimodal collaborative generation. However, existing methods either process these modalities in isolation or rely on simple feature fusion (like channel-wise concatenation), which leads to poor cross-modal interaction and mismatched outputs. Furthermore, scaling up Diffusion Transformers (DiTs) to handle multiple conditional inputs typically causes a massive, quadratic explosion in computational complexity, making high-resolution facial synthesis incredibly expensive.

Methods

The authors introduce MDiTFace, built upon the FLUX.1 text-to-image foundation model, to address these interaction and efficiency bottlenecks through three core components:

  1. Unified Tokenization: To bridge the representation gap between heterogeneous modalities, MDiTFace encodes semantic masks using a VAE and text using a pre-trained T5 encoder. Both are projected into a shared latent space alongside noisy image tokens. Crucially, Rotary Position Embeddings (RoPE) are applied to the mask tokens to preserve precise spatial alignment with the image.
  2. Multivariate Transformer Block: The vanilla dual-stream transformer block is upgraded to a tri-stream attention architecture, allowing text, mask, and image tokens to interact synchronously and bidirectionally.
  3. Decoupled Attention Mechanism: To mitigate the computational cost of processing extra mask tokens over dozens of diffusion steps, the authors decouple the attention block into two pathways:
  4. Dynamic Pathway: Handles time-dependent computations (image and text tokens modulated by the diffusion timestep).
  5. Static Pathway: Processes the joint multimodal condition tokens ($\langle\text{Mask, Text}\rangle$). Because this pathway is independent of the diffusion timesteps, it only needs to be computed once at the initial stage. Its features are cached and reused across all subsequent denoising steps.
Overall framework of our MDiTFace method.

The model is efficiently trained using Low-Rank Adaptation (LoRA), modifying less than 0.1% of the total parameters. It also employs a stochastic condition dropout strategy during training to support unimodal driving (generating images from text-only or mask-only inputs).

Datasets

The framework was trained and evaluated on three high-resolution facial datasets:

  • MM-CelebA: A large-scale benchmark containing 30,000 real-world facial images, each paired with 10 text descriptions and a manually annotated 19-category semantic mask.
  • MM-FFHQ: An extension of the FFHQ-Text dataset, where semantic masks were extracted using a pre-trained facial parser.
  • MM-FairFace: An extension of the FairFace dataset (designed to minimize racial, gender, and age biases), with masks similarly generated via a facial parser.

Key Insights and Ideas

  • The Caching "Aha!" Moment: The authors realized that while the noisy image tokens change drastically at every diffusion timestep, the relationship between the conditioning mask and the text prompt remains completely static. By isolating this timestep-independent interaction into a separate pathway, they could cache the results and avoid redundant calculations.
  • The Danger of Hard Decoupling: Initially, the authors tried a "hard-decoupled" attention structure that computed mask self-attention entirely in isolation. However, this broke the model's ability to link text attributes to specific mask regions (e.g., applying "red hair" to the hair mask region). The breakthrough came from feeding the concatenated $\langle\text{Mask, Text}\rangle$ sequence into the static pathway, restoring the crucial mask-to-text perceptual link.
Internal attention design of the multivariate transformer block.

Key Results

  • Computational Efficiency: The improved decoupled attention mechanism reduced mask-induced computational overhead from 185.79 TFLOPs to just 9.95 TFLOPs—a massive 94.7% reduction—with virtually no loss in generation quality.
  • State-of-the-Art Performance: MDiTFace consistently outperformed competing models (including TediGAN, ControlNeXt, and MM2Latent) across all evaluation metrics. On the MM-CelebA dataset, it improved image fidelity (CMMD) by 34.33% and mask alignment accuracy by 0.87% over the second-best methods.
  • User Preference: In a 30-participant user study, MDiTFace secured the highest preference score (38%), far outperforming the runners-up.
  • Multimodal Flexibility: Beyond mask-text pairs, the architecture demonstrated robust generalization to other modalities, successfully generating high-quality faces from sketch-text combinations.

Limitations and Future Work

Despite the massive reduction in mask-processing overhead, MDiTFace is still bound by the iterative denoising nature of diffusion models, making its overall inference time slower than traditional GAN-based architectures. The authors note that future work will focus on integrating accelerated sampling techniques or sparse attention mechanisms to further boost inference speeds.

Summary updated

BibTeX
@inproceedings{cao2026multivariate,
  author = {Yushe Cao and Dianxi Shi and Xing Fu and Xuechao Zou and Haikuo Peng and Xueqi Li and Chun Yu and Junliang Xing},
  title = {{Multivariate Diffusion Transformer with Decoupled Attention for High-Fidelity Mask-Text Collaborative Facial Generation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i4.37255},
}
Figure