Compose and Conquer (CnC) is a novel framework designed to endow diffusion models with a robust understanding of 3D depth and the ability to inject specific styles into localized regions. By leveraging Depth Disentanglement Training (DDT) and a unique Soft Guidance mechanism, CnC allows users to compose complex scenes where objects correctly occlude one another while carrying distinct visual semantics from multiple reference images.
The Challenge of Spatial and Semantic Control
While text-to-image models like Stable Diffusion produce impressive visuals, they notoriously struggle with precise layout instructions. Prompting a model to place an object exactly behind another, or requesting a "cyberpunk" cat sitting in a "renaissance" room, often results in failure.
Existing solutions like ControlNet offer spatial control using depth maps or edge detection, but they typically treat the world as a flat 2D projection. They struggle with the "z-axis"—understanding how objects at different depths should interact or occlude each other. Furthermore, "concept bleeding" remains a major issue: providing multiple style references usually causes the model to mix them globally rather than keeping them localized to specific objects.
Methodology: Depth Disentanglement and Soft Guidance
To address these limitations, the authors introduce two primary innovations within the CnC framework:
1. Depth Disentanglement Training (DDT)
Instead of training on a single, flattened depth map, the authors utilize "synthetic image triplets." They take an image, extract a foreground object, and then use AI inpainting to "fill in" the occluded background. This process yields a foreground image, a background image, and a mask.
By training the model on separate depth maps for these distinct layers, the model learns to understand occlusion—specifically, how a foreground object should "conquer" the space in front of the background. Unlike previous works that fuse all conditions immediately, DDT processes foreground and background depth maps in independent streams before concatenating them. This "late fusion" helps the model maintain the identity of different depth layers.
2. Soft Guidance
This technique enables localized semantic injection without relying on rigid structural cues. Soft Guidance manipulates the cross-attention layers of the diffusion model. By applying a mask to the similarity matrix during the attention process, the model is forced to attend to specific CLIP image embeddings (reference styles) only within designated regions. This effectively prevents the style of the foreground from leaking into the background, achieving clean semantic boundaries.
The overall architecture consists of a Local Fuser (handling depth and spatial signals) and a Global Fuser (handling style and CLIP embeddings), which feed into a trainable copy of the Stable Diffusion UNet encoder.
Datasets and Training
The model was trained and evaluated using two primary datasets:
- COCO-Stuff: A dataset of 164K real-world images with pixel-wise annotations, utilized to create the synthetic triplets (foreground, background, and mask).
- Pick-a-Pic: A large-scale dataset containing 584K pairs of synthetic images with human preference labels, ensuring the model aligns with high-quality visual aesthetics.
Key Results and Insights
The most crucial insight from CnC is the concept of "seeing behind objects." By using inpainting during training to create unseen background data, the model learns that the background continues to exist even when occluded. This is fundamental for true 3D-aware synthesis.
Quantitatively, CnC outperformed baselines like ControlNet, Uni-ControlNet, and T2I-Adapter across multiple metrics. On the COCO-Stuff validation set, it achieved significantly better Fréchet Inception Distance (FID) and CLIP Scores when combining depth and semantic conditions.
Qualitatively, CnC demonstrated superior depth reconstruction. While baseline models often produced "flat" images where objects appeared to reside on the same 2D plane, CnC faithfully recreated the relative depth of objects. Furthermore, the authors proved the effectiveness of the Soft Guidance barrier by successfully isolating concepts; for instance, they could intensify a background style without altering the foreground object.
Limitations and Future Directions
While highly effective, the current framework is primarily designed for a binary foreground/background split, whereas real-world scenes often feature multiple layers (foreground, midground, background). Additionally, generating the synthetic training data relies heavily on the quality of the inpainting model used during preprocessing. Future work aims to extend this approach to decompose images into more granular primitives and explore complex 3D spatial relationships beyond simple occlusion.
Summary updated