Beyond Single-Shot Conditioning: Test-Time Condition Refinement for Diffusion-Based Image Restoration

Aiping Zhang, Jiangang Wang, Shangquan Sun, Yuning Cui, Fan Li, Renjing Pei, Wenqi Ren, Xiaochun CaoNeurIPS 2026

TL;DR

When restoring degraded images with diffusion models, treating the blurry input as a static reference throughout the entire generation process leaves a lot of quality on the table. This paper introduces CATTO, a training-free, plug-and-play method that iteratively refines the input condition itself on the fly during inference. By gently tuning the guiding image in frequency space without touching the model weights, it recovers sharp, realistic details without hallucinating away the original structure.

What Problem Does This Paper Address?

Diffusion models are fantastic at image restoration—turning blurry, noisy, or low-light photos into crisp images—because they have a strong built-in intuition (prior) of what natural images look like. However, there is a fundamental tension known as the fidelity-perception trade-off: push too hard for crisp details, and the model hallucinates features that weren't there; stay too faithful to the input, and you get muddy textures or weird artifacts.

Traditionally, diffusion restoration uses "single-shot conditioning": you feed the degraded image in once as a fixed guidepost, and it stays static across all denoising steps. If that degraded input has ambiguous, distorted local structures, its flawed guidance persists from start to finish.

Recently, researchers have tried spending extra compute at inference time ("test-time optimization") to nudge the generation toward higher quality. Usually, they do this by steering the random noise variables or the denoising trajectory itself. While that works great for open-ended text-to-image generation, in restoration it often derails structural fidelity—giving you a sharp, pretty bird that no longer looks like your bird.

Figure 1: Motivation of condition-aware test-time optimization. Left: Comparison of different optimization targets during inference in diffusion-based IR. Right: Visual comparison. The top row visualizes the input image condition and our refined conditions at t = 5, t = 25, and t = 45. Ours better preserves input-consistent eye and feather structures.

Methods

Instead of perturbing chaotic latent noise states, the authors shift the optimization target to the visual conditioning signal ($c_{\text{im}}$), proposing Condition-Aware Test-Time Optimization (CATTO). Because the frozen diffusion model Remains untouched, CATTO acts as a plug-and-play wrapper.

Figure 2: Overview of CATTO. (a) Optimized Inference Process: We treat the visual condition as an optimizable variable ˜cim. During sampling, ˜cim is iteratively refined to improve reward and consistency and the pre-trained denoiser fθ is frozen. (b) Refinement Objective: The objective bal- ances three terms: perceptual reward maximization (Lreward) on the estimated clean image, trajectory consistency (Ltraj) to adhere to the generative prior, and fidelity to the input condition (Lcond) to the original input. (c) Gradient-Free Optimizer: To handle non-differentiable rewards, we use antithetic perturbations for gradient-free condition search. We use a two-stage scoring to filter candidates and aggregate the Top-K feasible samples to estimate the update direction. (d) DCT Band-Gain Parameterization: DCT band-gain caching with subspace-constrained optimization in a compact frequency space.

Here is how they pull this off without blowing up memory or runtime:

  • A Three-Part Objective: At a given step, CATTO balances three goals: maximizing a black-box perceptual quality score (like CLIPIQA) on the estimated clean image, maintaining trajectory consistency (making sure the model's step-by-step predictions don't stray wildly from its pre-trained instincts), and enforcing condition fidelity (anchoring the refined guide to the original degraded input).
  • Gradient-Free Search: Backpropagating through a massive diffusion trajectory and an external quality-scoring network is a memory nightmare. Instead, CATTO uses an antithetic Evolution Strategy (ES). It generates pairs of tiny symmetric perturbations around the current condition, scores them, and updates the condition in the direction of the best performers. It uses a clever two-stage filter: early denoising steps prioritize structural consistency, while later steps prioritize perceptual sharpness.
  • Compact Frequency Search & Caching: Optimizing raw RGB pixels directly is high-dimensional and noisy. Instead, CATTO converts the input image into Discrete Cosine Transform (DCT) space and only optimizes a tiny vector of frequency band-gains. Furthermore, it only runs this search on scheduled "key steps." On "reuse steps" in between, it skips evaluation and coasts forward using cached momentum.

Datasets

Because CATTO is completely training-free, no training datasets are used. For evaluation, the authors test across four distinct restoration tasks using established benchmarks (no new datasets are introduced):

  • Real-World Super-Resolution: Pre-cropped $128 \times 128$ low-resolution pairs from DRealSR and RealSR.
  • Face Restoration: First 100 images of CelebA-Test.
  • Low-Light Enhancement: LOL dataset.
  • Image Inpainting: First 1,000 images of Places365.

