DAP Inference
Depth for 360° photos, without the flat-world distortion
- dap_model
- image
- depth
- mask
This is the heart of the pack. DAP Inference runs Insta360's Depth Any Panorama model on an equirectangular (2:1) 360° image and hands you a depth map plus a mask. If you've never needed this, it's easy to shrug off - but the moment you point a normal depth model at a panorama, you'll understand why it exists.
Run Depth Anything or MiDaS on a 360° photo and it treats the sphere like a flat picture. The wall that wraps around the seam gets torn in half, verticals lean, and the poles of the sphere (top and bottom of the equirect) get smeared into nonsense. DAP is trained on panorama-heavy datasets - Matterport3D, Stanford2D3D, synthetic panos - so it understands the topology: the wall that's three meters in front of you is also three meters when it wraps around the edge. That's the whole pitch, and it's the one thing the general-purpose depth models can't give you.
What it does under the hood
It resizes your input to a multiple of 14 (the model's patch size), normalizes it with ImageNet stats, and runs inference in fp16/bf16/fp32 depending on what your DAP Loader chose. Two things come back: a raw depth prediction and the model's internal pred_mask - DAP's own estimate of which pixels are real panorama content versus boundary junk. The node uses that mask to clean up the edges, filling non-panorama areas with a "far" value before normalizing the map to 0–1.
Inputs and outputs
- dap_model - the
DAP_MODELoutput of DAP Loader. Nothing else satisfies this port. - image - your equirectangular panorama.
- invert_output (default on) - the model outputs white-far; ComfyUI's depth convention for ControlNet is white-close, so the node flips it for you. Leave it on for ControlNet work. Turn it off only if you want the raw research orientation or you're piping straight into geometry.
- resize_input (default on) - snaps the image to multiples of 14. Leave it on; turning it off risks a model error on odd dimensions.
The depth output is a standard IMAGE - preview it, feed it to a depth ControlNet (this is exactly the preprocessor slot in the ControlNet chain), or wire it into the pack's own DAP Panoramic Mesh and DAP Normal Map nodes. The mask output is a MASK where 1 = valid panorama content; pass it along to those same nodes so sky and boundary junk don't contaminate the mesh.
Installing and running
Install the pack (Manager → search "comfyui-dap", or git clone --recursive the repo into custom_nodes), then pip install -r requirements.txt in the ComfyUI venv - it pulls open3d, utils3d, mmengine, xformers and friends, so don't expect a fast install. First run downloads the ViT-Large weights from HuggingFace automatically, which can look like a freeze; it isn't.
Common issues
- Images come out noisy or NaN-ish in fp16 - DAP is known to be temperamental in fp16; the shipped template recommends
fp32on the loader. Bump precision before debugging anything else. - Black edges / missing areas - that's the mask doing its job, cleaning non-panorama boundaries. Feed the
maskoutput into your downstream nodes rather than fighting it. - Batch is slow - the node processes a batch frame-by-frame, so a stack of images is a serial queue, not a speedup. Fine for stills, not for video.
It's a niche tool for a niche workflow, but if your pipeline touches 360° media, it's the difference between broken seams and depth that actually makes sense.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| dap_model | DAP_MODEL | — | |
| image | IMAGE | — | |
| invert_output | BOOLEAN | true | — |
| resize_input | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| depth | IMAGE | — |
| mask | MASK | — |