TL;DR
Filling in missing pixels in an image (inpainting) usually forces an unpleasant choice: spend massive compute training a dedicated model from scratch, or painfully optimize a frozen generative model from scratch for every single image at test time. Amortized Inpainting with Diffusion (AID) finds the sweet spot by freezing a pretrained diffusion backbone and training a tiny, reusable "steering wheel" offline—adding less than 1% parameter overhead. Backed by continuous-time reinforcement learning theory, AID delivers better image quality than heavy test-time baselines while running 10x to 15x faster.
What Problem Does This Paper Address?
Diffusion models have a remarkable grasp of how the visual world works. Naturally, we want to use them for conditional tasks like image inpainting—reconstructing missing or masked-out parts of a photo so they blend seamlessly with the visible pixels.
Right now, the field is split between two extremes:
- Heavyweight Amortization: Train a brand-new, massive inpainting model (or a bulky adapter like ControlNet/BrushNet) offline. Inference is fast, you pay once upfront, and reuse it forever—but the training cost and parameter bloat are enormous.
- Test-Time Optimization: Keep a pretrained diffusion model frozen and steer its generation on the fly for each new masked image (like RePaint or Diffusion Posterior Sampling). You save on training, but deployment becomes agonizingly slow because every single photo is treated as a brand-new math puzzle requiring hundreds of iterative steps.
The authors ask: Can we get the fast, reusable inference of the first camp with the lightweight, frozen-backbone elegance of the second?
Methods
Think of a pretrained diffusion model’s reverse process (turning noise into an image via a probability-flow ODE) as a river flowing toward realistic images. Left alone, it generates a great image, just not one that matches your specific visible pixels. AID adds a lightweight control term—a guidance field—that gently nudges the trajectory so the final image matches both the visible border and plausible missing content, while penalizing excessive steering so it doesn't fight the pretrained model unnecessarily.
Here is the catch: at deployment, you want this steering to be deterministic (clean, direct ODE solving). However, you cannot directly train a deterministic controller in high dimensions using reinforcement learning because policy-gradient algorithms need random exploration to figure out which direction improves the outcome (without noise, the policy gradient mathematically vanishes).
To bridge this gap, the authors introduce a clever theoretical sleight-of-hand:
- Auxiliary Gaussian Formulation: During offline training, they wrap the deterministic guidance law inside a randomized Gaussian policy with a carefully fixed variance and a centered value shift ($-\lambda T$), without adding standard entropy bonuses that would warp the target.
- Continuous-Time Actor–Critic: Using martingale orthogonality conditions from continuous-time RL, they train two small networks: a Critic (estimating future reconstruction loss) and an Actor (predicting the mean steering direction), discretized via Heun's method.
- Zero-Noise Deployment: Once trained, they throw away the Gaussian noise and Critic, deploying only the Actor's deterministic mean alongside the frozen diffusion backbone.
Datasets
No new datasets are introduced; the authors evaluate AID on standard, high-visibility benchmarks paired with official EDM and EDM2 diffusion backbones:
- AFHQv2 ($64 \times 64$ animal faces) and FFHQ ($64 \times 64$ human faces) for pixel-space diffusion (EDM).
- ImageNet ($512 \times 512$ diverse natural images) for latent-space diffusion (EDM2, where diffusion happens in compressed VAE space).
Models are trained and tested on free-form masks, and tested zero-shot (without retraining) on center and strip masks.
Key Insights and Ideas
- An Exact Optimizer-Preserving Bridge: Usually, injecting noise during training means your learned policy is slightly biased when you turn the noise off at test time. The authors prove both sufficiency and necessity (Theorems 3.2 & 3.3): the mean of any optimal randomized Gaussian policy in their auxiliary setup is mathematically identical to the true optimal deterministic guidance field.
- Tiny Overhead Goes a Long Way: Because the frozen diffusion model already knows how to draw, the guidance module only needs to know when and where to nudge. It requires just 409K parameters on EDM (0.66% of the backbone) and 411K on EDM2 (0.33%)—less than half the size of LatentPaint's learned module.
- Zero-Shot Sampler & Mask Transfer: Because the problem is formulated in continuous time rather than tied to specific discrete steps, a guidance module trained on an 18-step grid (
AID-18) can be dropped directly into a faster 12-step solver (AID-12) or applied to unseen mask shapes without any retraining.
Key Results
Across all three datasets and metrics—PSNR (pixel accuracy), SSIM (structural similarity), and LPIPS (perceptual quality)—AID shifts the entire quality–speed Pareto frontier outward.
- Faster and Better than RePaint: Using its default 35 function evaluations (
AID-18), AID beats the gold-standard iterative baseline RePaint (which needs 350 evaluations) across the board in roughly 1/10th the wall-clock time (~1.9s vs. ~19.1s on ImageNet). On ImageNet free-form masks,AID-18hits 9.79 dB PSNR and 0.3108 LPIPS, compared to RePaint's 7.56 dB and 0.3272. - Crushing Same-Budget Baselines: At the exact same 35-NFE budget,
AID-18dramatically outperforms DPS, MCG, Replacement, and the amortized latent competitor LatentPaint (6.47 dB PSNR / 0.3989 LPIPS on ImageNet). - Ultra-Low Latency Mode: Dropping to 23 evaluations (
AID-12, ~1.0–1.2s per image) yields a 15x speedup over RePaint while still beating every non-RePaint baseline on all metrics, and even beating RePaint on PSNR and SSIM.
Limitations and Future Work
While the paper does not feature a dedicated "Limitations" section, its scope highlights clear boundaries and next steps:
- Supervised Offline Training Required: Unlike zero-shot test-time methods (like DPS or RePaint) that work out-of-the-box on any inverse problem, AID requires an offline training phase over clean reference images and masks before deployment.
- Task Specificity: AID is specifically formulated around binary masks and pixel/latent MSE supervision for inpainting, rather than general noisy linear/nonlinear inverse problems (e.g., deblurring, super-resolution) or human-preference alignment.
- Future Directions: The authors view AID as an early proof-of-concept that continuous-time RL can drive practical algorithm design in generative AI, pointing toward broader applications in controlled guidance and lightweight amortized adaptation of foundation models.
Summary updated