cecret3350/AnyStitch
HF Paper ↗Depth-guided diffusion stitching for large-parallax panoramas
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
AnyStitch separates geometric alignment from image synthesis. DA3NESTED-GIANT-LARGE estimates a depth map and camera pose for each overlapping photograph. Those estimates drive reprojection into a chosen target view, after which a diffusion model generates the panorama patch by patch. This gives the pipeline a way to handle depth-dependent displacement caused by camera translation rather than forcing all scene depths into one planar warp.
The Python CLI has separate entry points for v1 (stitch.py) and paper reproduction (stitch_old.py), and setuptools discovers the stitching and diffsynth packages. The runtime includes PyTorch, torchvision, transformers==4.57.6, OpenCV, Pillow, and safetensors. The diffusion stack draws its text encoder and VAE from FLUX.2-klein-9B and its transformer and tokenizer from FLUX.2-klein-base-9B. --lora is the exposed interface for selecting a local stitching adapter; additional geometry backends are listed as future work, not current options.
Key Capabilities & Differentiators
Custom scenes require at least two overlapping photos with the same aspect ratio, named in camera order. The default is an average camera pose with cylindrical projection. The CLI also exposes rectilinear and equirectangular projections and can anchor the output to the last camera. --intermediates saves the per-view reprojections, the pre-stitch, and the panorama after each patch, making it possible to distinguish misalignment already present in the geometry stage from changes introduced later by diffusion.
The bundled RISWMR subset contains 14 two-view scenes with matching saved outputs for the paper checkpoint and v1. Its preset uses the last camera, rectilinear projection, center-first generation, 40 diffusion steps, panorama seed 219, and recorded per-scene geometry seeds. AnyStitchSyn adds 2,192 training pairs rendered from 950 InteriorGS scenes, with geometry and ground-truth targets at an intermediate camera pose for three projections. These are concrete evaluation and research assets, not evidence of a complete training workflow on the main branch.
Trade-offs & Limitations
A conventional feature-matching, homography, and blending pipeline avoids running multiple neural models and is a useful baseline when rotation dominates or an approximately planar scene aligns well. AnyStitch is a better candidate when translation prevents foreground and background from aligning together. Its quality still depends on inferred depth and poses, and diffusion may synthesize plausible content that no input captured. A clean seam is therefore not proof of geometric or photometric fidelity.
Local execution can keep photos on the workstation, but it shifts model storage, cache provisioning, and CUDA compatibility onto the operator. The 14-scene two-view subset is useful for regression testing, not for establishing quality or scaling limits on arbitrary captures. The separate two-stage pipeline behind the 104.47 MP demo and cleaned-up training code are not part of the documented main-branch workflow. Apache-2.0 applies to the repository; review the terms for external weights, adapters, and data separately before commercial use or redistribution.
Hardware & Deployment Guide
The package requires Python 3.10 or later, while the installation path uses Python 3.11 on Linux with an NVIDIA GPU, CUDA 12.4 PyTorch 2.6.0 and torchvision 0.21.0 wheels, and a Git-pinned Depth Anything 3 dependency. FLUX weights default to ModelScope and can be switched to Hugging Face; DA3 downloads from Hugging Face. For offline runs, stage the task LoRA and both model caches, configure DIFFSYNTH_MODEL_BASE_PATH and DA3_CACHE_DIR, then set DIFFSYNTH_SKIP_DOWNLOAD=true and HF_HUB_OFFLINE=1.
V1 is the path for new photos and uses a 675 MB LoRA. Keep stitch_old.py and the 169 MB paper LoRA together for paper reproduction. For pixel-level comparisons, match the saved-output environment beyond the quick-start pins: it used an NVIDIA A800, Python 3.11.13, xFormers 0.0.29, and specific numerical and image-library versions. No minimum VRAM or timing figures are provided. Profile both geometry and diffusion on representative inputs before committing to a GPU size or batch throughput.
--intermediates saves individual reprojections, the pre-stitch, and the panorama after each patch.Researchers and imaging engineers evaluating large-parallax stitching, comparing target viewpoints, or reproducing the bundled two-view results on a local NVIDIA GPU.
You need strictly source-faithful output, a ready-to-run training workflow, or the separate pipeline used for the 104.47 MP demo.
Quick Start & Installation
git clone --branch main https://github.com/cecret3350/AnyStitch.git cd AnyStitch conda create -n anystitch python=3.11 -y conda activate anystitch python -m pip install torch==2.6.0 torchvision==0.21.0 --index-url https://download.pytorch.org/whl/cu124 python -m pip install 'torch==2.6.0' 'torchvision==0.21.0' \ 'depth-anything-3 @ git+https://github.com/ByteDance-Seed/Depth-Anything-3.git@ed6989a23cd389e975ed9f7cbd7385396e6d867e' -e .
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/cecret3350/AnyStitch.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about AnyStitch
How do I integrate AnyStitch into a local image-processing workflow?
stitch.py with the v1 LoRA for new scenes, pass an ordered image directory with --scene, and write to a separate directory with --output. Custom scenes default to cylindrical projection and an average camera pose. Use --target-view last to anchor the panorama to the last input camera and --intermediates to inspect the projections and patch-by-patch output.What GPU and VRAM should I budget for?
Can I use it commercially and run it without network access?
When should I choose AnyStitch over conventional panorama stitching?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy