🤖 AI Summary
This work addresses the challenge in cross-domain image synthesis of simultaneously preserving foreground identity and adapting to background style, a trade-off exacerbated by the scarcity of large-scale paired data, which limits existing methods to coarse-grained color alignment and often results in style distortion or over-transfer. To overcome this, we introduce ChameleonDataset, the first large-scale cross-domain synthetic dataset, and propose a two-stage training framework. In the first stage, joint hard contrastive learning disentangles style and content representations; in the second, a spatiotemporal attention gating mechanism is integrated into a diffusion Transformer to enable fine-grained, adaptive style injection. Experiments demonstrate that our approach significantly outperforms state-of-the-art in-domain and cross-domain models, sequential pipelines, and commercial systems in both synthesis plausibility and style fidelity.
📝 Abstract
Image compositing aims to seamlessly insert a foreground object into a background image, and recent advances in diffusion models have significantly enhanced the quality, especially when the foreground and background images come from the same domain (e.g., natural images). However, cross-domain compositing, where the foreground and background come from different domains, is relatively underexplored and remains challenging because the model must preserve the foreground object's identity while stylizing it to match the background domain. Existing cross-domain compositing approaches largely rely on training-free blending and refinement strategies. This is partly due to the lack of large-scale paired datasets for cross-domain compositing, limiting the development of training-based solutions. As a result, they are limited to tone-level alignment and often produce style-inconsistent or overstylized results. To overcome such limitations, we construct ChameleonDataset, the first large-scale training dataset for cross-domain compositing, with a comprehensive evaluation benchmark, built through a scalable data construction pipeline. Building on this, we propose Chameleon, a novel two-stage training-based cross-domain compositing framework. In the first stage, we propose Joint Hard Contrastive Learning (JHCL) to train ChameleonEncoder, which effectively disentangles style and content representations. In the second stage, we introduce Spatio-Temporal Attention Gating (STAG) into a diffusion transformer for effective stylization, adaptively regulating how style tokens from the first-stage encoder are injected across spatial and temporal dimensions. Our method outperforms state-of-the-art in-domain and cross-domain compositing models, sequential pipelines and commercial models, achieving improvements in both compositional plausibility and stylistic fidelity.