Key Insights and Ideas

  • The Condition is a Better Steering Wheel: Raw noise variables live in an unstructured, high-dimensional space where nudging toward a perceptual reward easily causes "reward hacking" (unnatural artifacts). Optimizing the visual condition uses the network's dedicated conditioning pathways, acting as a structured, spatial-aware interface.
  • Coarse-to-Fine Filtering Mirrors Diffusion Dynamics: Diffusion naturally resolves global layout early and fine textures late. Flipping the two-stage candidate filter halfway through—filtering by consistency first in early steps, then filtering by perceptual reward in late steps—aligns the optimization directly with how the denoiser already "thinks."
  • Frequency Space + Momentum Tames Compute: Restricting updates to global DCT frequency bands prevents pixel-level noise artifacts and makes momentum caching work seamlessly, since consecutive denoising steps share the same low-dimensional coordinate space.

Key Results

Across five diverse backbones—including discrete DDPM/DDIM models (LDM, SeeSR, DiffBIR) and continuous rectified-flow models (FlowIE, FLUX-IR)—CATTO consistently improves both perceptual quality and structural fidelity under a matched compute budget (~200 network function evaluations).

  • Super-Resolution (DRealSR): On SeeSR, CATTO boosts perceptual CLIPIQA from 0.6903 to 0.7258 and MUSIQ from 65.08 to 66.09, while simultaneously improving reference fidelity (PSNR rises from 28.07 to 28.21 dB). Competing trajectory-steering methods typically sacrifice PSNR to gain perceptual scores, or vice versa.
  • Broader Tasks: On FlowIE face restoration, PSNR jumps from 25.63 to 26.19 dB alongside a CLIPIQA boost from 0.6716 to 0.7102. On FLUX-IR low-light enhancement, PSNR climbs from 21.97 to 22.60 dB.
  • Efficiency: On SeeSR, CATTO takes 12.73s per image and 7.33 GB of VRAM—slower than standard single-pass inference (4.13s, 6.86 GB), but noticeably faster than competing search methods like DSearch (17.26s) and FK-steering (16.72s).
Visual comparison on DiffBIR super-resolution showing CATTO recovering clean text without hallucinated artifacts.

Limitations and Future Work

  • Inference-Time Overhead: Like all test-time scaling methods, CATTO trades compute for quality—increasing sampling time roughly $3\times$ over vanilla inference (from ~4.1s to ~12.7s on SeeSR).
  • Reward Alignment Bottleneck: The framework is only as good as its black-box quality scorer. Ablations show that optimizing for one metric (e.g., NIQE) can slightly dip others, meaning no single off-the-shelf IQA metric perfectly captures human perception.
  • Future Directions: The authors suggest developing more advanced task-adaptive rewards and exploring latent-space reward proxies—which would bypass decoding latents into pixels at every key step, cutting down runtime even further.

Summary updated

Abstract

Conditional diffusion models have emerged as a powerful paradigm for image restoration, leveraging pre-trained generative priors to recover high-fidelity details from degraded inputs. However, existing methods typically follow a static inference protocol, treating the degraded observation as a fixed control signal throughout sampling. This overlooks the potential of inference-time scaling, where guidance can be refined on the fly to improve output quality. Recent test-time optimization approaches that manipulate noise variables or denoising trajectories often compromise structural fidelity, while those targeting text embeddings lack the spatial precision needed for restoration. To address this, we propose Condition-Aware Test-Time Optimization (CATTO), a training-free method that iteratively refines the visual conditioning signal at inference time. CATTO performs reward-aligned condition refinement under the pre-trained prior to enhance perceptual quality. To avoid complex backpropagation, we design a gradient-free optimization strategy guided by a joint objective: maximizing a perceptual reward while enforcing trajectory- and condition-level consistency to explicitly preserve structural fidelity. This process is accelerated by optimizing within a low-dimensional frequency subspace and reusing reliable updates across nearby denoising steps. Experiments on image restoration benchmarks show that CATTO improves perceptual quality over strong diffusion-based baselines without updating model parameters.
BibTeX
@inproceedings{zhang2026beyond,
  author = {Aiping Zhang and Jiangang Wang and Shangquan Sun and Yuning Cui and Fan Li and Renjing Pei and Wenqi Ren and Xiaochun Cao},
  title = {{Beyond Single-Shot Conditioning: Test-Time Condition Refinement for Diffusion-Based Image Restoration}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=IcHUb8TD0J},
}
Figure