DepthPro Estimate
Apple's DepthPro in ComfyUI, with both metric and relative depth
- depth_model
- image
- depth_map
- disparity_map
- raw_depth
- raw_inverse
- visualization
- focal_length
This is the depth engine of the Refocus pack. DepthProEstimate runs Apple's ml-depth-pro model on your image and spits out six outputs, from pretty colorized depth maps down to raw metric depth in meters. If you're building the full refocus workflow, this is what generates the disparity map that eventually becomes the defocus map - depth in, blur out.
DepthPro is worth knowing about as a model too. It was one of the eight depth estimators in the big r/StableDiffusion bake-off that everyone cites, and it's notable for giving sharp monocular depth with absolute scale - no stereo rig, no known camera intrinsics, just one photo. The community's long-standing verdict from the KB applies here: for conditioning you want relative structure with crisp edges, but for measurement you want metric. This node gives you both, which is exactly why it's more flexible than most depth nodes.
The mode switch that actually matters
depth_mode has two settings and the tooltip spells out the trade:
- relative (default) - normalized depth structure, focal length ignored. The README compares it to Marigold: great visual quality, and it's the mode you want feeding ComputeDefocusMap.
- metric - absolute depth in meters, which uses the focal length. Use it when a downstream consumer genuinely needs distances (measurement, 3D work).
The KB's oldest lesson applies verbatim here: metric accuracy is not what you want for control/conditioning work - relative depth with sharp edges is. For refocusing, you're in the "visual quality" camp, so leave it on relative.
The inputs you'll touch
- depth_model - from Load DepthPro Model (DepthProModelLoader). Required.
- image - required.
- focal_length_px (0) - leave at 0 to auto-estimate from DepthPro's FOV head.
- colormap (turbo) - visualization only. Turbo matches Apple's official examples; grayscale is available if you want the raw look.
- interpolation (bicubic) - resizing quality. Bicubic gives sharper edges; only reach for bilinear if you're chasing speed.
The six outputs, decoded
- depth_map / disparity_map - colorized visualizations (near = warm). The disparity one is your defocus-map feedstock.
- raw_depth / raw_inverse - unnormalized values: real meters in metric mode. These are what you'd normalize with DepthMetricToRelative or DepthMetricToInverse, or measure with.
- visualization - a 3-panel matplotlib figure (input image, depth, histogram). Great for debugging whether depth actually separated your subject.
- focal_length - estimated focal length in pixels (FLOAT), handy for the Focal PX→MM converter.
Install and gotchas
Grab the ~500MB depth_pro.pt from apple/DepthPro on HuggingFace into models/checkpoints/, then make sure the Apple library is installed (the loader will literally print the command if it's missing):
pip install git+https://github.com/apple/ml-depth-pro.git --no-deps
pip install pillow_heif
Two license flags worth knowing: Apple's ml-depth-pro is Sample Code / research only - fine for experiments, don't sell a product on it without checking - and the FLUX.1-dev base the full pipeline wants is non-commercial. The node itself takes the first image in a batch, so feed it a single image at a time. It's not fast, either - DepthPro is a big ViT-based model, and on a consumer card you're looking at a few seconds per image. That's normal, not a hang.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| depth_model | DEPTH_PRO_MODEL | — | |
| image | IMAGE | — | |
| focal_length_pxopt | FLOAT | 0.00–10000 | Focal length in pixels. 0 = auto-estimate from FOV head |
| depth_modeopt | COMBO | relative | metric = absolute depth in meters (uses focal length). relative = normalized depth structure (ignores focal length, similar to Marigold). |
| colormapopt | COMBO | turbo | Colormap for visualization. 'turbo' matches Apple's official examples. |
| interpolationopt | COMBO | bicubic | Interpolation mode for resizing. 'bicubic' gives sharper edges. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| depth_map | IMAGE | — |
| disparity_map | IMAGE | — |
| raw_depth | IMAGE | — |
| raw_inverse | IMAGE | — |
| visualization | IMAGE | — |
| focal_length | FLOAT | — |