Nodes/ComfyUI-ArchAi3d-Qwen/🎯 Metric3D Depth (Low VRAM)
ComfyUI Node

🎯 Metric3D Depth (Low VRAM)

Depth in meters, not just grayscale β€” from a single photo

By amir84ferdosΒ·Created 11 months agoΒ·Updated 5 months agoΒ· 70
🎯 Metric3D Depth (Low VRAM)
  • image
  • depth_map
β—„namemetric3d_depthβ–Ί
β—„backbonevit-smallβ–Ί
β—„resolution512β–Ί
β—„use_cachetrueβ–Ί
β—„fx1000β–Ί
β—„fy1000β–Ί

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, or vit-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.

CategoryArchAi3d/3D

Inputs (7)

NameTypeDefaultDescription
nameSTRINGmetric3d_depthIdentifier name for this input (used by web interface)
imageIMAGEβ€”
backboneCOMBOvit-smallModel backbone. vit-small uses less VRAM (~1-2GB), vit-giant2 uses most (~4-6GB)
resolutionINT51264–8192Processing resolution. Lower = faster + less VRAM
use_cacheBOOLEANtrueUse disk cache to avoid reprocessing identical inputs
fxoptINT10001–8192Focal length X (camera intrinsic)
fyoptINT10001–8192Focal length Y (camera intrinsic)

Outputs (1)

NameTypeDescription
depth_mapIMAGEβ€”