ComFusion: Enhancing Personalized Generation by Instance-Scene Compositing and Fusion

Yan Hong, Yuxuan Duan, Bo Zhang, Haoxing Chen, Jun Lan, Huijia Zhu, Weiqiang Wang, Jianfu Zhang

Personalizing text-to-image (T2I) models represents a significant frontier in generative AI, enabling users to place specific subjects—such as a personal pet or a unique object—into diverse, imaginative contexts. However, existing methods often struggle with a fundamental trade-off: maintaining the subject's identity ("instance fidelity") versus accurately rendering the requested environment ("scene fidelity").

Researchers from Ant Group and Shanghai Jiao Tong University have introduced ComFusion, a framework designed to harmonize these competing objectives. By training models on the interactions between subjects and scenes, ComFusion achieves state-of-the-art results, particularly in challenging one-shot generation scenarios.

The Challenge of Personalization

Fine-tuning models like Stable Diffusion on a specific subject (e.g., using a unique identifier like "[sks] dog") typically encounters two primary obstacles:

  1. Language Drift: The model's prior knowledge of the general category (e.g., "dog") is overwritten by the specific features of the training images, causing it to "forget" how to render the class in other contexts.
  2. Catastrophic Neglecting: The model may prioritize the subject's visual features so heavily that it ignores scene-specific prompts. For instance, a prompt like "a [sks] dog in the rain" might produce the correct dog but fail to render the rain or its physical effects on the subject.
Comparison of ComFusion against baseline failure modes: (a) Low Personality (poor instance fidelity), (b) Low Diversity (poor scene fidelity), and (c) ComFusion (high fidelity for both).

Methodology: Two-Stream Training

ComFusion addresses these issues through a dual-stream training strategy that bridges the gap between instance and context.

1. The Composite Stream (Class-Scene Prior)

Traditional methods use a generic class prior (e.g., "a dog") to prevent language drift. ComFusion evolves this into a Class-Scene Prior. During training, the model generates images of the general class within the target scene (e.g., "a dog in the rain"). This teaches the model how the category should naturally interact with the specific environment, ensuring the scene description is not neglected during personalization.

2. The Fusion Stream (Visual-Textual Matching)

To achieve fine-grained integration, ComFusion utilizes "coarse images" generated during the denoising process. By adding noise to a scene-prior image and partially denoising it with the personalized prompt, the model creates an intermediate representation.

  • Visual Matching: A DINO-based loss ensures the coarse image retains the specific visual identity of the target instance. Researchers found DINO significantly more effective than CLIP for capturing fine-grained visual patterns.
  • Textual Matching: A CLIP-based loss ensures the image remains aligned with the textual scene description.

This "coarse-to-fine" supervision allows the model to learn how the subject's appearance (lighting, texture) should adapt to the environment.

Experimental Results

The framework was evaluated using a dataset of 25 subjects across 15 distinct scenes, comparing it against established baselines like DreamBooth and Textual Inversion.

Quantitative Performance

ComFusion achieved superior scores across key metrics:

  • Instance Fidelity: DINO (0.658) and CLIP-I (0.814).
  • Scene Fidelity: CLIP-T (0.321).

Qualitative and Human Evaluation

Visual analysis confirms that ComFusion is uniquely capable of rendering complex interactions, such as rain spots on fur or the presence of scene-appropriate objects like umbrellas. In human preference studies, ComFusion was preferred 55.6% of the time for instance fidelity and 62.1% for scene fidelity over all competing baselines.

Conclusion and Future Work

ComFusion demonstrates that effective personalization requires more than just learning a subject's appearance; it requires learning how that subject exists within a scene. While the current fine-tuning process is computationally intensive (requiring ~1200 steps on an A100), the results set a new benchmark for one-shot image generation. Future research may extend this compositing and fusion logic to video and 3D generation tasks.

Summary updated

BibTeX
@inproceedings{hong2024comfusion,
  author = {Yan Hong and Yuxuan Duan and Bo Zhang and Haoxing Chen and Jun Lan and Huijia Zhu and Weiqiang Wang and Jianfu Zhang},
  title = {{ComFusion: Enhancing Personalized Generation by Instance-Scene Compositing and Fusion}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72784-9\_1},
}
Figure