UniControl: A Unified Diffusion Model for Controllable Visual Generation In the Wild

Can Qin, Shu Zhang, Ning Yu, Yihao Feng, Xinyi Yang, Yingbo Zhou, Huan Wang, Juan Carlos Niebles, Caiming Xiong, Silvio Savarese, Stefano Ermon, Yun Fu, Ran Xu

TL;DR

UniControl is a unified generative foundation model that consolidates nine distinct structural control tasks—such as depth maps, edge detection, and human skeletons—into a single framework. By utilizing a task-aware HyperNet and a Mixture-of-Experts (MOE) adapter, it achieves state-of-the-art controllable generation while maintaining a compact model size. Remarkably, it also demonstrates surprising zero-shot capabilities on unseen tasks like image deblurring and colorization.

The Fragmentation of Controllable Generation

While Large Language Models (LLMs) have successfully unified diverse NLP tasks into single "foundation" models, the world of controllable image generation has remained highly fragmented. Tools like ControlNet allow users to guide Stable Diffusion using spatial conditions (e.g., "follow these edges"), but each control modality typically requires its own separate, heavy model.

If a user wants to use Canny edges, depth maps, and segmentation masks simultaneously or switch between them, they end up managing a massive ensemble of models. This fragmentation prevents models from learning the intrinsic geometric relationships between different tasks (e.g., how depth relates to segmentation) and makes it nearly impossible to generalize to new, unseen control types without expensive retraining.

Overview of UniControl's capabilities, showcasing pre-training tasks like Canny edge and depth map to image, alongside zero-shot combinations and tasks.

How UniControl Works

To address this, the authors introduce UniControl, which builds upon the Stable Diffusion and ControlNet architectures but adds two critical components to enable seamless multi-tasking:

  1. MOE-Style Adapter: To handle the "misalignment" of low-level features across tasks, the model uses a set of small, task-specific convolution modules (only ~70K parameters each). These act as "experts" that extract the unique low-level signatures of a specific input, differentiating between the thin lines of a Canny edge and the colorful blocks of a segmentation map.
  2. Task-Aware HyperNet: Acting as the "brain" of the system, this component takes a natural language task instruction (e.g., "canny edge to image") and generates a task-aware embedding. This embedding is then used to modulate the weights of the main diffusion model's layers, allowing the model to dynamically "shift" its internal logic based on the user's request.

By combining these innovations, UniControl can handle multiple tasks within a single 1.44B parameter model—significantly smaller than the 4.32B parameters required to run nine separate ControlNet instances.

Training on MultiGen-20M

To train such a versatile model, the researchers created MultiGen-20M, a massive dataset containing over 20 million image-text-condition triplets derived from a high-aesthetics subset of LAION-5B. The dataset covers nine distinct conditions: Canny edges, HED edges, User Sketches, Segmentation Maps, Bounding Boxes, Human Skeletons, Depth Maps, Surface Normals, and Image Outpainting.

Key Insights: Synergy and Zero-Shot Generalization

  • Cross-Task Synergy: One of the most important findings is that training on multiple tasks actually improves performance on individual ones. The model learns a "universal representation" of geometry. For example, understanding surface normals helps the model better interpret depth maps.
  • Zero-Shot Generalization: Because the model is conditioned on natural language instructions via the HyperNet, it can handle tasks it was never explicitly trained on. By combining the "knowledge" of its pre-trained tasks, it can perform image deblurring, colorization, and inpainting out of the box.
  • Hybrid Control: UniControl can handle "hybrid" prompts. A user can provide a segmentation map for the background and a human skeleton for the foreground, and the model successfully merges these constraints into a coherent image.
Zero-shot hybrid control combining a segmentation map for the background and human skeletons for the foreground to generate a coherent image.

Results and Limitations

UniControl's unified approach yields significant benefits. In head-to-head comparisons, UniControl outperformed single-task ControlNets in Image Perceptual Distance on 5 out of 6 tasks (Canny, HED, Normal, Depth, and Pose). Furthermore, user studies showed that humans preferred UniControl’s outputs over official ControlNet checkpoints across all tested tasks, particularly praising its ability to maintain fine-grained detail and structural alignment.

Despite its versatility, UniControl inherits some common limitations of Stable Diffusion. Generating high-quality human faces and hands remains a challenge. Additionally, because it was trained on a subset of LAION, the model carries the same social, cultural, and aesthetic biases present in that dataset. Future work may involve scaling the model to include more complex "in-the-wild" conditions or integrating it with LLMs for advanced multi-step visual reasoning.

Summary updated

BibTeX
@inproceedings{qin2023unicontrol,
  author = {Can Qin and Shu Zhang and Ning Yu and Yihao Feng and Xinyi Yang and Yingbo Zhou and Huan Wang and Juan Carlos Niebles and Caiming Xiong and Silvio Savarese and Stefano Ermon and Yun Fu and Ran Xu},
  title = {{UniControl: A Unified Diffusion Model for Controllable Visual Generation In the Wild}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=v54eUIayFh},
}
Figure