Training-and-Prompt-Free General Painterly Harmonization via Zero-Shot Disentenglement on Style and Content References

Teng-Fang Hsiao, Bo-Kai Ruan, Hong-Han Shuai
4/19/2024
cs.CVcs.AIcs.MM

Official code: BlueDyee/TF-GPH (62 stars, MIT, last commit 2024-12-17).

Abstract

Painterly image harmonization aims at seamlessly blending disparate visual elements within a single image. However, previous approaches often struggle due to limitations in training data or reliance on additional prompts, leading to inharmonious and content-disrupted output. To surmount these hurdles, we design a Training-and-prompt-Free General Painterly Harmonization method (TF-GPH). TF-GPH incorporates a novel ``Similarity Disentangle Mask'', which disentangles the foreground content and background image by redirecting their attention to corresponding reference images, enhancing the attention mechanism for multi-image inputs. Additionally, we propose a ``Similarity Reweighting'' mechanism to balance harmonization between stylization and content preservation. This mechanism minimizes content disruption by prioritizing the content-similar features within the given background style reference. Finally, we address the deficiencies in existing benchmarks by proposing novel range-based evaluation metrics and a new benchmark to better reflect real-world applications. Extensive experiments demonstrate the efficacy of our method in all benchmarks. More detailed in https://github.com/BlueDyee/TF-GPH.

View on arXivView PDF

Code Implementations(1)

BlueDyee/TF-GPHOfficial100%
MIT

(AAAI'25) Training-and-pormpt Free General Painterly Image Harmonization Using image-wise attention sharing

626HTML, PythonMar 6, 20241 years agoMIT

Similar Papers

Cite this paper

@article{hsiao2024trainingandpromptfree,
  title  = {Training-and-Prompt-Free General Painterly Harmonization via Zero-Shot Disentenglement on Style and Content References},
  author = {Teng-Fang Hsiao and Bo-Kai Ruan and Hong-Han Shuai},
  year   = {2024},
  eprint = {2404.12900},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2404.12900v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2404.12900.svg)](https://codeofpaper.com/paper/2404.12900)

Discussion