Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

RePaint: Inpainting using Denoising Diffusion Probabilistic Models

RePaint fills masked image regions using an unconditionally trained diffusion model

  • Problem Inpainting models trained on one mask distribution generalize poorly to mask shapes they never saw, especially extreme masks. Training them also tends to produce textures rather than meaningful content.
  • Method RePaint keeps a pretrained unconditional DDPM fixed and changes only the reverse steps, filling known pixels from the ground truth. It repeats steps by diffusing the output back to a noisier state and denoising again.
  • Results RePaint reaches LPIPS 0.029 on CelebA-HQ Super-Resolve 2× masks, versus 0.177 for LaMa.

Why mask-specific training limits inpainting

Free-form inpainting asks a model to fill regions of arbitrary shape, from thin brushes to masks that hide most of the image. The filled content has to blend with the surrounding pixels and also make semantic sense.

The strongest recent approaches rely on GANs or autoregressive models, and they are typically trained against a particular family of masks. A model tuned to one mask distribution can generalize poorly to mask types it did not see during training. The question this work asks is whether a DDPM trained only for unconditional image synthesis can be steered at inference time, so that no mask-specific training is needed.

Conditioning a fixed DDPM through the reverse steps

A DDPM is trained to reverse a fixed Gaussian noising process, and sampling starts from noise and applies the learned reverse step over many iterations. RePaint keeps this network as it is and changes only how each reverse step is assembled from two sources. The unknown pixels come from the DDPM's reverse step, while the known pixels come from the forward process applied to the ground truth image at the current time.

The forward process gives a closed form for the noisy version of the ground truth at any time step, which is what makes the known pixels available at every step of the reverse trajectory.

The text defines m⊙x as the unknown pixels and (1−m)⊙x as the known ones, but the combination equation multiplies the known-region sample by m. The two conventions for the mask therefore disagree in the paper, and the combination equation is the one used here as written. The known-region sample is built from the ground truth pixels, while the DDPM output fills the complementary part of the image.

Because the composition is done after every reverse step, the sampled known pixels always follow the schedule of the current time step.

Resampling to harmonize the fill

With one pass of the conditioning, the fill tends to match the texture of the neighbouring pixels while getting the content wrong. In one example, a masked region of a dog is filled with fur that matches the hair texture but is semantically incorrect.

The known-region sample is drawn without looking at what the DDPM has generated in the unknown part, so the two sources disagree at every step. The maximum change per reverse step also shrinks with the variance schedule, so a disagreement made early cannot easily be corrected later.

Resampling uses the DDPM's tendency to produce consistent structures. After a reverse step, the output is pushed back to a noisier state with the forward step \[ x_t \sim \mathcal{N}(\sqrt{1-\beta_t}\,x_{t-1},\ \beta_t I) \] and then denoised again, so the generated region can be re-harmonized with the known region. Repeating this forward and backward move only harmonizes over one step, so the jump length j generalizes it to a time horizon of j diffusion steps.

The procedure runs r resampling iterations per step, and in Algorithm 1 the forward move at each iteration uses β_{t-1}.

The final approach uses T = 250 timesteps, r = 10 resamplings and jump length j = 10. The ImageNet model is the provided guided diffusion model, and the CelebA-HQ model was trained for 250,000 iterations with the same hyper-parameters as for ImageNet. Resampling is a different use of extra computation from slowing down the diffusion, which reduces the added variance per step and uses more steps.

The authors argue that slowing down does not harmonize the image, which is why the comparison in the ablation is needed.

Comparison with state-of-the-art on standard and thin masks

The comparison uses 100 images of size 256 × 256 from the CelebA-HQ and ImageNet test sets. The baselines are the autoregressive DSI and ICT and the GAN-based DeepFillv2, AOT and LaMa, with publicly available pretrained models, except that LaMa was trained by the authors on ImageNet for 300,000 iterations with batch size five.

Quality is measured by LPIPS, where lower is better, and by a user study in which five humans answer each query and each comparison gathers 1000 votes. Each user had to be at least 75% self-consistent to have answers kept.

For Wide and Narrow masks the authors report that RePaint is preferred over every other method at a 95% significance margin on both datasets, although the Wide and Narrow LPIPS values alone do not show this. On CelebA-HQ with Wide masks, LaMa has LPIPS 0.045 against 0.059 for RePaint, and LaMa's vote share is 41.8 ± 3.1 percent in the same table.

On ImageNet, LaMa also has the lower Wide LPIPS, at 0.105 against 0.134.

For Super-Resolve 2× masks on CelebA-HQ, RePaint reaches LPIPS 0.029, compared with 0.128 for DSI and 0.177 for LaMa. The authors describe AOT as failing completely on these thin masks, while the other baselines produce blurry images or visible artifacts. In the user study the authors report that RePaint gets between 73.1% and 99.3% of the votes on the thin-structure masks.

