Manuscript Offprint

arXiv:2611.07922

StitchEdit: Stitching Depth Priors into Image Editors via Per-Layer Gradient Probing

Qin Guo, Dan Xu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Text-guided image editing with diffusion models struggles with spatial edits (e.g. manipulating objects, changing viewpoints, manipulating occlusions) that depend on the 3D structure understanding of a scene. Marigold and follow-up work demonstrate that a pretrained diffusion backbone already harbors strong geometric priors that can be activated for depth estimation, yet how to redirect these priors toward editing remains unresolved. Through per-layer gradient probing, we discover that the editing and depth objectives are compatible in early transformer layers but actively conflict in late layers, explaining why naive depth-conditioned editing either ignores geometry or degrades visual quality. We present STITCHEDIT, which first activates the backbone's geometric capability via a lightweight depth-denoising adapter, then selectively fine-tunes this adapter for editing using a probe-guided per-layer learning rate schedule that preserves depth knowledge where it helps and prunes it where it conflicts. On the proposed StitchEditBench, a benchmark of 150 geometry-dependent edits spanning spatial transformation, occlusion manipulation, and viewpoint change, STITCHEDIT consistently surpasses both instruction-based and depth-conditioned baselines on perceptual quality and geometric fidelity.

1 Introduction

Moving an object closer should make it appear larger. Inserting furniture should respect occlusion boundaries. Changing a viewpoint should transform the entire depth field. These spatial edits are second nature to humans yet remain difficult for text-guided editing models [1, 8, 15, 18], which manipulate 2D appearance without explicit access to scene geometry. The 3D knowledge required for such edits is already present inside modern diffusion models in latent form. Marigold [10] and follow-up work [2, 7, 6, 11] show that a single diffusion backbone can be turned into a strong depth estimator with minimal adaptation, indicating that scene geometry is already represented internally as a byproduct of large-scale image generation. We build on this premise and ask not whether to use depth, but how to transfer the backbone's own depth capability toward the editing task.

The most natural strategy is to simply train the backbone for editing from text instructions and image-pairs. However, without explicit or implicit geometric guidance, the resulting model falls back on 2D pattern matching and cannot enforce spatial consistency, as shown in the Nano-Banana column of Figure 1. Another strategy is to first activate the backbone's depth capability and then continue training for spatial editing. However, this sequential transfer also fails: the editing gradient overwrites the geometric knowledge that the depth adapter encodes, and the resulting model (Depth-Init in Figure 1) performs no better than one trained for editing from scratch. The question, then, is which layers can be safely fine-tuned for editing without losing the geometric features that make depth-aware editing possible.

*Corresponding author. Project page: https://guoqincode.github.io/StitchEdit/

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

Figure

Figure 1: Top: Challenging 3D-aware edits generated by STITCHEDIT conditioned on text instructions. The model accurately handles complex object repositions and occlusions while strictly preserving visual quality. Bottom: Qualitative comparison against baselines. Nano-Banana [4] manipulates 2D appearance without explicit scene geometry, while uniformly fine-tuning the depth adapter (Depth-Init) leads to catastrophic forgetting, causing structural failures.

We answer this with a per-layer gradient probe that measures, at each transformer layer, the cosine alignment between the editing gradient and the depth gradient. This gradient probing profile is strongly positive in early transformer layers, decays through the middle, and turns negative in late layers (Figure 3). The mechanism behind the sign flip is the well-documented division of labor inside diffusion transformers [21, 17, 19]: early layers carry the spatial layout that organizes a scene, where editing and depth make compatible demands, while late layers synthesize the textures and materials that render it, where the depth signal conflicts with the appearance variation editing seeks. The implication for editing is direct: the depth adapter should be fine-tuned only where the probe is positive, and pruned entirely from the layers where it would actively degrade geometric knowledge.

We propose STITCHEDIT, a two-stage framework that turns this analysis into a concrete training strategy. We first activate the geometric capability of the backbone with a lightweight depth-denoising adapter, confirming that the backbone already encodes rich geometric structure. We then selectively fine-tune the resulting adapter for editing using a per-layer learning rate schedule derived from the gradient probing profile: compatible layers train at full rate, transition layers at reduced rate, and conflicting layers are pruned outright. Because no additional gating networks or auxiliary losses are needed, the method is simple to implement and adds no overhead at inference. On the proposed StitchEditBench, a benchmark of 150 geometry-dependent edits spanning spatial transformation, occlusion manipulation, and viewpoint change, STITCHEDIT consistently outperforms both instruction-based and depth-initialized baselines while preserving generation quality.

In summary, this paper makes three contributions. First, we introduce per-layer gradient probing, a layer-wise measurement of cross-objective compatibility, and show that it reveals the structural cause of depth-knowledge degradation during editing fine-tuning. Second, we propose STITCHEDIT, whose probe-guided training schedule selectively fine-tunes only the layers where depth and editing objectives are compatible, requiring no complex inference-time mechanisms. Third, we construct

Figure

Figure 2: Overview of STITCHEDIT. Stage 1: Depth activation via a frozen-backbone LoRA adapter. Per-layer gradient probing reveals the layer-wise compatibility between the depth and editing objectives. Stage 2: The probing profile fundamentally determines both the LoRA pruning boundary and the per-layer learning rate schedule for the editing fine-tuning.

StitchEditBench, a 150-case benchmark of geometry-dependent edits, and show that STITCHEDIT consistently outperforms instruction-based and depth-initialized baselines.

References (24)