Abstract
Text-to-image generation models, while powerful, often require users to "re-roll" random seeds numerous times to achieve a perfect result. Generative Photomontage addresses this "dice roll" problem by providing a framework to composite the best elements from multiple generated images into a single, cohesive output. By performing segmentation and blending in the diffusion feature space—specifically leveraging self-attention features—the method produces seamless, high-fidelity results that preserve user-selected details while maintaining global harmony.
Introduction
Current state-of-the-art text-to-image models like Stable Diffusion are inherently stochastic. Achieving a specific vision often becomes a matter of luck; one seed might produce an excellent background but a flawed subject, while another might do the opposite. Even with structural guidance from tools like ControlNet, users frequently find themselves generating dozens of images to find one that is "mostly" correct.
Existing image blending techniques, such as Poisson blending or simple masking in pixel space, struggle with the subtle lighting and color shifts inherent in different diffusion seeds, often resulting in visible seams. Conversely, latent-space methods often fail to preserve the exact local details that motivated the user to select a specific region in the first place. Generative Photomontage bridges this gap by operating in the semantic feature space of the diffusion model.
Methodology
The Generative Photomontage pipeline treats generated images as intermediate building blocks. The process consists of four primary stages:
- Image Stack Generation: Using ControlNet with a fixed structural condition (e.g., a sketch or depth map) and varying random seeds, the system generates a spatially aligned "stack" of images.
- Feature-Space Graph Cut: Users provide sparse brush strokes to indicate desired regions from different images in the stack. The algorithm then performs a multi-label graph cut optimization. Crucially, this optimization uses the Key (K) features from the diffusion model's self-attention layers rather than raw pixel colors. These features capture high-level semantic information, making the segmentation robust to low-level variations.
- Self-Attention Feature Injection: To blend the regions, the system composites the Query (Q), Key (K), and Value (V) feature maps. A key innovation is the use of model-generated query features ($Q^{model}$) for the background region during the new denoising process. This allows the model to adapt the structure near seams, effectively "negotiating" a smooth transition between disparate sources.
- Final Denoising: These composite features are injected back into the U-Net during a final denoising pass, harmonizing the regions into a single, cohesive image.
Applications and Evaluation
The authors evaluated the framework using a benchmark of 20 test cases across four primary applications:
- Appearance Mixing: Combining different styles or components (e.g., different parts for a robot).
- Shape Correction: Fixing misaligned or hallucinated geometry by swapping in better-formed regions.
- Artifact Removal: Replacing glitched or unwanted regions with clean patches from other seeds.
- Prompt Alignment: Breaking complex prompts into simpler ones, generating them individually, and compositing the results.
Quantitatively, the method outperformed baselines like Interactive Digital Photomontage (IDP) and Blended Latent Diffusion (BLD), achieving a high PSNR of 22.46. Its Seam Gradient Score of 0.339 indicates that the edited boundaries are indistinguishable from natural, unedited images. Qualitative results show that the method avoids common pitfalls like color bleeding or structural "drifting."
Discussion and Conclusion
A major insight of this work is the "semantic advantage" of diffusion features. Because 'K' features represent high-level concepts, graph cuts naturally follow object boundaries rather than being misled by shadows or noise. Furthermore, the probabilistic success rate of image generation is significantly improved; instead of needing one perfect seed out of $N$, a user only needs each required sub-region to appear "good" at least once across the $N$ images.
While powerful, the method is currently limited by the quality of the initial image stack and requires spatial alignment via ControlNet. Future work may involve automating the region selection process using Large Language Models or object detectors to further reduce manual effort.
Summary updated