A ComfyUI extension for the Insta360 DAP (Depth Any Panorama) model. This plugin provides high-quality depth estimation specifically optimized for panoramic (equirectangular) images, with seamless integration for 3D workflows.
- Clone this repository into your
ComfyUI/custom_nodesfolder.cd ComfyUI/custom_nodes git clone --recursive https://github.com/maxious/comfyui-dap - Install the required dependencies in your ComfyUI virtual environment:
# Example for Windows with the default venv
"S:/ComfyUI/venv/Scripts/python.exe" -m pip install -r requirements.txt
# IMPORTANT: You need xformers for optimal performance and compatibility
"S:/ComfyUI/venv/Scripts/python.exe" -m pip install torch torchvision xformers -U --index-url https://download.pytorch.org/whl/cu130Handles automatic weight downloading from HuggingFace and model initialization.
- model_size: Currently only
vitlis available (official Large weights). - precision: Choose between
fp16,fp32, andbf16. - Auto-Patching: Automatically fixes hardcoded relative paths in the research codebase to work within ComfyUI.
The primary node for generating depth maps from panoramas.
- image: Input panoramic image.
- invert_output: Invert the depth map (standard for ComfyUI depth).
- resize_input: Resizes to the model's preferred patch size (multiples of 14).
- Masking: Uses the model's internal prediction mask to clean up non-panorama boundaries.
Generates 3D geometry from the depth map using spherical unprojection.
- Compatibility: Outputs a
TRIMESHobject, making it fully compatible with ComfyUI-GeometryPack. - mesh_scale: Factor to scale the 3D depth intensity.
- downsample: Reduce mesh density for faster performance.
Generates surface normals optimized for panoramic projections.
- normal_standard: Choose between
ComfyUI(standard RGB) orDAP(original research format). - Spherical Awareness: Computes normals based on 3D unprojected points rather than 2D pixel gradients.
Converts Equirectangular (2:1) panoramas into Cube Map faces.
- layout:
six_faces(returns a batch of 6) orcross(standard 3x4 grid). - interpolation: Uses high-quality
lanczosby default.
A basic workflow template is included in the workflow_templates directory. You can access it through the ComfyUI "Templates" menu or by dragging and dropping workflow_templates/dap_basic.json into the ComfyUI workspace.
To test the model, you can use this official sample panoramic image:
- Submodule: This plugin uses the official DAP repository as a Git submodule (
dap_core) to ensure compatibility with future research updates. - Interoperability: By using standard
TRIMESHandIMAGEtypes, DAP outputs can be piped directly into mesh decimators, 3D exporters, and controlnets.
This plugin includes a pytest suite for headless verification of all nodes.
"S:/ComfyUI/venv/Scripts/python.exe" -m pytestThis project was developed with a focus on robust environment handling and automated testing. All core features from the initial PRD (Loader, Inference, Geometry, Conversions, and Normals) are completed and verified.
Next Steps:
- Tiling support for ultra-high resolution (8k+) panoramas.
- Integration of additional model sizes (vits/vitb/vitg) as they are released.