Taming Encoder for Zero Fine-tuning Image Customization with Text-to-Image Diffusion Models

Xuhui Jia, Yang Zhao, Kelvin C. K. Chan, Yandong Li, Han Zhang, Boqing Gong, Tingbo Hou, Huisheng Wang, Yu-Chuan Su · DOI

Introduction

Personalizing text-to-image (T2I) models has traditionally been a slow and resource-intensive process. While models like Stable Diffusion and Imagen can generate stunning imagery from text, teaching them to recognize a specific, unique object—such as your own pet or a particular person—usually requires fine-tuning the entire network or optimizing specific embeddings. This paper introduces a novel framework that achieves high-fidelity image customization in a single forward pass, eliminating the need for per-object optimization.

The Challenge of Personalization

Existing state-of-the-art methods like DreamBooth or Textual Inversion rely on a "per-object optimization" paradigm. To learn a new subject, these models must be fine-tuned for minutes or even hours, which is computationally expensive and creates significant storage overhead if one wishes to save models for many different subjects. The goal of this research is to create a single, general model capable of instant (zero-shot) customization using only one reference image, while maintaining full text-based editability.

Proposed Framework: Zero Fine-tuning Customization

The authors augment a pre-trained diffusion model with a dedicated image encoder to bypass the optimization phase.

Encoder-Based Conditioning

Instead of optimizing a text prompt to represent an object, the system uses a frozen CLIP image encoder. This encoder extracts high-level semantic features from a background-masked reference image. These features are then injected into the diffusion model's cross-attention layers, allowing the model to "see" the subject it needs to generate.

Training Strategies

To ensure the model doesn't lose its general creative abilities or become overly reliant on the reference image's specific lighting and pose, several techniques were employed:

  • Regularized Joint Training: The model is trained on a mix of general-domain data and domain-specific datasets (like faces or dogs).
  • Cross-Reference Regularization: By using the embedding of one image of a subject to reconstruct a different image of the same subject, the model learns to capture invariant identity features rather than just copying pixels.
  • PaLI Captioning: Large language-image models (PaLI) are used to generate detailed captions for domain-specific data, ensuring the model correctly associates visual features with text descriptions.
Figure 2: Overview of the zero-shot customization results across different animal categories. The leftmost images in each group are the reference subjects, followed by various text-driven edits.

Key Insights

A critical finding was that CLIP embeddings are significantly more effective than VGG features for this task. While VGG focuses on low-level textures, CLIP captures the abstract concept of an identity, which is essential for placing that identity into entirely new contexts, such as a dog riding a rocketship.

Furthermore, the authors addressed the "Dominance Problem," where the image condition might overpower the text prompt (e.g., ignoring a request for a "sketch" because the reference is a photo). Strategies like "Object-Embedding Dropping" were used to keep the model responsive to textual instructions.

Results and Performance

The proposed method generates personalized images in a single forward pass, a massive speedup compared to the ~20 minutes required by DreamBooth. Quantitatively, the model outperforms baselines in Object Similarity (OSim) and image quality (measured by KID).

Figure 1: A German Shepherd subject generated in a novel context ("a dog riding a rocketship heading towards the moon") using the proposed zero-shot method.

Qualitatively, the model excels at preserving identity while allowing for extreme stylistic changes, such as turning a real person into a painting or placing an animal in a fantastical setting.

Conclusion and Future Work

This work demonstrates that a well-regularized image encoder can enable instant, high-fidelity customization of diffusion models. While the model currently relies on a single reference image—which can lead to hallucinations of occluded details—future iterations could extend this framework to accept multiple reference images for even greater accuracy without sacrificing the zero-fine-tuning speed.

Summary updated

BibTeX
@misc{jia2023taming,
  author = {Xuhui Jia and Yang Zhao and Kelvin C. K. Chan and Yandong Li and Han Zhang and Boqing Gong and Tingbo Hou and Huisheng Wang and Yu-Chuan Su},
  title = {{Taming Encoder for Zero Fine-tuning Image Customization with Text-to-Image Diffusion Models}},
  year = {2023},
  eprint = {2304.02642},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.02642},
}
Figure