Do We Need to Design Specific Diffusion Models for Different Tasks? Try ONE-PIC

Ming Tao, Bing-Kun Bao, Yaowei Wang, Changsheng XuarXiv 2024 · DOI

Introduction

The rapid evolution of diffusion models has led to a proliferation of task-specific architectures. Whether it is edge-to-image generation, virtual try-on, or subject-driven generation, the standard approach involves adding heavy auxiliary branches like ControlNet's extra encoder or IP-Adapter's CLIP image encoder. This "network design gap" between pretraining and fine-tuning creates significant friction: it slows down training, complicates model sharing, and often fails to fully leverage the knowledge already present in pretrained weights.

ONE-PIC addresses this by asking a fundamental question: Can we achieve a universal fine-tuning approach for diffusion models without designing new neural network modules for every task? By reframing diverse generation tasks as in-context visual learning problems, ONE-PIC offers a streamlined, parameter-efficient alternative.

Methodology: In-Context Visual Learning

ONE-PIC introduces a unified, module-free framework built on a frozen SDXL model. It operates on two primary pillars that eliminate the need for task-specific encoders:

1. In-Visual-Context Tuning

Instead of using separate encoders for conditional inputs, ONE-PIC treats conditions as "visual prompts." Reference images (e.g., a Canny edge map, a depth map, or a specific garment) are stitched together with the target image into a single composite grid (e.g., 1x2 or 2x2). This allows the standard U-Net to process both the context and the target simultaneously, mimicking the in-context learning capabilities seen in Large Language Models (LLMs). The model learns to attend to relevant features in the reference images to guide the generation in the target region.

2. Targeted Masking Strategy

The framework frames downstream generation as an inpainting task. During training, forward diffusion is applied only to the target region within the stitched grid, while the reference regions remain clean. The model is then trained to denoise only the masked portion, using the surrounding unmasked images as context. This alignment with the model's original denoising objective—predicting missing or noisy pixels—accelerates convergence and preserves the model's prior knowledge.

Overview of ONE-PIC's versatility across diverse tasks including conditional control, subject-driven generation, and image editing.

Experimental Setup and Datasets

The authors validated ONE-PIC across several distinct downstream tasks using standard benchmarks to ensure a fair comparison with specialized models:

  • Visual Conditional Controls: Evaluated using a 20,000-sample subset of the LAION-Art dataset.
  • Subject-Driven Generation (DreamBooth): Tested on the DreamBench dataset, covering 30 subjects and 750 prompts.
  • Image Editing: Benchmarked on the MagicBrush dataset, which features manually annotated instructions.
  • Virtual Try-On: Evaluated on the high-resolution VITON-HD dataset.

Key Insights and Results

The simplicity of ONE-PIC yields several significant advantages over traditional multi-branch architectures:

  • Blazing Fast Convergence: For tasks like Canny-to-image, ONE-PIC converges in just 400 steps (approx. 10 minutes on 4x RTX A6000s). This is a massive improvement over ControlNet, which typically requires thousands of steps and days of training to grasp the same task.
  • High Resource Efficiency: In the complex Virtual Try-On domain, ONE-PIC matches the performance of specialized models like StableVITON while consuming only 2% of the computational resources.
  • Parameter Efficiency: By utilizing Low-Rank Adaptation (LoRA) on the U-Net's attention layers, only 0.618% of the total parameters are trainable, making it highly accessible for researchers with limited hardware.
  • Spatial Layout Sensitivity: The physical arrangement of the grid acts as a form of "visual prompt engineering." For spatial control, a 2x2 grid provides the best positional cues, whereas a 1x3 layout (clothing, masked person, target) is optimal for clothing transfer.

Conclusion and Future Work

ONE-PIC demonstrates that specific architectural designs for different diffusion tasks may be unnecessary. By leveraging the inherent inpainting and in-context capabilities of pretrained models, ONE-PIC provides a fast, efficient, and universal alternative that bridges the gap between pretraining and fine-tuning.

However, the approach increases the input resolution, leading to higher inference costs and memory usage. Future research will explore adapting ONE-PIC to Diffusion Transformer (DiT) architectures and finding strategies to reduce the inference cost associated with large visual contexts.

Summary updated

BibTeX
@misc{tao2024do,
  author = {Ming Tao and Bing-Kun Bao and Yaowei Wang and Changsheng Xu},
  title = {{Do We Need to Design Specific Diffusion Models for Different Tasks? Try ONE-PIC}},
  year = {2024},
  eprint = {2412.05619},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.05619},
}
Figure