A Simple Approach to Unifying Diffusion-based Conditional Generation

Xirui Li, Charles Herrmann, Kelvin C.k. Chan, Yinxiao Li, Deqing Sun, Chao Ma, Ming-Hsuan Yang

Recent progress in image generation has sparked research into controlling diffusion models through condition signals. However, the field remains highly fragmented. UniCon is a newly proposed unified diffusion framework that learns the joint distribution of image-condition pairs (e.g., image and depth) to handle diverse tasks—like controllable generation, depth estimation, and joint generation—within a single model.

By utilizing a parallel-branch architecture with joint cross-attention and independent noise sampling, UniCon achieves performance comparable to specialized models while adding only 15% more parameters to a base text-to-image model.

The Problem of Fragmented Conditional Generation

Traditionally, conditional generation tasks are treated as separate problems requiring specialized architectures and training pipelines. For instance:

  • Generating an image from a depth map relies on tools like ControlNet.
  • Estimating depth from an existing image requires models like Marigold.
  • Generating both simultaneously might use LDM3D.

While these tasks all rely on the same underlying correlation between an image and its condition, previous attempts to unify them introduced significant complexity, such as multi-stage training, heavy architectural modifications, or the requirement of explicit inpainting masks. The authors of UniCon ask a fundamental question: Can we learn a single joint distribution that handles all these "directions" of generation efficiently?

UniCon unified framework capabilities

The UniCon Methodology

UniCon (Unified Conditional generation) treats conditional tasks as sampling from a joint distribution $p(x, y)$, where $x$ is the image and $y$ is the condition (like a depth map or pose). The framework introduces several key innovations:

  • Parallel Branch Architecture: Instead of concatenating inputs, UniCon uses two parallel branches. The "x-branch" (image) typically uses frozen weights from a pretrained model (like Stable Diffusion) to preserve the generative prior. The "y-branch" (condition) uses LoRA (Low-Rank Adaptation) to learn the specific modality.
  • Joint Cross-Attention: This core structural change injects new attention modules where features from the image branch attend to the condition branch and vice versa. This allows the model to "align" the two modalities spatially and semantically.
  • Disentangled Noise Sampling: During training, the model samples independent timesteps ($t_x$ and $t_y$) for the image and condition, rather than adding the same amount of noise to both. This "disentanglement" allows the model to handle various scenarios at inference time:
  • Generation: Clean condition ($t_y=0$) $\rightarrow$ Noisy image.
  • Estimation: Clean image ($t_x=0$) $\rightarrow$ Noisy condition.
  • Joint Generation: Both inputs are noisy.

Remarkably, the model is trained in a single stage and adds only about 15% additional parameters to the base model.

Key Insights and Flexibility

By training with independent noise levels, the model learns to treat a "clean" input as a signal to guide the "noisy" one. This acts as an implicit mask, removing the need for the explicit inpainting masks used in prior unified models like JointNet. Furthermore, the authors found that learning to generate the condition (e.g., depth) actually helps the model generate better images; jointly modeling the pair captures the correlation more deeply than one-way conditioning.

Unlike ControlNet, which struggles with conditions that aren't pixel-aligned (like a person's identity or a general "style"), UniCon’s cross-attention mechanism naturally handles loosely correlated pairs. Because UniCon uses LoRA and keeps the base model mostly frozen, the learned "joint attention" modules can theoretically be plugged into other community-finetuned models.

Results and Performance

The researchers trained and evaluated UniCon across several modalities, including Depth & SoftEdge (PascalVOC), Human Pose, Identity (CelebA), and Appearance (Panda70M).

  • Controllable Generation: UniCon outperformed specialized methods like ControlNet and Readout-Guidance in both image quality (FID) and condition alignment.
  • Depth Estimation: On zero-shot benchmarks (NYUv2), UniCon achieved an AbsRel of 7.9, significantly better than the previous unified model JointNet (13.7) and competitive with specialized estimators like DPT.
  • Multi-Signal Control: Multiple UniCon models (e.g., one for Pose and one for Identity) can be combined at inference time to generate an image that satisfies all conditions simultaneously.

Limitations and Future Work

Because UniCon runs two parallel branches and extra attention layers, it experiences an inference overhead, running roughly 2x slower than ControlNet (5.02 iterations/sec vs 10.82). The authors suggest LoRA weight fusion as a potential fix. Additionally, while UniCon handles identity and appearance, these "loosely correlated" tasks are more unstable than dense tasks like depth, likely requiring more training data. Finally, the joint cross-attention mechanism requires a certain scale of data to succeed; performance drops significantly if the training set is too small.

Summary updated

BibTeX
@inproceedings{li2025simple,
  author = {Xirui Li and Charles Herrmann and Kelvin C.K. Chan and Yinxiao Li and Deqing Sun and Chao Ma and Ming-Hsuan Yang},
  title = {{A Simple Approach to Unifying Diffusion-based Conditional Generation}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=tAGmxz1TUi},
}
Figure