Editor’s introduction
Researchers evaluated a frozen SD1.5 text-to-image diffusion model modified with a stateful latent controller called Step-PI, which enables training-free conditional inpainting across three natural-image domains: AFHQ, CelebA-HQ, and Places2. The method uses a predefined release schedule and persistent latent state to guide image reconstruction, without adjusting model weights or introducing domain-specific conditioning channels. The controller was trained only on a disjoint CelebA-HQ dataset and transferred directly to the other domains. In controlled comparisons, Step-PI outperformed baseline methods like LanPaint and PILOT on all five macro metrics, with improvements consistently observed across all 15 dataset-specific metrics. The study shows that the user-provided text prompt significantly influences output alignment, as evidenced by higher Prompt-CLIP scores in the correct condition compared to empty prompts, with all domain effects showing statistically significant differences. The evidence supports the functional role of text conditioning in the pipeline, though the findings are limited to the specific domains and mask protocols tested in the Main35 dataset, and do not establish generalizability beyond those conditions.
Introduction
Modern diffusion inpainters achieve strong quality through inpainting-specific weights or specialized conditioning interfaces. Generic text-to-image models lack these inpainting-specific resources. Nevertheless, we show that a frozen generic text-to-image model can be repurposed for conditional inpainting through test-time latent control, without weight updates or learned inpainting-specific conditioning channels.
Each case supplies an observed image, a binary mask, and a user-provided text condition fixed before inference. Known-region projection anchors observed context on the latent grid, and final RGB compositing restores known pixels exactly; neither constrains the generated region. Its boundary requires local continuity, whereas its interior requires longer-range contextual and structural coherence, and the useful correction balance changes over the reverse trajectory. This motivates boundary–interior feedback, persistent state, and a predefined release schedule.
Trained Inpainting Methods
Trained inpainters acquire task capability through learned weights or conditioning interfaces. SD-Inpaint uses an inpainting-specific latent interface, BrushNet adds a decomposed dual-branch architecture, and PixelHacker targets structural and semantic consistency. Broader diffusion reward- and preference-based adaptation includes DDPO, DPOK, and PrefPaint. Inpainting-specific training is distinct from dataset-specific weight adaptation, and a model trained for inpainting need not be retrained for every evaluation domain. Because these systems contain learned inpainting capability absent from a generic text-to-image backbone, we use them as strong quality references rather than matched interventions.
Training-Free Inpainting Methods
“Training-free” methods keep deployed weights fixed, but differ in foundation, sampler, and conditioning interface. LanPaint combines Langevin dynamics with ODE-based diffusion, whereas PILOT optimizes the latent during DDIM sampling; both operate on vanilla SD1.5 without inpainting-trained weights and are our closest evaluated baselines using the same pretrained diffusion model, although their native routes differ. Other approaches modify initialization (InverFill ), attention/style (HarmonPaint ), resampling (RePaint ), auxiliary propagation (LatentPaint ), or pretrained inpainting interfaces (FreeCond ). GradPaint backpropagates masked MSE and, for pixel-space models, boundary losses; DING derives VJP-free Gaussian posterior transitions for zero-shot latent inpainting; and HiGS uses denoiser-prediction history for generic sampling enhancement. Broader test-time control spans posterior gradients, differentiable guidance, trajectory optimization, calibration, and reward-aware or stochastic-control formulations.
Boundary–Interior Feedback
Its terms encourage multiscale, depth-weighted contextual and structural coherence. Semantics come from the frozen text-conditioned transition; the controller regularizes spatial and contextual consistency rather than directly optimizing text alignment. Exact definitions, conventions, and shared weights are provided in Supplementary Appendix A.
Normalization removes raw-scale differences across objectives and reverse steps but does not make the directions timestep-invariant; fixed gains, release factors, norm caps, and the final clamp set action magnitude. It therefore provides fixed calibration, not raw-magnitude adaptivity.
Evaluation set and frozen inputs
Main35 comprises 3,500 paired cases from AFHQ v2 (1,300), CelebA-HQ (1,400), and the Places365 Standard validation split (800; denoted Places2), across 35 fixed 100-case mask protocols. Image, mask, prompt, and seed are held fixed within each comparison; unknown-region ground truth is evaluation-only. Prompts are fixed without output-based optimization; preprocessing and sampling details are provided in Supplementary Appendix B.
External baselines
LanPaint and PILOT are the evaluated same-foundation training-free references: all three use vanilla SD1.5 without inpainting-trained weights, learned inpainting interfaces, or dataset-specific weight adaptation. GradPaint does not report an SD1.5 checkpoint, DING uses SD3.5, and HiGS does not evaluate inpainting. Accordingly, we do not include these three methods in our quantitative external comparison. SD-Inpaint, BrushNet, and PixelHacker form the trained lane; PixelHacker is Places2-adapted. Native-interface comparisons are descriptive; Supplementary Appendix B audits attributes.
Metrics and statistics
Masked L1 measures held-out unknown-region RGB reconstruction, while composite-based Masked LPIPS applies LPIPS-Alex to the full-frame output after exact known-region compositing. Boundary L1 and Boundary LPIPS measure seam fidelity, and CLIP-Q is an auxiliary CLIP-IQA-style frozen two-prompt no-reference quality proxy; lower is better except for CLIP-Q. The controller neither sees unknown-region ground truth nor optimizes LPIPS or CLIP-Q; its context and seam objectives align most directly with L1 continuity. These proxies do not replace human evaluation, and reference scores may penalize plausible alternatives. We average within protocols and weight protocols and datasets equally. Case-within-protocol intervals are conditional on the fixed 35 protocols, not unseen mask families. Full definitions and statistics are provided in Supplementary Appendix B.
Mechanism robustness across inference seeds
Across five paired inference-seed sweeps over the same outcome-blind, balanced 175-case stratified random subset spanning all 35 protocols (875 pairs), PI outperforms P-Guidance on all five fixed evaluation metrics when persistent state is the only component changed. Across all five metrics, the hierarchical five-seed effects consistently favor PI, with every 95% CI excluding zero and every Holm-corrected test remaining significant; full estimates are provided in Supplementary Appendix C. On the same cohort, Step-PI outperforms PI on every metric in every sweep when the release schedule is the only component changed; pooled 95% CIs exclude zero for all five metrics. Full estimates, protocol details, and reproducibility scope are provided in Supplementary Appendices C and E.
Conclusion
Step-PI repurposes a frozen SD1.5 text-to-image diffusion model for training-free conditional inpainting across three evaluated domains through a stateful boundary–interior latent controller with a predefined release schedule, without weight updates or learned inpainting-specific conditioning channels. Developed on disjoint CelebA-HQ pilots, it transfers unchanged to AFHQ and Places2. Matched state-only and release-only controls improve all 15 Main35 dataset–metric cells. Descriptively, Step-PI leads LanPaint and PILOT on all five equal-dataset macro metrics and approaches selected inpainting-trained references on some metrics. Inpainting-trained systems retain the absolute metric leads but rely on substantial inpainting-specific offline optimization. Although Step-PI incurs substantial inference cost, these results position test-time latent control as a complementary route for repurposing a frozen generic text-to-image prior.
Boundary–Interior Feedback Objectives
Equation (18) is the executed support-masked image variation term: because TV is evaluated after zeroing pixels outside the inner ring, it includes both differences within the ring and differences across the ring-support edge. It should not be interpreted as a masked-adjacency TV that uses only pairs lying wholly inside the ring, nor does this implementation-level term isolate a seam-specific benefit. The RGB-gradient term compares two generated pixels just inside the mask with two observed pixels just outside it. Empty edge sets contribute zero.
Metric geometry and direction
CLIP-Q is our CLIP-IQA-style frozen two-prompt quality proxy. It uses openai/clip-vit-base-patch32 at revision 3d74acf9 on the unknown-mask bounding-box crop with 32-pixel padding and Gaussian-blur radius 0.2. We apply a two-way softmax to the logits for a high quality natural realistic photo and a low quality unnatural distorted image, and report the positive-prompt probability. Lower is better for the four error metrics and higher is better for this proxy. Together the five metrics cover reconstruction, local seam behavior, and a no-reference quality proxy; they do not establish human preference or fine-grained semantic compliance.
Pairing and statistical scope
The paired Main35 analyses contain matched observations for all 3,500 image–mask conditions. Appendix C states the exact field identities of the P-Guidance-to-PI and PI-to-Step-PI comparisons alongside their results. Here we define only their shared aggregation and conditional inferential scope.
Cases are averaged within protocol, protocols equally within dataset, and datasets equally across the three evaluated domains. Paired intervals use 10,000 case-within-protocol stratified-bootstrap draws with seed 20260719, resampling cases within protocol before averaging the fixed protocol and dataset means. Some AFHQ source images recur across mask protocols, whereas CelebA-HQ and Places2 use source-unique cases. The bootstrap conditions on this fixed cross-protocol reuse structure and does not additionally cluster by source identity across protocols. The separate MS175 cohort in Appendix C is source-unique within each dataset. Each Main35 case uses one fixed inference seed, varying across cases. The resulting intervals quantify case variation conditional on the three evaluated datasets, 35 fixed mask protocols, and fixed per-case seeds; they do not estimate uncertainty over unseen domains, unseen mask families, or new inference seeds. Appendix C therefore reports separate five-seed MS175 audits for both adjacent mechanism contrasts: P-Guidance-to-PI for persistent state and PI-to-Step-PI for the complete predefined release schedule. These repeated-initialization audits do not estimate training-seed uncertainty or generalization to unseen datasets, mask families, backbones, or samplers.
Configuration Development and Transfer Scope
All controller choices were finalized using a fixed five-case CelebA-HQ development pilot confirmed disjoint from Main35. Development used a mixture of visual assessment and numerical metrics. No Main35 formal-evaluation output from AFHQ, CelebA-HQ, or Places2 entered configuration selection. The single set of gains, objective weights, retention values, bounds, and release schedules reported in Appendix A was then held fixed for every formal run, with no dataset-specific retuning. This supports configuration-locked transfer without target-domain retuning; it does not establish hyperparameter optimality or insensitivity to the pilot set.
Trained comparison routes
The trained lane uses the official SD-Inpaint snapshot with 50 DDIM steps, CFG 7.5, and FP16. BrushNet uses official repository commit 0f9d9e54, its released random-mask checkpoint, the frozen SD1.5 base, 50 UniPC steps, CFG 7.5, conditioning scale 1.0, and FP16. PixelHacker uses official repository commit f5567db2, the ft_places2 checkpoint and supplied VAE, 20 DDIM steps, strength 0.999, noise offset 0.0357, CFG 4.5, FP32, and no text prompt. PixelHacker retains this fixed configuration on AFHQ and CelebA-HQ. Full environment pins will accompany the released code.
Because Step-PI, LanPaint, and PILOT retain different native inference routes and were not assigned a common tuning budget, their results provide descriptive complete-system positioning rather than tuning-matched or algorithm-intrinsic superiority. The 35-case resource audit remeasures the same frozen routes on 35 shared inputs and an A100 GPU only as descriptive full-route cost. Complete per-dataset quality positioning and its exceptions are reported in Appendix E.
Matched Main35 State and Joint-Release Effects
Metric definitions, direction normalization, native pairing, and the case-within-protocol stratified-bootstrap contract appear in Sec. B.2. In the field-identical P-Guidance-to-PI comparison, both methods share boundary and interior objectives, current-step gradients, gains, normalization, safeguards, action construction and placement, and uniform release; only PI carries discounted state across reverse steps. PI and Step-PI then share that complete persistent controller and differ only in the four fields of the predefined release schedule. The two comparisons therefore isolate persistent state and the complete predefined release schedule, respectively, over all 3,500 native Main35 pairs.
All five direction-normalized mean effects favor PI, and all five 95% stratified-bootstrap intervals exclude zero. The pooled per-case win rates range from 57.03% to 67.51%, showing broad but not case-universal improvement. Together, the mean effects, intervals, and paired win rates support a positive aggregate persistent-state effect across Main35.
Shared cohort and statistics
The 175-case protocol-stratified random subset (MS175) is an outcome-blind subset of Main35. Before any method output or evaluation metric was examined, five unique-source cases were randomly sampled within each of the 35 protocols, yielding 175 conditions (65 AFHQ, 70 CelebA-HQ, and 40 Places2). The resulting cohort was then fixed and reused across both studies. Each case uses its fixed seed plus four deterministically derived seeds. Both studies pair image, mask, prompt, seed, initial latent, known-region noise, sampler, objectives, gains, safeguards, action construction, and placement within every comparison; each contains 875 method pairs.
For each of the five metrics, the hierarchy averages seeds within case, cases within protocol, protocol means within dataset, and then datasets equally. It uses 10,000 case-cluster bootstrap draws, a nested seed-resampling sensitivity analysis, 100,000 case-cluster sign flips, and Holm correction across the five metrics. These studies vary inference initialization rather than training seeds.
Persistent-state study
P-Guidance and PI are field-identical except that PI carries discounted state across reverse steps. The evaluator pairs the retained P-Guidance and PI outputs under identical case and seed identities. All 875 pairs and all five metrics pass the completeness and pairing checks.
All five direction-normalized hierarchical effects favor PI, and all five 95% intervals exclude zero after the paired five-seed evaluation. Every metric is positive in each of the five seed-wise estimates; the table also reports win/tie/loss counts for both the five-seed case means and all 875 endpoints. This supports a consistent positive incremental effect of persistent state across the five stochastic initializations within the frozen MS175 and SD1.5 scope, rather than a claim about training seeds or untested backbones and samplers.
Joint-release study
The independent release study pairs PI and Step-PI while changing only the complete predefined release schedule. Its 875 pairs comprise 1,750 completed runs with no failures, retries, or outcome-based selection. It is a separate five-seed study on the fixed MS175 cohort rather than a repeated-seed expansion of Main35. Positive effects below favor Step-PI.
All 25 seed–metric equal-dataset point estimates favor Step-PI. All 15 dataset–metric point estimates also favor Step-PI, and 14 of their intervals exclude zero. The sole exception is Places2 CLIP-Q: its positive point estimate has an interval that crosses zero. The result therefore supports joint-release robustness across five stochastic initializations on the frozen MS175 cohort, not a Main35-wide or universal per-case guarantee.
Protocol
The seed-0 study reuses the same protocol-stratified random MS175 cohort and holds the complete evaluated Step-PI pipeline fixed while changing only positive-text presence. The paired 175-case analysis uses 350 endpoints—175 Correct and 175 Empty—with one matched pair per case. Image, mask, seed, initial latent, known-region noise, sampler, controller, and every non-text field are paired. Prompt mappings and the case set were fixed before inference. Appendix D presents a separate six-case strict-random qualitative display; the complete paired study here provides the quantitative evidence.
The aggregate weights protocols and datasets equally, and intervals use 10,000 paired stratified-bootstrap draws. Prompt-CLIP is the paired text–output alignment endpoint for this intervention and is distinct from the no-reference CLIP-Q metric used in the Main35 benchmark. Static inspection found no unknown-region ground truth in inference; the reproduction protocol and reproducibility scope are reported in Appendices B and E.
Strict-Random Prompt-Presence Examples
The display contains six MS175 cases drawn strictly at random before Correct or Empty outcomes were inspected, two per dataset. Within each paired row, every inference input and Step-PI setting is fixed; only the positive text condition changes. The Original column provides evaluation-only context unavailable during inference, while the Masked column follows the shared display convention without altering model inputs. The paired Prompt-CLIP analysis in Appendix C provides the three-domain quantitative evidence; this plate is its strict-random visual companion and does not test fine-grained counterfactual control or human preference.
Random Native-Route System Comparisons
Each plate contains six cases randomly drawn per dataset without conditioning on any method output, for 18 cases in total; one per dataset is reused in the main paper’s first-page teaser. Every row fixes the source image and mask, while methods retain their native inference routes. The held-out Original is shown as reference context and is not assumed to be the unique valid completion. These plates provide outcome-independent inspection of complete systems. Because their native interfaces and inference procedures differ, they are descriptive system-level comparisons rather than intervention-matched attribution, formal population-frequency estimates, or human-preference evidence.
Cross-Domain Stress-Test Diagnostics
The final plate presents a separate fixed six-case cross-domain diagnostic set spanning challenging mask–content configurations, with two cases per dataset. For every case, the complete active comparison lane is retained without method-specific inclusion or exclusion. The plate is organized to make diverse structural, semantic, and blending difficulties inspectable rather than to estimate their prevalence.
Inspection focuses on structural continuation under disconnected or thin masks, facial and semantic coherence under central occlusion, and seam and geometry consistency over long or repeated structures. These descriptions direct visual inspection of the fixed cases; they are observed case attributes, not experimentally isolated causes of any output.
Descriptive Native-Route Quality Positioning
The first three rows within each dataset form the vanilla-SD1.5 training-free lane; the remaining three rows are inpainting-trained references. The advantage is broad but not uniform across every dataset–metric cell: Step-PI records better point estimates than LanPaint in 13 of 15 cells; the exceptions are AFHQ Masked L1 and CelebA-HQ CLIP-Q. It records better point estimates than PILOT in 12 of 15 cells; the exceptions are CelebA-HQ Masked L1, Masked LPIPS, and CLIP-Q. Because methods retain different audited native routes and compute budgets, these results provide descriptive system-level positioning rather than an intervention-matched ranking.
Reproduction protocol
The reported experiments are reproducible as protocol-level reruns using the fixed inputs, configurations, seeds, and analysis procedures described in Appendix B. The persistent-state and joint-release five-seed studies are separate paired inference-initialization studies on the fixed MS175 cohort; neither is a repeated-seed expansion of Main35. Static checks verify paired image, mask, seed, latent, and noise identities, ground-truth isolation during inference, exact known-region preservation, and resume logic. Upon publication, the implementation, experiment configurations, case lists, evaluation scripts, and table/figure generation code will be released.
Numerical execution boundary
Independent CUDA executions can differ at the level of floating-point arithmetic and are therefore not expected to produce byte-identical image files. Reproduction here means rerunning the specified protocol and recovering the reported statistical conclusions, not requiring bitwise identity across independent GPU processes. Reported intervals characterize the case and/or inference-initialization variation specified by each study; they do not estimate low-level arithmetic variation across executions. The one-field schedule study is consequently interpreted at its intended scope—conditional sensitivity on the evaluated cohort—rather than as a separate claim of cross-execution numerical robustness.