For the thick masks, LaMa has lower LPIPS than RePaint on CelebA-HQ, at 0.138 against 0.165 for Half and 0.342 against 0.435 for Expand. The authors argue that RePaint is more flexible and produces semantically different fills from the ground truth, so LPIPS is unsuitable for this case. The ImageNet numbers show the same pattern, with LaMa at 0.254 against 0.304 for Half and 0.534 against 0.629 for Expand.

The authors note that RePaint is preferred with 95% confidence in the user study, except for the inconclusive comparison with ICT on Half masks.

On Places2 in the appendix, the comparison with LaMa on Wide masks is inconclusive, with users voting 52.4% for RePaint and a significance interval overlapping the 50% border.

Diversity of sampled completions

Each reverse step adds fresh Gaussian noise, so every run produces a different sample. Since no loss directly fixes the inpainted region, the model can fill it with any content that fits the training distribution.

The Diversity Score is used because it rewards diversity among plausible outputs and penalizes extreme predictions or failures, unlike a mean pairwise LPIPS. Higher values are better, and the authors report it alongside LPIPS on CelebA-HQ with 32 images per mask setting.

On Narrow masks RePaint has a Diversity Score of 23.79 with LPIPS 0.0337, compared with 18.74 and LPIPS 0.0454 for DSI and 18.65 with LPIPS 0.0402 for ICT. On Expand, ICT is ahead of RePaint on both measures, with LPIPS 0.4779 against 0.4832 and Diversity Score 17.25 against 17.11. The authors report that no single method has both the best LPIPS and the best Diversity Score on Wide and Half masks.

Resampling versus slowing down at equal budget

Slowing down the diffusion is the usual way to spend extra computation, so the comparison is made with a similar number of network evaluations. The experiment uses 32 ImageNet validation images with the LaMa Wide mask.

Slowing down with T = 250, 500, 750 and 1000 and r = 1 gives LPIPS 0.168, 0.167, 0.179 and 0.161, so more diffusion steps do not reliably improve the result. Resampling with T = 250 and r = 1, 2, 3 and 4 gives LPIPS 0.168, 0.148, 0.142 and 0.134.

The authors conclude that the resampling uses the extra budget to harmonize the image, while slowing down shows no visible gain. Only one scene and one mask were measured in this table, so the comparison supports this reading for that setting alone.

Jump length and number of resamplings

The ablation varies j over 1, 5 and 10 and r over 5, 10 and 15, using 32 images from the CelebA validation set with the LaMa Wide mask setting. Votes are measured against LaMa, and LPIPS is reported alongside them.

With j = 10, the vote shares are 53.12, 56.25 and 53.75 for r = 5, 10 and 15, and the corresponding LPIPS values are 0.073, 0.068 and 0.065. With j = 1 the vote shares are 42.50, 42.50 and 46.25, and the authors observe blurrier images for j = 1 across the numbers of resamplings.

The vote intervals are about ±7.8 points, so the gaps between j = 5 and j = 10, or between r = 5 and r = 10, fall within those intervals. The visual examples for the jump-length and resampling grid are in the appendix.

Comparison with the SDEdit resampling schedule

SDEdit starts reverse diffusion from a guiding image at an intermediate time, so it cannot start from only the non-masked pixels. For the comparison, the authors run reverse diffusion from T to T/2 and then repeat the reverse process from T/2 to 0.

On the super-resolution masks, SDEdit gives LPIPS 0.3902 on ImageNet, 0.2712 on Places2 and 0.1132 on CelebA-HQ, while RePaint gives 0.1831, 0.0991 and 0.0291. The authors report that RePaint reduces LPIPS by over 53% on all datasets for super-resolution masks.

The exception is the Expand mask on ImageNet, where SDEdit has LPIPS 0.6281 and RePaint 0.6292. The authors consider LPIPS above 0.6 outside a meaningful range for comparison.

Limitations

The 512 × 512 experiment is qualitative only, because the full analysis could not be run at that resolution. The model also tends to inpaint dogs more often than expected on ImageNet, which the authors attribute to dogs being over-represented in the training set.

Paper info

Authors
Andreas Lugmayr, Martin Danelljan, Andres Romero, Fisher Yu, Radu Timofte, Luc Van Gool
Venue
arXiv · Preprint
First published
2022-1-24
Added
2026-11-12
Updated
2022-8-31
Version
v4
arXiv
2201.09865
Category
cs.CV
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Andreas Lugmayr, Martin Danelljan, Andres Romero, Fisher Yu, Radu Timofte, Luc Van Gool (2022). RePaint: Inpainting using Denoising Diffusion Probabilistic Models. arXiv:2201.09865v4. https://arxiv.org/abs/2201.09865v4

BibTeX
@misc{lugmayr2022repaint,
  title = {{RePaint: Inpainting using Denoising Diffusion Probabilistic Models}},
  author = {Andreas Lugmayr and Martin Danelljan and Andres Romero and Fisher Yu and Radu Timofte and Luc Van Gool},
  year = {2022},
  eprint = {2201.09865},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2201.09865v4}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up