AnyStitch: Generative Large Parallax Image Stitching

Zixuan Chen, Lingen Li, Junhao Zhuang, Ruikang Li, Tianfan XuearXiv 2026 · DOI

TL;DR

Have you ever tried taking a panorama while walking down a street, only to watch your phone slice cars in half and melt buildings together? AnyStitch solves this "large parallax" problem by ditching traditional 2D cut-and-paste warping altogether, reimagining panorama stitching as a 3D-guided generative process. By teaching a diffusion transformer where input photos belong in 3D space without physically distorting their pixels, it seamlessly synthesizes casual, multi-view snapshots into massive, artifact-free panoramas.

What Problem Does This Paper Address?

Classic panorama stitching relies on a "warp-and-blend" pipeline: align overlapping images in 2D (using homographies or optical flow) and fuse the seams. This works great if you stand completely still and pivot like a tripod.

However, if you translate the camera—say, in a casual "walk-and-shoot" tour around a landmark—foreground objects shift dramatically relative to the background. This is motion parallax. Because 2D transformations assume a flat world, they cannot untangle overlapping 3D structures, resulting in ghosting, bent architectural lines, and visible seams. On the flip side, naively feeding unaligned photos into an image generator fails too: standard diffusion models assume inputs and outputs share the same spatial grid, and they choke computationally when asked to generate massive panoramic aspect ratios in a single pass.

Methods

AnyStitch bridges 3D geometric perception with a pre-trained Diffusion Transformer (DiT), specifically fine-tuning FLUX.2-klein-9B via LoRA. Instead of warping pixels, it warps positional encodings.

  • 3D Grounding: First, a standard feed-forward 3D model (Depth Anything 3) estimates camera poses and dense depth maps for all input views, mapping them onto a user-defined target viewpoint and projection canvas (rectilinear, cylindrical, or equirectangular).
  • Hierarchical Projected RoPE (HPRoPE): Rather than projecting RGB pixels into 3D—which causes ugly tearing when depth estimates are noisy—AnyStitch leaves the input image tokens untouched and modifies their Rotary Positional Encodings (RoPE) to reflect where they land on the target canvas. Crucially, HPRoPE splits the transformer's attention heads evenly in half: one half gets fine-grained dense-depth coordinates, while the other gets stable, planar median-depth coordinates.
  • Spatial Autoregressive Generation: To bypass resolution limits, AnyStitch generates the panorama patch-by-patch ($1024 \times 1024$ windows) expanding outward from the center. Each step conditions on noisy canvas tokens, relevant input tokens, and memory tokens from overlapping, already-generated regions. To prevent the DiT from breaking when canvas coordinates or view counts grow huge, the authors normalize RoPE coordinates locally within each window (relative positional encoding).

Datasets

Supervised diffusion fine-tuning requires ground-truth panoramas paired with wide-baseline inputs—something real-world photography can't easily capture simultaneously.

  • AnyStitchSyn (New): The authors built a synthetic dataset using 1,000 3D Gaussian Splatting (3DGS) scenes from InteriorGS. By virtually translating and rotating cameras, they rendered 2,192 training pairs (and 100 test pairs) with large disparities alongside pixel-perfect rectilinear, cylindrical, and equirectangular ground truths.
  • Evaluation Benchmarks: Real-world testing was conducted on two challenging large-parallax benchmarks—PTIS and RISMR—as well as multi-view scenes from Tanks and Temples and street-view sweeps.

Key Insights and Ideas

  • Virtual warping beats pixel warping: Hard-projecting pixels using estimated depth destroys information at occlusion boundaries (e.g., decapitating a roof statue). Encoding 3D projections into RoPE acts as a soft geometric prior, letting the DiT's attention mechanism resolve depth noise gracefully. Specifically, HPRoPE improves synthetic test PSNR to 21.39 dB, compared to 20.72 dB for pixel-projected inputs and 13.71 dB for a geometry-free baseline.
  • Dual-precision attention gives the best of both worlds: Giving half the attention heads dense depth nails 3D perspective, while giving the other half median depth acts as a safety net that preserves object structure when local depth fails.
  • Generative stitching unlocks bonus tasks: Because the output is synthesized rather than blended, the exact same framework naturally handles isolated moving pedestrians, cross-time stitching (day-to-night), misaligned HDR exposure fusion, and panoramic outpainting.

Key Results

AnyStitch consistently outperforms traditional warpers (SPW, LPC), unsupervised deep stitchers (UDIS++, RopStitch), 3D-projection pipelines (PIS3R/LiftProj-style), and prior generative stitchers (SRStitcher, GPIS):

  • Synthetic Full-Reference (AnyStitchSyn): Achieves 0.8061 SSIM and 0.3200 LPIPS (using estimated geometry, not ground-truth depth), beating RopStitch (0.7487 SSIM / 0.5052 LPIPS) and SRStitcher (0.7165 SSIM / 0.5408 LPIPS).
  • Real-World No-Reference (SIQS ↑): Scores 9.40 on PTIS and 9.71 on RISMR, outperforming SRStitcher (8.00 / 7.88) and the 3D-based PIS3R/LiftProj reproduction (7.91 / 8.36).
  • Human & Multimodal LLM Preference: In pairwise user studies and mLLM evaluations, AnyStitch was preferred 86% and 94% of the time, respectively, whereas no baseline cleared 21%.

Limitations and Future Work

  • Speed & Compute: Running a 40-step diffusion model autoregressively is heavy—synthesizing a 2K panorama takes ~5 minutes and ~40 GB of VRAM on an NVIDIA A800 GPU. Step distillation is a key next step.
  • Fidelity Risks: Because the pixels are generated, AnyStitch isn't suited for measurement-critical tasks like satellite mapping or forensics where hallucinated details are unacceptable.
  • Crowded Dynamic Scenes: While it shrugs off an isolated walking pedestrian, busy crowds captured across multiple timestamps still confuse the model, leading to duplicated or ghosted people—a gap the authors hope to close with dynamic-scene training data.

Summary updated

BibTeX
@misc{chen2026anystitch,
  author = {Zixuan Chen and Lingen Li and Junhao Zhuang and Ruikang Li and Tianfan Xue},
  title = {{AnyStitch: Generative Large Parallax Image Stitching}},
  year = {2026},
  eprint = {2611.37898},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.37898},
}
Figure