Object-level Visual Prompts for Compositional Image Generation

Gaurav Parmar, Or Patashnik, Kuan-Chieh Wang, Daniil Ostashev, Srinivasa Narasimhan, Jun-Yan Zhu, Daniel Cohen-Or, Kfir Aberman · DOI

Introduction

Text-to-image diffusion models have revolutionized content creation, yet they often struggle to capture specific visual details that are difficult to articulate in words—such as the unique markings of a pet or the exact pattern on a custom object. While image-prompting methods like IP-Adapter address this by using images as conditions, they face a significant "Identity-Diversity Trade-off": high-fidelity encoders often overfit to the original object's pose and layout, while coarse encoders lose the object's unique identity. Furthermore, multi-object prompting frequently leads to "attribute bleeding," where features from different objects blend unnaturally.

VisualComposer enables complex image generation using multiple object-level visual prompts and backgrounds.

This paper introduces VisualComposer, a framework designed for compositional image generation using multiple object-level visual prompts. By decoupling layout and appearance within the diffusion model's attention mechanism, VisualComposer allows for high-fidelity object preservation while maintaining the flexibility to generate diverse, natural-looking scenes.

Methodology

VisualComposer's core innovation lies in its treatment of the cross-attention layers within the diffusion pipeline, specifically addressing the limitations of uniform image encoding.

KV-Mixed Cross-Attention

In standard cross-attention, Keys (K) typically influence spatial layout, while Values (V) carry appearance information. VisualComposer exploits this by employing a two-stream architecture that mixes representations:

  1. Coarse Encoder: A bottlenecked encoder generates the Keys, providing enough spatial information for placement without overfitting to the input's exact pose.
  2. Fine-Grained Encoder: A high-capacity encoder generates the Values, ensuring the specific identity and intricate details of the visual prompt are preserved.
Comparison of different KV strategies: Mixed KV (Ours) successfully balances object scene variations with identity preservation.

Compositional Guidance

To mitigate attribute bleeding, the authors implement a two-stage inference process. An initial generation is segmented using an open-set model (SAM2) and matched to input prompts via DINOv2. The cross-attention maps are then dynamically masked during the denoising process, ensuring each visual prompt only influences its corresponding segmented region. This hard boundary prevents feature leakage between distinct objects.

Evaluation and Results

The model was trained on a combination of real data from COYO-700M and synthetic multi-object images generated via Flux, with automated captioning and segmentation. Evaluation was performed on a modified DreamBooth dataset featuring 300 complex compositional test cases.

Quantitative Performance

VisualComposer outperformed baselines such as IP-Adapter, BLIP-Diffusion, and KOSMOS-G. It achieved a superior balance between diversity (LPIPS: 0.688) and identity preservation (DINO: 0.518, CLIP: 0.676).

Human Evaluation

In a large-scale study involving 13,500 pairwise comparisons, human evaluators preferred VisualComposer's outputs over existing state-of-the-art methods in 59.9% to 72.6% of cases. The model demonstrated a unique ability to place multiple objects realistically without the "floating" artifacts or concept fusion common in other methods.

Discussion and Limitations

A notable emergent property of this architecture is spatial control; by manually shifting the attention maps associated with a specific prompt, users can influence the object's position and pose within the generated scene.

However, the model still faces challenges with semantically unusual combinations. For instance, prompting a shoe and a dog in a forest might lead the model to hallucinate a human leg to justify the shoe's presence. Future work will address these semantic constraints and explore methods for watermarking or attributing generated content to mitigate risks associated with deceptive imagery.

Summary updated

BibTeX
@inproceedings{parmar2025object,
  author = {Gaurav Parmar and Or Patashnik and Kuan-Chieh Wang and Daniil Ostashev and Srinivasa Narasimhan and Jun-Yan Zhu and Daniel Cohen-Or and Kfir Aberman},
  title = {{Object-level Visual Prompts for Compositional Image Generation}},
  booktitle = {SIGGRAPH Asia},
  year = {2025},
  doi = {10.1145/3757377.3763867},
}
Figure