IMPRINT: Generative Object Compositing by Learning Identity-Preserving Representation

Yizhi Song, Zhifei Zhang, Zhe Lin, Scott Cohen, Brian L. Price, Jianming Zhang, Soo Ye Kim, He Zhang, Wei Xiong, Daniel G. Aliaga

Introduction

Generative object compositing—the process of seamlessly integrating a specific foreground object into a new background—is a cornerstone of modern image editing. However, achieving a result that is both physically realistic and identity-faithful remains a significant challenge. Traditional methods often fall into two traps: they either produce "copy-paste" artifacts that fail to harmonize with the new environment's lighting and geometry, or they "hallucinate" a generic version of the object, losing the unique characteristics that define the specific subject.

To address this, the researchers propose IMPRINT, a novel two-stage diffusion framework. By decoupling identity preservation from background harmonization, IMPRINT allows for realistic adjustments in pose and lighting while maintaining the fine-grained details of the original object.

The Core Dilemma: Identity vs. Harmony

The fundamental tension in compositing lies between Identity Preservation and Harmonization. Identity preservation ensures the object remains recognizable (e.g., a specific pet rather than a generic breed), while harmonization ensures the object adapts its color, shadows, and perspective to the new scene.

Existing generative models often struggle because they attempt to learn both tasks simultaneously. This frequently leads to a "shortcut" where the model prioritizes one over the other. IMPRINT overcomes this by treating these as distinct, sequential learning objectives.

The IMPRINT Framework

IMPRINT utilizes a two-stage strategy to effectively "decouple" the learning process, ensuring that the model understands what an object is before it learns how to place it.

Stage 1: Context-Agnostic ID-Preserving Pretraining

The first stage focuses solely on identity. Using a DINOv2 backbone as an image encoder, the model is trained to learn "view-invariant" features. By tasking the model with reconstructing an object from one perspective given a different view of the same object, the encoder learns to capture the "essence" of the object—its textures, structures, and unique markers—rather than just memorizing specific pixel arrangements. This stage utilizes large-scale multi-view datasets like MVImgNet and Objaverse.

Stage 2: Generative Compositing

In the second stage, the learned encoder is integrated into a Stable Diffusion-based generator. A critical design choice here is the freezing of the DINOv2 backbone. By keeping the backbone frozen, the researchers prevent the model from reverting to "copy-paste" behavior, forcing the UNet generator to learn how to harmonize the high-quality identity features with the new background context.

Technical Innovations

Beyond the two-stage architecture, IMPRINT introduces several key mechanisms to refine the compositing process:

  • Sequential Collaborative Training: To balance the learning between the new content adapter and the UNet generator, the authors employ a strategy that alternates the learning rates of different components across epochs. This prevents one component from dominating the training process and ensures a balanced output.
  • Shape-Guidance via Multi-Level Masks: Unlike previous models that relied on rigid bounding boxes, IMPRINT incorporates a mask-control mechanism. Users can provide coarse masks to guide the object's placement and pose. This allows for non-rigid transformations—such as making a dog sit or stand—while still respecting the user's spatial constraints.

Experimental Results

The model was trained on a diverse array of datasets, including YoutubeVOS, VIPSeg, and PPR10K for natural object-background pairs, and Pixabay for high-resolution harmonization.

Quantitative Performance

IMPRINT significantly outperformed state-of-the-art baselines such as Paint-by-Example, ObjectStitch, and TF-ICON. On the DreamBooth dataset, IMPRINT achieved superior scores across multiple metrics:

  • DINO-score (Identity Similarity): 43.45 (compared to the next best at 39.29).
  • CLIP-score (Semantic Similarity): Leading performance in maintaining the overall meaning of the scene.
  • DreamSim (Perceptual Similarity): Highest scores in human-aligned visual quality.

Qualitative and Human Evaluation

Visual analysis confirms that IMPRINT maintains complex textures—such as the intricate face of a watch or specific patterns on a backpack—while correctly adjusting for perspective and environmental lighting. In human preference studies, users preferred IMPRINT's results for both realism and fidelity by margins often exceeding 60-80% over competing methods.

Limitations and Future Directions

While IMPRINT represents a major step forward, certain challenges remain. Extreme pose changes can still lead to a slight loss in identity details, a problem the authors suggest might be solved by incorporating 3D models or NeRF representations in future iterations. Additionally, like many current diffusion models, IMPRINT struggles with the perfect preservation of tiny, legible text or highly intricate logos. Future work will likely focus on improving the latent auto-encoder to minimize information loss during the initial encoding phase.

Conclusion

IMPRINT demonstrates that by decoupling identity representation from generative harmonization, it is possible to create highly realistic composites that respect the unique features of a source object. Its two-stage approach and innovative training strategies set a new benchmark for identity-preserving image editing.

Summary updated

BibTeX
@inproceedings{song2024imprint,
  author = {Yizhi Song and Zhifei Zhang and Zhe Lin and Scott Cohen and Brian L. Price and Jianming Zhang and Soo Ye Kim and He Zhang and Wei Xiong and Daniel G. Aliaga},
  title = {{IMPRINT: Generative Object Compositing by Learning Identity-Preserving Representation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2024},
}
Figure