Papers › Structure Matters: Tackling the Semantic Discrepancy in Diffusion Models for Image Inpainting

Structure Matters: Tackling the Semantic Discrepancy in Diffusion Models for Image Inpainting

29 Mar 2024CVPR 2024 1arXiv:2403.19898archive 2025-07-28

Haipeng Liu, Yang Wang, Biao Qian, Meng Wang, Yong Rui

Denoising diffusion probabilistic models for image inpainting aim to add the noise to the texture of image during the forward process and recover masked regions with unmasked ones of the texture via the reverse denoising process.Despite the meaningful semantics generation,the existing arts suffer from the semantic discrepancy between masked and unmasked regions, since the semantically dense unmasked texture fails to be completely degraded while the masked regions turn to the pure noise in diffusion process,leading to the large discrepancy between them. In this paper,we aim to answer how unmasked semantics guide texture denoising process;together with how to tackle the semantic discrepancy,to facilitate the consistent and meaningful semantics generation. To this end,we propose a novel structure-guided diffusion model named StrDiffusion,to reformulate the conventional texture denoising process under structure guidance to derive a simplified denoising objective for image inpainting,while revealing:1)the semantically sparse structure is beneficial to tackle semantic discrepancy in early stage, while dense texture generates reasonable semantics in late stage;2)the semantics from unmasked regions essentially offer the time-dependent structure guidance for the texture denoising process,benefiting from the time-dependent sparsity of the structure semantics.For the denoising process,a structure-guided neural network is trained to estimate the simplified denoising objective by exploiting the consistency of the denoised structure between masked and unmasked regions.Besides,we devise an adaptive resampling strategy as a formal criterion as whether structure is competent to guide the texture denoising process,while regulate their semantic correlations.Extensive experiments validate the merits of StrDiffusion over the state-of-the-arts.Our code is available at https://github.com/htyjers/StrDiffusion.

PaperPDFConference PDFCodeCode 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="2403.19898")

Code

Syntology Ran 3 of 13 code samples harvested from 1 repository linked to this paper; 10 have no recorded run. Of those that ran: 2 ran · our draft was wrong; 1 ran with no contract checked.

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

htyjers/strdiffusion officialmentioned in papermentioned on GitHubpytorchApache-2.0 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

13 samples harvested; 3 ran; 0 honoured the contract we drafted; 10 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.

2ran · our draft was wrong
1ran
10unverified

Licence: 0 of the 13 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 htyjers/StrDiffusion. “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.

dict2str htyjers/StrDiffusion/train/discriminator/config/inpainting/options.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 40c52ad98161c17b · report
dict_to_nonedict htyjers/StrDiffusion/train/discriminator/config/inpainting/options.py official repository ran · our draft was wrong Apache-2.0 (permissive) · ada7273eee7081c7 · report
variance_scaling htyjers/StrDiffusion/train/discriminator/config/inpainting/models/layers.py official repository ran Apache-2.0 (permissive) · 3ac11bfe0ae80195 · report
dense htyjers/StrDiffusion/train/discriminator/config/inpainting/models/dense_layer.py official repository unverified Apache-2.0 (permissive) · 9f13fd20494eac47 · report
get_act htyjers/StrDiffusion/train/discriminator/config/inpainting/models/layers.py official repository unverified Apache-2.0 (permissive) · db5f935a1d6b4c2c · report
get_weight htyjers/StrDiffusion/train/discriminator/config/inpainting/models/up_or_down_sampling.py official repository unverified Apache-2.0 (permissive) · 8db300b9f1afb2d3 · report
gray_to_edge htyjers/StrDiffusion/train/discriminator/config/inpainting/models/canny.py official repository unverified Apache-2.0 (permissive) · f364b5647cd1f451 · report
kaiming_uniform_ htyjers/StrDiffusion/train/discriminator/config/inpainting/models/dense_layer.py official repository unverified Apache-2.0 (permissive) · b42da332ce0ead42 · report
naive_downsample_2d htyjers/StrDiffusion/train/discriminator/config/inpainting/models/up_or_down_sampling.py official repository unverified Apache-2.0 (permissive) · e0ca74cc0ccd0e50 · report
naive_upsample_2d htyjers/StrDiffusion/train/discriminator/config/inpainting/models/up_or_down_sampling.py official repository unverified Apache-2.0 (permissive) · f425357463a3de36 · report
ncsn_conv1x1 htyjers/StrDiffusion/train/discriminator/config/inpainting/models/layers.py official repository unverified Apache-2.0 (permissive) · 85b2235eb7afaa4f · report
parse htyjers/StrDiffusion/train/discriminator/config/inpainting/options.py official repository unverified Apache-2.0 (permissive) · 2178a45bccb10af5 · report
variance_scaling_init_ htyjers/StrDiffusion/train/discriminator/config/inpainting/models/dense_layer.py official repository unverified Apache-2.0 (permissive) · 49cf191f770c146a · report

Tasks

DenoisingImage Inpainting

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

DiffusionInpainting

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