HiFi Tuner: High-Fidelity Subject-Driven Fine-Tuning for Diffusion Models

Zhonghao Wang, Wei Wei, Yang Zhao, Zhisheng Xiao, Mark Hasegawa-Johnson, Humphrey Shi, Tingbo HouarXiv 2023 · DOI

Abstract

Personalized image generation aims to synthesize specific subjects in diverse contexts using text prompts. However, existing methods often struggle with a trade-off between subject fidelity and model editability, frequently suffering from background leakage or loss of intricate details. We present HiFi Tuner, a parameter-efficient fine-tuning framework designed to enhance the fidelity of subject-driven generation. By incorporating mask guidance, step-wise subject representations, and a reference-guided generation process, HiFi Tuner achieves state-of-the-art performance in preserving subject identity while maintaining high prompt alignment and creative flexibility.

Introduction

The ability to generate images of a specific person, pet, or object in novel scenarios—known as personalized or subject-driven generation—has become a cornerstone of modern computer vision. While large-scale diffusion models like Stable Diffusion provide a powerful foundation, adapting them to a specific subject with only a few reference images remains challenging. Current techniques typically fall into two categories: lightweight embedding optimization (e.g., Textual Inversion) and full-model fine-tuning (e.g., DreamBooth). Both approaches face significant hurdles, ranging from insufficient detail capture to catastrophic forgetting of the model's prior knowledge.

The Fidelity-Efficiency Trade-off

The core challenge in personalization is the "fidelity-efficiency" trade-off. Textual Inversion is highly efficient, learning only a single word embedding to represent the subject. However, this single vector often lacks the capacity to encode complex textures and structural nuances. Conversely, DreamBooth achieves high fidelity by fine-tuning the entire UNet, but this process is computationally intensive and prone to overfitting. Overfitted models often lose their ability to generate diverse backgrounds or adhere to complex text prompts, a phenomenon sometimes accompanied by "background leakage," where training environment elements appear in the generated outputs.

Methodology: The HiFi Tuner Framework

HiFi Tuner addresses these limitations through a multi-faceted approach that refines how the model learns and applies subject representations.

The HiFi Tuner framework overview, showing the transition from source images to subject representation learning and reference-guided generation.

1. Mask Guidance via SAM

To prevent the model from learning irrelevant background information, HiFi Tuner utilizes the Segment Anything Model (SAM) to automatically generate binary masks for the subject in all training images. During the fine-tuning phase, the loss function is masked, ensuring that the gradient updates are driven solely by the subject's pixels. This effectively eliminates background leakage and focuses the model's capacity on the target identity.

2. Parameter Regularization

To maintain the model's generalizability, HiFi Tuner initializes subject embeddings using a portion of the pre-existing null-text embedding. Furthermore, L2 regularization is applied to keep the learned embeddings within a well-behaved region of the latent space. This "anchoring" prevents the subject representation from drifting into regions that might impair the model's ability to interpret surrounding text prompts.

3. Step-wise Subject Representations

A key innovation of HiFi Tuner is the recognition that diffusion models process information differently across timesteps. Early stages of denoising (high $t$) focus on global structure, while later stages (low $t$) refine fine textures. Instead of a static embedding, HiFi Tuner learns a sequence of embeddings tailored to these specific temporal phases. This allows for a more nuanced representation that captures both the broad shape and the intricate details of the subject.

4. Reference-Guided Generation (RGG)

For the final image synthesis, HiFi Tuner employs a "pivotal inversion" technique. By performing DDIM inversion on a selected reference image from the training set, the model obtains a "noise trajectory" that serves as a structural prior. This trajectory guides the generation process, ensuring the subject maintains its structural integrity and color consistency without overriding the contextual changes requested by the user's prompt.

Key Insights: Temporal Dynamics and the Anchor Effect

The success of HiFi Tuner stems from two primary conceptual shifts. First, the move to step-wise representations acknowledges the dynamic nature of the denoising process. As illustrated in the attention maps, the model's focus shifts from coarse to fine features as the timestep decreases.

Visualization of subject features across different DDIM steps, highlighting how the model focuses on different levels of detail over time.

Second, the Anchor Effect provided by regularization ensures that the model remains "editable." By keeping the subject embedding close to the null-text prior, the model retains its ability to blend the subject seamlessly into new environments, avoiding the rigid, "pasted-on" look common in over-regularized models.

Experimental Results

The framework was rigorously evaluated on the DreamBooth dataset, encompassing 30 subjects (21 rigid objects and 9 live animals). Using 25 prompt templates per subject, the authors generated 3,000 images for a comprehensive comparison.

HiFi Tuner demonstrated significant quantitative improvements:

  • Subject Fidelity: It outperformed Textual Inversion by 9.6 points in DINO score and surpassed DreamBooth by 1.2 points.
  • Prompt Alignment: It achieved a 3.6 point lead over Textual Inversion in CLIP-T scores.
  • Qualitative Performance: HiFi Tuner successfully preserved complex visual elements, such as specific logos on beverage cans or the intricate mechanical details of toy robots, which competing methods often blurred or generalized.

Conclusion and Future Directions

HiFi Tuner represents a significant step forward in high-fidelity personalization. By treating the subject representation as a dynamic, step-wise process and utilizing mask guidance, it overcomes the traditional trade-offs of fine-tuning. While the current Reference-Guided Generation (RGG) process is highly effective for rigid objects, its application to non-rigid subjects like animals remains a challenge due to high pose variance. Future research will explore more flexible guidance mechanisms, potentially integrating pose-estimation or control-net architectures to handle the complex deformations of living subjects.

Summary updated

BibTeX
@misc{wang2023hifi,
  author = {Zhonghao Wang and Wei Wei and Yang Zhao and Zhisheng Xiao and Mark Hasegawa-Johnson and Humphrey Shi and Tingbo Hou},
  title = {{HiFi Tuner: High-Fidelity Subject-Driven Fine-Tuning for Diffusion Models}},
  year = {2023},
  eprint = {2312.00079},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.00079},
}
Figure