Papers › DiffHarmony: Latent Diffusion Model Meets Image Harmonization

DiffHarmony: Latent Diffusion Model Meets Image Harmonization

9 Apr 2024arXiv:2404.06139archive 2025-07-28

Pengfei Zhou, Fangxiang Feng, Xiaojie Wang

Image harmonization, which involves adjusting the foreground of a composite image to attain a unified visual consistency with the background, can be conceptualized as an image-to-image translation task. Diffusion models have recently promoted the rapid development of image-to-image translation tasks . However, training diffusion models from scratch is computationally intensive. Fine-tuning pre-trained latent diffusion models entails dealing with the reconstruction error induced by the image compression autoencoder, making it unsuitable for image generation tasks that involve pixel-level evaluation metrics. To deal with these issues, in this paper, we first adapt a pre-trained latent diffusion model to the image harmonization task to generate the harmonious but potentially blurry initial images. Then we implement two strategies: utilizing higher-resolution images during inference and incorporating an additional refinement stage, to further enhance the clarity of the initially harmonized images. Extensive experiments on iHarmony4 datasets demonstrate the superiority of our proposed method. The code and model will be made publicly available at https://github.com/nicecv/DiffHarmony .

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2404.06139")

Code

Syntology Ran 7 of 10 code samples harvested from 1 repository linked to this paper; 3 have no recorded run. Of those that ran: 7 ran with no contract checked.

By repository: official repository: 10 samples from 1 repository, 7 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

nicecv/diffharmony officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

10 samples harvested; 7 ran; 0 honoured the contract we drafted; 3 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

7ran
3unverified

Licence: 10 of the 10 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from nicecv/diffharmony. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

extract_ds_name nicecv/diffharmony/src/dataset/ihd_dataset.py official repository ran fingerprinted no licence file found · pointer only · 63180d57531be192 · report
get_paths nicecv/diffharmony/src/utils.py official repository ran no licence file found · pointer only · f2e5b96191ed112e · report
get_paths nicecv/diffharmony/src/dataset/ihd_dataset.py official repository ran no licence file found · pointer only · e00c6f7b7efc9499 · report
harm_to_names nicecv/diffharmony/src/utils.py official repository ran no licence file found · pointer only · dba6fe6b30a3db16 · report
prepare_mask_and_masked_image nicecv/diffharmony/src/pipelines/pipeline_stable_diffusion_harmony.py official repository ran fingerprinted no licence file found · pointer only · cac844d58d7cd2d7 · report
read_jsonl_file nicecv/diffharmony/src/dataset/ihd_dataset.py official repository ran no licence file found · pointer only · 9178a3aaaf1a46b7 · report
tensor_to_pil nicecv/diffharmony/src/utils.py official repository ran no licence file found · pointer only · 4aa2c69430a0613f · report
get_down_block nicecv/diffharmony/src/models/unet_2d_blocks.py official repository unverified no licence file found · pointer only · acf6f9a764cebc1a · report
get_up_block nicecv/diffharmony/src/models/unet_2d_blocks.py official repository unverified no licence file found · pointer only · bfc9bbd91d301bce · report
zero_module nicecv/diffharmony/src/models/vae.py official repository unverified no licence file found · pointer only · d81381b327c76edd · report

Tasks

Image CompressionImage GenerationImage HarmonizationImage-to-Image TranslationTranslationmodel

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

DiffusionLatent Diffusion Model

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections