π― Metric3D Depth (Low VRAM)
Depth in meters, not just grayscale β from a single photo
- image
- depth_map
Most depth estimators hand you a relative map: brighter = closer, but with no actual scale, so "how far is that wall" is unanswerable. Metric3D is different - it estimates depth in real-world units, so the numbers coming out are actual distances. That's the difference between a depth map that looks nice and one you can build geometry from. ArchAi3D_Metric3D_Depth wraps Metric3D for ComfyUI with a low-VRAM strategy, and it's part of why this pack got interesting: a metric depth node that unloads the model after every run so it plays nice with a 6GB card.
How it works
The node auto-downloads the right checkpoint from HuggingFace on first use - metric_depth_vit_small_800k.pth, metric_depth_vit_large_800k.pth, or metric_depth_vit_giant2_800k.pth depending on your backbone pick - then runs Metric3D inference on your image and extracts the depth channel. Inputs:
image- the photo. One in, a depth map out.backbone-vit-small(~1β2GB VRAM),vit-large, orvit-giant2(~4β6GB). The tooltip says it plainly: small is for low-VRAM, giant2 is the quality ceiling. Start small.resolution- processing resolution, default 512. Lower = faster + less VRAM; this is the first lever to pull when you OOM.use_cache(default True) - results hash to disk, so re-running the same image skips inference entirely.fx/fy(default 1000) - the camera's focal lengths, the intrinsic parameters Metric3D needs. The default 1000 is a reasonable stand-in for a phone photo; if you know the actual focal length (EXIF often has it), set it - the closer to truth, the more physically accurate the meter values.
Output: depth_map, an IMAGE you can pipe to a ControlNet preprocessor-style workflow, a 3D parallax warper, or a displacement map for Blender.
Where it fits
The KB's depth-estimation essay maps the territory: MiDaS for legacy, Depth Anything for ControlNet work, Marigold for generative quality. Metric3D's niche is measurement - photogrammetry, relighting that needs real distances, geometry for 3D tools - because only metric depth gives you meters. For most ControlNet conditioning, honestly, Depth Anything is simpler and faster. Reach for this node when you need scale, not just shape. (If you want surface orientation instead of distance, the pack's sibling ArchAi3D_Metric3D_Normal runs the same engine and outputs normal maps.)
Install and caveats
cd ComfyUI/custom_nodes
git clone https://github.com/amir84ferdos/ComfyUI-ArchAi3d-Qwen.git
cd ComfyUI-ArchAi3d-Qwen && pip install -r requirements.txt
Metric3D needs the heavier ML stack - opencv, timm, scipy, matplotlib, addict, yapf - all in requirements.txt, or install just the Metric3D group via the pack's ArchAi3D_Dependency_Installer node. ComfyUI Manager β search "ArchAi3d Qwen" also works.
Caveats: first run downloads a checkpoint (several GB for the giant backbone), so budget for that. Metric depth is only as accurate as its calibration - a 6GB card with vit-small at resolution 512 is fine for relative structure and rough scale, but don't build a floor plan off it. And the standing pack note: free personal, paid commercial.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| name | STRING | metric3d_depth | Identifier name for this input (used by web interface) |
| image | IMAGE | β | |
| backbone | COMBO | vit-small | Model backbone. vit-small uses less VRAM (~1-2GB), vit-giant2 uses most (~4-6GB) |
| resolution | INT | 51264β8192 | Processing resolution. Lower = faster + less VRAM |
| use_cache | BOOLEAN | true | Use disk cache to avoid reprocessing identical inputs |
| fxopt | INT | 10001β8192 | Focal length X (camera intrinsic) |
| fyopt | INT | 10001β8192 | Focal length Y (camera intrinsic) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| depth_map | IMAGE | β |